MCP Tools
MCP Tools is a Rust library and server suite implementing the Model Context Protocol (MCP) with tools for Git operations, code analysis, web operations, and system management. Built on top of CoderLib and the official Rust MCP SDK, it provides MCP servers and clients for AI integration.
Why MCP Tools?
- MCP Compliant - Built on official Rust MCP SDK for protocol compliance
- Modular Design - Individual servers for specific tool categories
- Docker Ready - Container images and docker-compose setup
- Easy Integration - Library and standalone binary options
- Rust Performance - Memory-safe, fast, and reliable implementation
MCP Server Suite
Git Tools Server (git-server)
Provides Git repository operations via MCP protocol:
- git_status - Repository status including modified, added, deleted files
- git_diff - File differences and change analysis
- git_log - Commit history with filtering options
- git_blame - Line-by-line authorship information
- git_branches - Branch listing and information
Built with git2 library for robust Git operations.
Code Analysis Server (code-analysis-server)
Provides basic code analysis capabilities:
- analyze_code - Basic code structure analysis
- detect_language - Programming language detection from file content
- complexity_analysis - Simple complexity metrics calculation
- security_analysis - Basic security pattern detection
Currently supports: Rust, Python, JavaScript, TypeScript, Go, Java, C, C++ Uses tree-sitter for syntax parsing where available.
Web Tools Server (web-server)
Provides web operations via HTTP client:
- http_request - HTTP requests (GET, POST, PUT, DELETE, PATCH)
- analyze_webpage - Basic web page content extraction
- analyze_url - URL structure parsing and validation
- fetch_content - Content downloading with type detection
Built with reqwest for HTTP operations.
System Tools Server (system-server)
Provides system operations with safety controls:
- execute_command - Shell command execution with filtering
- get_system_info - Basic system information
- get_environment - Environment variable access
- get_processes - Process listing and information
Includes basic security filtering for command execution.
File Operations Server (file-operations-server)
Provides file system operations:
- read_file - Read file contents
- write_file - Write content to files
- list_directory - Directory listing
Unified Server (mcp-server)
Combines all servers into a single process:
- Selective Tools - Enable/disable specific tool categories via
--toolsflag - Single Process - All tools available through one server instance
- Shared Configuration - Common configuration across all tools
CLI Client (mcp-cli)
Basic command-line client for testing and interaction:
- Tool Execution - Direct tool invocation with JSON parameters
- Interactive Mode - Basic interactive session support
- Multiple Servers - Connect to different MCP servers
Installation & Quick Start
Option 1: Install Binaries
# Install all MCP Tools binaries
# Verify installation
Option 2: Library Integration
Add to your Cargo.toml:
[]
= "0.1.0"
= "0.1.0" # Required dependency
= { = "1.0", = ["full"] }
Basic Library Usage
use ;
async
Running Standalone Servers
# Unified server (recommended for most use cases)
# Individual specialized servers
# CLI client usage
Docker Deployment
# Quick start - unified server
# Individual servers
# Production deployment with docker-compose
# With nginx proxy and SSL
One-Command Setup
# Download and run setup script
|
# Or using our Makefile
Complete Tool Reference
Git Tools (5 tools)
| Tool | Description | Example Usage |
|---|---|---|
git_status |
Repository status and changes | git_status repo_path=/path/to/repo |
git_diff |
Show file differences | git_diff repo_path=/path/to/repo file=src/main.rs |
git_log |
Commit history with filtering | git_log repo_path=/path/to/repo limit=10 |
git_blame |
Line-by-line authorship | git_blame repo_path=/path/to/repo file=src/lib.rs |
git_branches |
Branch information | git_branches repo_path=/path/to/repo |
Code Analysis Tools (4 tools)
| Tool | Description | Languages Supported |
|---|---|---|
analyze_code |
Basic code structure analysis | Rust, Python, JS, TS, Go, Java, C, C++ |
detect_language |
Programming language detection | Auto-detection from content/extension |
complexity_analysis |
Simple complexity metrics | Basic cyclomatic complexity |
security_analysis |
Basic security pattern detection | Simple pattern matching |
Web Tools (4 tools)
| Tool | Description | Features |
|---|---|---|
http_request |
HTTP client operations | GET, POST, PUT, DELETE, PATCH |
analyze_webpage |
Basic web page analysis | Content extraction and metadata |
analyze_url |
URL structure parsing | Protocol, domain, path analysis |
fetch_content |
Content downloading | Basic content fetching |
System Tools (4 tools)
| Tool | Description | Security Level |
|---|---|---|
execute_command |
Shell command execution | Basic command filtering |
get_system_info |
System information | Read-only system data |
get_environment |
Environment variables | Basic environment access |
get_processes |
Process information | Process list and basic stats |
File Operations Tools (3 tools)
| Tool | Description | Security Level |
|---|---|---|
read_file |
Read file contents | Path validation |
write_file |
Write content to files | Path validation |
list_directory |
Directory listing | Basic directory access |
Architecture & Design
Modular Architecture
mcp-tools/
├── servers/ # MCP server implementations
│ ├── git_tools.rs # Git repository operations
│ ├── code_analysis.rs # Multi-language code analysis
│ ├── web_tools.rs # Web scraping and HTTP tools
│ ├── system_tools.rs # System operations and commands
│ └── file_operations.rs # File system operations
├── clients/ # MCP client implementations
│ ├── cli.rs # Command-line interface
│ └── desktop.rs # Desktop application framework
├── common/ # Shared infrastructure
│ ├── server_base.rs # Base server functionality
│ ├── client_base.rs # Base client functionality
│ ├── transport.rs # Transport layer (HTTP/WS/Stdio)
│ ├── protocol.rs # MCP protocol definitions
│ └── config.rs # Configuration management
├── bin/ # Standalone executables
│ ├── mcp-server.rs # Unified server (all tools)
│ ├── git-server.rs # Git-only server
│ ├── code-analysis-server.rs # Code analysis server
│ ├── web-server.rs # Web tools server
│ ├── system-server.rs # System tools server
│ └── mcp-cli.rs # CLI client
└── docker/ # Container configurations
├── Dockerfile # Multi-stage build
├── docker-compose.yml # Service orchestration
└── nginx.conf # Reverse proxy config
Technology Stack
- Rust - Memory-safe systems programming
- CoderLib - Core library providing AI-powered code assistance tools
- RMCP - Official Rust MCP SDK for protocol compliance
- Tree-sitter - Syntax-aware code parsing (where available)
- Git2 - Git operations library
- Reqwest - HTTP client with async support
- Tokio - Async runtime for performance
- Docker - Containerization and deployment
Security Features
Basic Security
- Input Validation - Parameter validation and sanitization
- Command Filtering - Basic dangerous operation blocking
- Path Validation - Directory traversal prevention
- Non-root Execution - Containers run as unprivileged user
- Request Logging - Basic operation tracking
Security Example
// Example: Basic file operations with validation
use FileOperationsServer;
async
Deployment Options
Available Deployment Methods
- Standalone Binaries - Single-file executables via
cargo install - Docker Containers - Pre-built container images
- Docker Compose - Multi-service orchestration
- Library Integration - Embed in your Rust applications
Basic Monitoring
- Health Checks - Basic health endpoints
- Request Logging - Simple request/response logging
- Error Tracking - Basic error reporting
Contributing
We welcome contributions! Here's how to get started:
Development Setup
# Clone and setup
# Install dependencies and build
# Run tests
# Start development servers
Contribution Guidelines
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Test your changes:
make test - Document your changes
- Submit a pull request
See CONTRIBUTING.md for detailed guidelines.
License
Licensed under:
- MIT License (LICENSE or http://opensource.org/licenses/MIT)
at your option.
Acknowledgments
- MCP Protocol - Built on the official Rust MCP SDK
- Code Analysis - Powered by Tree-sitter for accurate parsing
- Git Operations - Uses git2 for robust Git integration
- Rust Community - Built with love by the Rust community
- CoderLib - Enhanced by CoderLib integration
Support & Community
- Documentation: docs.rs/mcp-tools
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Crate: crates.io/crates/mcp-tools
- Docker: ghcr.io/mexyusef/mcp-tools
MCP Tools - Production-ready Model Context Protocol servers and clients for seamless AI integration.