GitHubスター
0
ユーザー評価
未評価
お気に入り
0
閲覧数
3
フォーク
0
イシュー
0
README
mcp-proto-generator
Generate MCP (Model Context Protocol) servers from gRPC proto files with zero manual code.
Quick Start
# Install
go install github.com/lucasnoah/mcp-proto-generator/cmd/mcp-proto-gen@latest
# Generate MCP server from your protos
mcp-proto-gen generate --proto-dir ./proto
# Run the generated server
cd mcp-server && go run .
Features
- 🚀 Zero Manual Code - 100% generated from proto definitions
- 🔑 API Key Auth - Built-in authentication with environment config
- 🛠️ Smart Conventions - Automatic service discovery and naming
- 📝 Type Safe - Full proto type mapping to JSON Schema
- 🐳 Docker Ready - Generated Dockerfile and deployment configs
- ⚡ Fast Generation - Handles large proto projects in seconds
How It Works
- Parse - Reads all your .proto files and imports
- Extract - Finds services, methods, and message types
- Generate - Creates MCP server with tools for each RPC method
- Deploy - Single binary with zero dependencies
Configuration
Create mcp-gen.yaml
in your project:
proto:
dirs: ["./proto"]
generate:
output_dir: "./mcp-server"
module: "github.com/yourorg/mcp-server"
auth:
enabled: true
env_var: "MCP_API_KEYS"
server:
port: 3333
Examples
Basic Usage
# Generate from current directory
mcp-proto-gen generate
# Specify proto directory
mcp-proto-gen generate --proto-dir ./api/proto
# Custom config
mcp-proto-gen generate --config mcp-gen.yaml
Integration Example
# .github/workflows/mcp.yml
- name: Generate MCP Server
run: |
mcp-proto-gen generate
cd mcp-server && go test ./...
Proto to MCP Mapping
Your proto services become MCP tools:
service UserService {
rpc GetUser(GetUserRequest) returns (User);
rpc DeleteUser(DeleteUserRequest) returns (Empty);
}
Generates MCP tools:
user_service_get_user
- Get user informationuser_service_delete_user
- Delete user (DANGEROUS)
Requirements
- Go 1.21+
- protoc compiler
- Your project's proto files
Contributing
- Fork the repository
- Create feature branch
- Add tests
- Submit pull request
License
MIT License - see LICENSE
作者情報
11
フォロワー
31
リポジトリ
2
Gist
0
貢献数