Thank you for your interest in contributing to mcpls! This document provides guidelines and information for contributors.
This project follows the Rust Code of Conduct. Please be respectful and constructive in all interactions.
- Rust 1.85+ (Edition 2024)
- cargo-nextest for running tests:
cargo install cargo-nextest - A language server for testing (e.g., rust-analyzer)
-
Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/mcpls cd mcpls -
Build the project:
cargo build
-
Run tests:
cargo nextest run
-
Run clippy:
cargo clippy --all-targets --all-features -- -D warnings
feature/description- New featuresfix/description- Bug fixesdocs/description- Documentation changesrefactor/description- Code refactoring
Follow conventional commit format:
type(scope): description
[optional body]
[optional footer]
Types: feat, fix, docs, style, refactor, test, chore
Examples:
feat(mcp): add get_workspace_symbols tool
fix(lsp): handle server crash gracefully
docs(readme): add pyright configuration example
- Create a feature branch from
main - Make your changes with clear, focused commits
- Ensure all tests pass:
cargo nextest run - Ensure clippy is happy:
cargo clippy --all-targets --all-features -- -D warnings - Ensure code is formatted:
cargo +nightly fmt --check - Update documentation if needed
- Submit a pull request
- Tests added/updated for new functionality
- Documentation updated
- CHANGELOG.md updated (for user-facing changes)
- No clippy warnings
- Code formatted with
cargo +nightly fmt
mcpls/
├── crates/
│ ├── mcpls-core/ # Core library (protocol translation)
│ │ ├── src/
│ │ │ ├── lsp/ # LSP client implementation
│ │ │ ├── mcp/ # MCP tool definitions
│ │ │ ├── bridge/ # Translation layer
│ │ │ └── config/ # Configuration types
│ │ └── tests/
│ └── mcpls-cli/ # CLI application
├── docs/
│ └── adr/ # Architecture Decision Records
├── examples/
└── tests/fixtures/
- Follow Rust API Guidelines
- Follow Microsoft Rust Guidelines
- Use
rustfmtfor formatting - Address all clippy warnings
- Use
thiserrorfor library errors inmcpls-core - Use
anyhowfor application errors inmcpls-cli - Provide context with errors using
.context()or custom messages
- Document all public APIs
- Include examples in doc comments where helpful
- Keep documentation up-to-date with code changes
- Write unit tests for new functionality
- Write integration tests for LSP communication
- Use
rstestfor parameterized tests - Aim for meaningful coverage, not just high percentages
Major architectural decisions are documented in docs/adr/. When proposing significant changes:
- Create a new ADR document
- Describe the context, decision, and consequences
- Reference the ADR in your PR
- Open an issue for bugs or feature requests
- Start a discussion for questions or ideas
- Check existing issues before creating new ones
By contributing to mcpls, you agree that your contributions will be licensed under the MIT OR Apache-2.0 license.