项目简介
MCP Proto服务器是一个专门为AI编程助手(如Claude和Cursor)设计的后端服务。它能够快速索引您的Protocol Buffer ('.proto') 文件,并允许AI助手以智能化的方式搜索、查询和理解您的gRPC服务、消息和枚举定义,极大地简化了AI在处理复杂代码库时的上下文获取。
主要功能点
- 即时搜索: 在所有'.proto'文件中快速查找服务、消息、字段、枚举及其值。
- 智能类型解析: 自动解析嵌套类型和依赖关系,提供完整的结构定义。
- AI集成: 与主流AI助手(如Claude Desktop, Cursor)无缝工作,提供强大的上下文理解能力。
- 高性能: 提供毫秒级搜索性能,确保AI助手响应迅速。
- 零依赖: 打包为单个可执行文件,无需额外运行时环境。
安装步骤
- 下载最新发布版本: 访问项目的Releases页面。
- 根据您的操作系统(Linux, macOS Intel, macOS Apple Silicon, Windows)下载相应的压缩包,例如 'mcp-proto-server-linux-amd64.tar.gz'。
- 安装:
- Linux/macOS: 解压下载的'.tar.gz'文件,然后运行其中的'install.sh'脚本。
- Windows: 解压下载的'.zip'文件,然后运行'install-windows.bat'脚本。
- 验证安装: 在命令行运行 'mcp-proto-server --help' 检查是否安装成功。
服务器配置
MCP Proto服务器需要与您的AI助手进行配置才能使用。以下是为Cursor和Claude Desktop配置MCP服务器的示例(请根据您的实际文件路径替换 '/path/to/your/proto/files'):
-
Cursor配置示例 ('~/.cursor/mcp.json'):
{ "mcpServers": { "proto-server": { "command": "mcp-proto-server", "args": ["-root", "/path/to/your/proto/files"], "capabilities": [ "search_proto: Fuzzy search across all proto definitions", "get_service_definition: Get service with ALL nested types in one call", "get_message_definition: Get message with ALL nested types in one call" ] } } }在上述配置中:
- 'proto-server' 是MCP服务器的唯一标识名称。
- 'command' 指定了启动MCP服务器的可执行文件。
- 'args' 提供了启动服务器所需的参数,'-root' 指定了您的'.proto'文件所在的根目录。
- 'capabilities' 描述了该MCP服务器向AI助手提供的功能,AI助手会根据这些描述来决定何时以及如何调用这些功能。
-
Claude Desktop配置示例 ('claude_desktop_config.json'):
{ "mcpServers": { "proto-server": { "command": "mcp-proto-server", "args": ["-root", "/path/to/your/proto/files"] } } }此配置与Cursor类似,'-root' 参数指示服务器查找'.proto'文件的位置。
基本使用方法
配置完成后,您可以直接向您的AI助手提问,例如:
- "Show me all authentication-related services" (显示所有与认证相关的服务)
- "What fields does the User message have?" (User消息有哪些字段?)
- "Find RPCs that handle payment processing" (查找处理支付的RPC方法)
服务器将自动索引您的'.proto'文件,并提供即时、智能的搜索结果和定义。
信息
分类
开发者工具