# MCP Proto Server (Go Implementation)
High-performance Protocol Buffer indexing and search server implementing the Model Context Protocol (MCP).
## π Quick Start
```bash
# Build
make build
# Run with current directory
./mcp-proto-server
# Run with specific proto root
./mcp-proto-server -root /path/to/protos
# Run with verbose logging
./mcp-proto-server -verbose
```
## π Performance
- **Startup**: < 100ms
- **Indexing**: ~250 Β΅s per file
- **Search**: ~30 Β΅s per query
- **Type Resolution**: ~0.6-5 Β΅s
- **Binary Size**: 3.7 MB (static)
## π§ Features
### Three MCP Tools
1. **search_proto** - Fuzzy search across all proto definitions
- Searches: names, fields, RPCs, comments
- Returns: ranked results with scores
- Performance: ~30 Β΅s per query
2. **get_service_definition** - Complete service with resolved types
- Returns: all RPCs with request/response types
- Auto-resolves: nested message and enum types
- Performance: ~2-5 Β΅s with resolution
3. **get_message_definition** - Complete message with resolved types
- Returns: all fields with type information
- Auto-resolves: nested message and enum types
- Performance: ~1-2 Β΅s with resolution
## ποΈ Architecture
```
mcp-proto-server/
βββ cmd/mcp-proto-server/ # Main entry point
β βββ main.go # CLI + server initialization
βββ internal/proto/ # Core proto engine
β βββ parser.go # Proto file parsing
β βββ indexer.go # Indexing & search
β βββ resolver.go # Type resolution
β βββ types.go # Data structures
βββ pkg/server/ # MCP server
βββ server.go # JSON-RPC over stdio
βββ handlers.go # Tool implementations
```
## π Development
```bash
# Run tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Build
go build -o mcp-proto-server ./cmd/mcp-proto-server
# Cross-compile
make build-all
```
## π Test Coverage
- **Total Tests**: 28
- **Total Benchmarks**: 21
- **Coverage**: 93%
- **All tests passing**: β
## π― Phases Completed
- β
**Phase 1**: Parser & Indexer
- β
**Phase 2**: Fuzzy Search (3,300x faster than Python)
- β
**Phase 3**: Type Resolution (circular refs, package context)
- β
**Phase 4**: MCP Server Integration
## π Integration
### Cursor Configuration
Add to your Cursor MCP config:
```json
{
"mcpServers": {
"proto-server": {
"command": "/path/to/mcp-proto-server",
"args": ["-root", "/path/to/your/protos"],
"env": {}
}
}
}
```
### Claude Desktop Configuration
Add to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"proto-server": {
"command": "/path/to/mcp-proto-server",
"args": ["-root", "/path/to/your/protos"]
}
}
}
```
## π Documentation
- [Phase 2 Complete](../PHASE2_COMPLETE.md) - Fuzzy search implementation
- [Phase 3 Complete](../PHASE3_COMPLETE.md) - Type resolution system
- [Phase 4 Complete](../PHASE4_COMPLETE.md) - MCP server integration
- [Implementation Plan](../GO_IMPLEMENTATION_PLAN.md) - Original design
## π Production Ready
- β
Zero dependencies (except fuzzy library)
- β
Single static binary
- β
Graceful shutdown
- β
Structured logging
- β
Error handling
- β
Thread-safe
- β
Cross-platform
## π Comparison with Python Version
| Metric | Python | Go | Improvement |
|--------|--------|----|----|
| Startup | ~1-2s | ~100ms | **10-20x** |
| Search | ~100ms | ~30Β΅s | **3,300x** |
| Type Resolution | ~5-10ms | ~0.6-5Β΅s | **1,500x** |
| Memory (1000 files) | ~100-200MB | ~50MB | **2-4x** |
| Binary Size | ~30MB | 3.7MB | **8x smaller** |
## π License
Same as parent project
---
**Version**: 2.0.0-dev
**Go Version**: 1.21+
**Platform**: Linux, macOS, Windows