{"id":31618091,"url":"https://github.com/kensave/roberto-mcp","last_synced_at":"2026-05-06T06:32:15.340Z","repository":{"id":317934047,"uuid":"1065683726","full_name":"kensave/roberto-mcp","owner":"kensave","description":"Simple Code Analysis MCP server, language agnostic with code indexing and search capabilities.","archived":false,"fork":false,"pushed_at":"2025-10-05T04:55:30.000Z","size":217,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-05T05:25:04.714Z","etag":null,"topics":["agentic-ai","code-analysis","llm-tools","mcp","mcp-server","model-context-protocol","model-context-protocol-servers","rag","tree-sitter"],"latest_commit_sha":null,"homepage":"https://kensave.github.io/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kensave.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-28T08:07:45.000Z","updated_at":"2025-10-05T04:55:34.000Z","dependencies_parsed_at":"2025-10-05T05:25:09.470Z","dependency_job_id":null,"html_url":"https://github.com/kensave/roberto-mcp","commit_stats":null,"previous_names":["kensave/codecortx-mcp","kensave/roberto-mcp"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/kensave/roberto-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kensave%2Froberto-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kensave%2Froberto-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kensave%2Froberto-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kensave%2Froberto-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kensave","download_url":"https://codeload.github.com/kensave/roberto-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kensave%2Froberto-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278621843,"owners_count":26017253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-ai","code-analysis","llm-tools","mcp","mcp-server","model-context-protocol","model-context-protocol-servers","rag","tree-sitter"],"created_at":"2025-10-06T13:45:33.194Z","updated_at":"2025-10-06T13:45:38.739Z","avatar_url":"https://github.com/kensave.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Roberto MCP\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"RobertoMCP.png\" alt=\"Roberto MCP Logo\" width=\"200\"/\u003e\n\u003c/div\u003e\n\nA lightning-fast, language-agnostic code analysis MCP (Model Context Protocol) server built in Rust. Provides instant symbol lookups, reference tracking, and semantic code search for large codebases with performance as a first-class citizen.\n\n[![Rust](https://img.shields.io/badge/rust-1.70+-orange.svg)](https://www.rust-lang.org)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)\n[![Tests](https://img.shields.io/badge/tests-83%20passing-green.svg)](#testing)\n\n## 🚀 Features\n\n- **⚡ High Performance**: \u003c1ms symbol lookups, \u003e100 files/sec indexing\n- **🔒 Lock-free Concurrency**: No blocking operations, handles concurrent requests efficiently  \n- **🧠 Smart Caching**: Binary persistence with \u003c1s startup for previously indexed repositories\n- **📊 Memory Management**: Automatic LRU eviction with configurable memory limits\n- **🔄 Incremental Updates**: File watching with SHA-256 change detection\n- **🌍 Multi-language**: 15+ languages supported with extensible architecture\n- **🛡️ Error Resilient**: Graceful handling of malformed code and I/O errors\n- **🔍 Full-text Search**: BM25 statistical search through all code content\n\n## 🏗️ Architecture\n\n- **Language**: Rust (performance + safety)\n- **Parser**: Tree-sitter (consistent, incremental parsing)\n- **Storage**: In-memory DashMap + binary persistence\n- **Concurrency**: Lock-free data structures\n- **Protocol**: MCP over JSON-RPC stdio\n\n## 📋 MCP Tools\n\nThe server provides 7 MCP tools for comprehensive code analysis:\n\n### 1. `index_code`\nIndex source code files to build symbol table for fast lookups.\n```json\n{\n  \"path\": \"/path/to/project\"\n}\n```\n\n### 2. `get_symbol`\nRetrieve symbol information by name with optional source code inclusion.\n```json\n{\n  \"name\": \"function_name\",\n  \"include_source\": true\n}\n```\n\n### 3. `get_symbol_references`\nFind all references to a symbol across the codebase.\n```json\n{\n  \"name\": \"symbol_name\"\n}\n```\n\n### 4. `find_symbols`\nSearch symbols by query using exact match or fuzzy search with optional type filtering.\n```json\n{\n  \"query\": \"test_\",\n  \"symbol_type\": \"function\"\n}\n```\n\n### 5. `code_search` 🎯\n**BM25 statistical search through all indexed code content.**\n```json\n{\n  \"query\": \"fibonacci algorithm\",\n  \"max_results\": 10\n}\n```\n\n**Perfect for finding:**\n- Algorithm implementations: `\"binary search algorithm\"`\n- Error handling patterns: `\"error handling try catch\"`\n- Database code: `\"database connection pool\"`\n- Specific functionality: `\"file upload validation\"`\n\n### 6. `get_file_outline` 📄\n**Get structured outline of symbols in a specific file.**\n```json\n{\n  \"file_path\": \"/path/to/file.rs\"\n}\n```\n\n**Returns organized view of:**\n- Classes/Structs with signatures\n- Functions/Methods with full signatures and parameters\n- Constants, Enums, Interfaces, Modules, Imports, Variables\n- Line numbers and visibility (pub/priv)\n\n### 7. `get_directory_outline` 📁\n**Get high-level overview of symbols across a directory.**\n```json\n{\n  \"directory_path\": \"/path/to/project\",\n  \"includes\": [\"functions\", \"methods\", \"constants\"]\n}\n```\n\n**Perfect for:**\n- Project structure understanding\n- API surface discovery\n- Architecture overview\n- Code navigation\n\n## 🛠️ Installation \u0026 Setup\n\n### Prerequisites\n- Rust 1.70+ with Cargo\n- Git\n\n### Building from Source\n```bash\ngit clone https://github.com/kensave/roberto-mcp.git\ncd roberto-mcp\ncargo build --release\n```\n\nThe binary will be available at `target/release/roberto-mcp`.\n\n## 🔧 Usage\n\n### With Amazon Q CLI\n\n1. **Add to Amazon Q CLI Configuration**\n\n   Add the following to your Amazon Q CLI MCP configuration:\n\n   ```json\n   {\n     \"mcpServers\": {\n       \"roberto\": {\n         \"command\": \"/path/to/roberto-mcp/target/release/roberto-mcp\",\n         \"args\": []\n       }\n     }\n   }\n   ```\n\n2. **Restart Amazon Q CLI**\n\n3. **Start Using**\n\n   In Amazon Q CLI, you can now ask questions like:\n   - \"Index the code in my project directory\"\n   - \"Find all functions that contain 'parse' in their name\"\n   - \"Show me all references to the `SymbolStore` struct\"\n   - \"Get the implementation of the `extract_symbols` function\"\n   - \"Search for fibonacci algorithm implementations\"\n   - \"Find error handling patterns in the codebase\"\n   - \"Show me the outline of this file with all functions and their signatures\"\n   - \"Get an overview of all classes and methods in this directory\"\n\n### Testing with MCP Inspector\n\nMCP Inspector is a great tool for testing and debugging MCP servers.\n\n1. **Install MCP Inspector**\n   ```bash\n   npx @modelcontextprotocol/inspector\n   ```\n\n2. **Test the Server**\n   ```bash\n   # Run the server\n   ./target/release/roberto-mcp\n\n   # In another terminal, run MCP Inspector\n   npx @modelcontextprotocol/inspector ./target/release/roberto-mcp\n   ```\n\n3. **Explore the Tools**\n   - View available tools and their schemas\n   - Test tool calls with sample data\n   - Inspect request/response cycles\n   - Debug any integration issues\n\n### Manual Testing via Command Line\n\nYou can also test the server manually using stdio:\n\n```bash\n# Start the server\n./target/release/roberto-mcp\n\n# Send MCP initialization (paste this JSON)\n{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"initialize\", \"params\": {\"protocolVersion\": \"2024-11-05\", \"capabilities\": {}, \"clientInfo\": {\"name\": \"test-client\", \"version\": \"1.0.0\"}}}\n\n# Send initialized notification\n{\"jsonrpc\": \"2.0\", \"method\": \"notifications/initialized\"}\n\n# List available tools\n{\"jsonrpc\": \"2.0\", \"id\": 2, \"method\": \"tools/list\", \"params\": {}}\n\n# Index a directory\n{\"jsonrpc\": \"2.0\", \"id\": 3, \"method\": \"tools/call\", \"params\": {\"name\": \"index_code\", \"arguments\": {\"path\": \"/path/to/your/project\"}}}\n\n# Search for symbols\n{\"jsonrpc\": \"2.0\", \"id\": 4, \"method\": \"tools/call\", \"params\": {\"name\": \"find_symbols\", \"arguments\": {\"query\": \"main\", \"symbol_type\": \"function\"}}}\n\n# Search code content with BM25\n{\"jsonrpc\": \"2.0\", \"id\": 5, \"method\": \"tools/call\", \"params\": {\"name\": \"code_search\", \"arguments\": {\"query\": \"error handling\", \"max_results\": 5}}}\n\n# Get file outline with signatures\n{\"jsonrpc\": \"2.0\", \"id\": 6, \"method\": \"tools/call\", \"params\": {\"name\": \"get_file_outline\", \"arguments\": {\"file_path\": \"/path/to/file.rs\"}}}\n\n# Get directory overview\n{\"jsonrpc\": \"2.0\", \"id\": 7, \"method\": \"tools/call\", \"params\": {\"name\": \"get_directory_outline\", \"arguments\": {\"directory_path\": \"/path/to/project\", \"includes\": [\"functions\", \"classes\"]}}}\n```\n\n## ⚡ Performance Benchmarks\n\nRun the included benchmarks to validate performance on your system:\n\n```bash\n# Run all benchmarks\ncargo bench\n\n# Run specific benchmark\ncargo bench -- symbol_lookup\n\n# Run performance validation tests\ncargo test --test performance_validation -- --nocapture\n```\n\n**Expected Performance Targets:**\n- Symbol lookups: \u003c1ms average\n- Indexing speed: \u003e100 files/second\n- Concurrent access: \u003e50k lookups/second\n- Memory usage: \u003c1GB for large repositories\n\n## 🧪 Testing\n\nThe project includes comprehensive test coverage:\n\n```bash\n# Run all tests\ncargo test\n\n# Run unit tests only\ncargo test --lib\n\n# Run integration tests\ncargo test --test integration_test\n\n# Run performance validation\ncargo test --test performance_validation\n\n# Run with output for debugging\ncargo test -- --nocapture\n```\n\n**Test Coverage:**\n- 54 unit tests covering all core modules\n- 5 integration tests for end-to-end workflows\n- 5 performance tests validating requirements\n- 15 language-specific tests\n- 4 outline tool tests\n\n**Total: 83 tests passing**\n\n## 🔍 Supported Languages\n\nCurrently supports 15+ languages:\n- **Rust** (.rs): Functions, structs, enums, traits, implementations, constants, modules\n- **Python** (.py): Functions, classes, methods, variables, imports\n- **JavaScript** (.js): Functions, classes, methods, constants, variables\n- **TypeScript** (.ts): Functions, classes, interfaces, types, enums\n- **Java** (.java): Classes, methods, interfaces, enums, constants\n- **Go** (.go): Functions, structs, interfaces, constants, variables\n- **C** (.c): Functions, structs, enums, typedefs, variables\n- **C++** (.cpp, .hpp): Classes, functions, namespaces, templates\n- **Ruby** (.rb): Classes, modules, methods, constants\n- **PHP** (.php): Classes, functions, methods, constants\n- **C#** (.cs): Classes, methods, interfaces, enums, properties\n- **Kotlin** (.kt): Classes, functions, interfaces, objects\n- **Scala** (.scala): Classes, objects, traits, functions\n- **Swift** (.swift): Classes, structs, protocols, functions\n- **Objective-C** (.m, .h): Classes, methods, protocols, categories\n\n**Adding New Languages:**\nThe architecture is designed for easy extension. To add a new language:\n1. Add Tree-sitter grammar dependency\n2. Create query files in `queries/` directory\n3. Update `Language` enum and language detection\n4. Add to supported extensions\n\n## 💾 Caching \u0026 Persistence\n\n- **Cache Location**: Uses system cache directory (`~/.cache/roberto-mcp/` on Unix)\n- **Cache Format**: Custom binary format with bincode serialization\n- **Cache Key**: Based on repository path and last modification times\n- **Cache Validation**: Automatic validation on startup with incremental updates\n- **Memory Management**: LRU eviction when memory pressure detected (configurable)\n\n## 🛡️ Error Handling\n\nThe server is designed for robustness:\n- **Parse Errors**: Continues indexing other files, logs issues\n- **File System Errors**: Graceful degradation with partial results\n- **Memory Pressure**: Automatic cleanup and eviction\n- **Malformed Requests**: Proper MCP error responses\n- **Concurrent Access**: Lock-free structures prevent deadlocks\n\n## 📊 Monitoring \u0026 Logging\n\nThe server uses structured logging with different levels:\n\n```bash\n# Enable debug logging\nRUST_LOG=debug ./target/release/roberto-mcp\n\n# Enable trace logging for specific modules\nRUST_LOG=roberto_mcp::indexer=trace ./target/release/roberto-mcp\n```\n\n## ⚙️ Configuration\n\n### Environment Variables\n```bash\n# Memory management\nexport ROBERTO_MAX_MEMORY_MB=1024\nexport ROBERTO_EVICTION_THRESHOLD=0.8\n\n# Cache location\nexport ROBERTO_CACHE_DIR=~/.cache/roberto-mcp\n\n# Logging\nexport RUST_LOG=roberto_mcp=info\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Run the test suite (`cargo test`)\n4. Run benchmarks to ensure no performance regression (`cargo bench`)\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n## 📝 License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## 🔧 Troubleshooting\n\n### Common Issues\n\n1. **\"Symbol not found\" errors during compilation**\n   - Ensure you have the latest Rust toolchain: `rustup update`\n   - Clean and rebuild: `cargo clean \u0026\u0026 cargo build`\n\n2. **Server not responding in Amazon Q CLI**\n   - Check the config file path and syntax\n   - Verify the binary path is correct and executable\n   - Check Amazon Q CLI logs for error messages\n\n3. **High memory usage**\n   - Configure memory limits via environment variables\n   - The server will automatically evict least-recently-used files\n   - Consider indexing smaller subdirectories for very large repositories\n\n4. **Slow indexing performance**\n   - Check disk I/O performance\n   - Ensure no antivirus is scanning files during indexing\n   - Use SSD storage for better performance\n\n### Debug Commands\n\n```bash\n# Check server version and capabilities\n./target/release/roberto-mcp --version\n\n# Test basic functionality\ncargo test --test integration_test -- test_end_to_end_rust_indexing\n\n# Benchmark performance\ncargo test --test performance_validation -- --nocapture\n```\n\n## 📚 Documentation\n\n- [Architecture Guide](ARCHITECTURE.md) - Detailed system architecture\n- [Development Guide](DEVELOPMENT.md) - Setup and development workflow\n- [API Reference](docs/api.md) - Complete MCP tool documentation\n\n---\n\n**Built with ❤️ in Rust for lightning-fast code analysis**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkensave%2Froberto-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkensave%2Froberto-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkensave%2Froberto-mcp/lists"}