| Crates.io | mcp-tools |
| lib.rs | mcp-tools |
| version | 0.1.0 |
| created_at | 2025-06-25 21:37:05.768049+00 |
| updated_at | 2025-06-25 21:37:05.768049+00 |
| description | Rust MCP tools library |
| homepage | https://github.com/mexyusef/mcp-tools |
| repository | https://github.com/mexyusef/mcp-tools |
| max_upload_size | |
| id | 1726473 |
| size | 368,699 |
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.
git-server)Provides Git repository operations via MCP protocol:
Built with git2 library for robust Git operations.
code-analysis-server)Provides basic code analysis capabilities:
Currently supports: Rust, Python, JavaScript, TypeScript, Go, Java, C, C++ Uses tree-sitter for syntax parsing where available.
web-server)Provides web operations via HTTP client:
Built with reqwest for HTTP operations.
system-server)Provides system operations with safety controls:
Includes basic security filtering for command execution.
file-operations-server)Provides file system operations:
mcp-server)Combines all servers into a single process:
--tools flagmcp-cli)Basic command-line client for testing and interaction:
# Install all MCP Tools binaries
cargo install mcp-tools
# Verify installation
mcp-server --help
mcp-cli --help
Add to your Cargo.toml:
[dependencies]
mcp-tools = "0.1.0"
coderlib = "0.1.0" # Required dependency
tokio = { version = "1.0", features = ["full"] }
use mcp_tools::{
servers::GitToolsServer,
common::{ServerConfig, McpServerBase},
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = ServerConfig {
name: "my-git-server".to_string(),
description: "Git operations server".to_string(),
version: "1.0.0".to_string(),
host: "127.0.0.1".to_string(),
port: 8080,
max_connections: 100,
request_timeout_secs: 300,
log_requests: true,
server_config: std::collections::HashMap::new(),
};
let mut server = GitToolsServer::new(config).await?;
server.initialize().await?;
println!("Git Tools MCP Server running on port 8080");
// Server is ready to handle MCP requests
Ok(())
}
# Unified server (recommended for most use cases)
mcp-server --host 0.0.0.0 --port 8080 --tools git,code,web,system
# Individual specialized servers
git-server --port 8081 # Git operations only
code-analysis-server --port 8082 # Code analysis only
web-server --port 8083 # Web tools only
system-server --port 8084 # System operations only
# CLI client usage
mcp-cli --server http://localhost:8080 list-tools
mcp-cli --server http://localhost:8080 execute git_status repo_path=/path/to/repo
mcp-cli --server http://localhost:8080 interactive
# Quick start - unified server
docker run -p 8080:8080 ghcr.io/mexyusef/mcp-tools:latest
# Individual servers
docker run -p 8081:8080 ghcr.io/mexyusef/mcp-tools-git:latest
docker run -p 8082:8081 ghcr.io/mexyusef/mcp-tools-code:latest
docker run -p 8083:8082 ghcr.io/mexyusef/mcp-tools-web:latest
docker run -p 8084:8083 ghcr.io/mexyusef/mcp-tools-system:latest
# Production deployment with docker-compose
curl -O https://raw.githubusercontent.com/mexyusef/mcp-tools/main/docker-compose.yml
docker-compose up -d
# With nginx proxy and SSL
docker-compose --profile with-proxy up -d
# Download and run setup script
curl -sSL https://raw.githubusercontent.com/mexyusef/mcp-tools/main/install.sh | bash
# Or using our Makefile
git clone https://github.com/mexyusef/mcp-tools.git
cd mcp-tools
make deploy
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
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
// Example: Basic file operations with validation
use mcp_tools::servers::FileOperationsServer;
async fn safe_file_read(path: &str) -> Result<String> {
// Basic path validation
let path_buf = std::path::PathBuf::from(path);
// Read file with standard validation
tokio::fs::read_to_string(path_buf).await
}
cargo installWe welcome contributions! Here's how to get started:
# Clone and setup
git clone https://github.com/mexyusef/mcp-tools.git
cd mcp-tools
# Install dependencies and build
make setup
make build
# Run tests
make test
# Start development servers
make dev-run
git checkout -b feature/amazing-featuremake testSee CONTRIBUTING.md for detailed guidelines.
Licensed under:
at your option.
MCP Tools - Production-ready Model Context Protocol servers and clients for seamless AI integration.