Contributing to MCP Tree-sitter Server banner
wrale wrale

Contributing to MCP Tree-sitter Server

Development community intermediate

Description

Thank you for your interest in contributing to MCP Tree-sitter Server! This guide will help you understand our development process and coding standards.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

Repository README

This is the README for wrale/mcp-server-tree-sitter, shared by 4 entries in this directory. It describes the repository, not this entry specifically.

Contributing to MCP Tree-sitter Server

Thank you for your interest in contributing to MCP Tree-sitter Server! This guide will help you understand our development process and coding standards.

Development Setup

  1. Clone the repository:

    git clone https://github.com/organization/mcp-server-tree-sitter.git
    cd mcp-server-tree-sitter
  2. Install with development dependencies:

    make install-dev
  3. Install language parsers (optional):

    make install-languages

Code Style and Standards

We follow a strict set of coding standards to maintain consistency throughout the codebase:

Python Style

  • We use Black for code formatting with a line length of 88 characters
  • We use Ruff for linting
  • We use MyPy for static type checking

Exception Handling

  • Use specific exception types rather than catching generic exceptions when possible
  • When re-raising exceptions, use the from clause to preserve the stack trace:
    try:
        # Some code
    except SomeError as e:
        raise CustomError("Meaningful message") from e

Testing

  • Write tests for all new functionality
  • Run tests before submitting:
    make test

Documentation

  • Document all functions, classes, and modules using docstrings
  • Follow the Google Python Style Guide for docstrings
  • Include type hints for all function parameters and return values

Development Workflow

  1. Create a branch for your feature or bugfix:

    git checkout -b feature/your-feature-name
  2. Make your changes and ensure they pass linting and tests:

    make format
    make lint
    make test
  3. Commit your changes with a clear message describing the change

  4. Submit a pull request to the main repository

Running the Server

You can run the server in different modes:

  • For development and testing:

    make mcp-dev
  • For direct execution:

    make mcp-run
  • To install in Claude Desktop:

    make mcp-install

Project Architecture

The project follows a modular architecture:

  • config.py - Configuration management
  • language/ - Tree-sitter language handling
  • models/ - Data models for AST and projects
  • cache/ - Caching mechanisms
  • resources/ - MCP resources (files, AST)
  • tools/ - MCP tools (search, analysis, etc.)
  • utils/ - Utility functions
  • prompts/ - MCP prompts
  • server.py - FastMCP server implementation

Seeking Help

If you have questions or need help, please open an issue or contact the maintainers.