GitHub代理聊天MCP服务器
这是一个使用Go进行GitHub代理聊天的MCP(模型上下文协议)服务器实现。它提供了通过自然语言与GitHub交互的工具,并包括矢量搜索功能。
特性
- 搜索GitHub存储库
- 创建问题
- 矢量搜索功能
- 将文档添加到矢量存储 - 跨存储文档的语义搜索
- 可扩展的结构,用于添加更多功能
先决条件
- 转到1.21或更高版本
- 带pgvector扩展的PostgreSQL
- GitHub个人访问令牌
- OpenAI API密钥
- Claude Desktop或其他MCP兼容客户端
设置
- 克隆存储库:
git clone https://github.com/akhidasTech/github-agentic-chat-mcp.git
cd github-agentic-chat-mcp- 设置环境变量:
export GITHUB_TOKEN=your_github_token_here
export DATABASE_URL=postgres://user:password@localhost:5432/dbname
export OPENAI_API_KEY=your_openai_api_key_here- 使用pgvector设置PostgreSQL:
CREATE EXTENSION vector;- 构建服务器:
go build -o bin/github-agentic-chat-mcp- 配置Claude桌面:
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"github-chat": {
"command": "/absolute/path/to/bin/github-agentic-chat-mcp"
}
}
}- 重新启动克劳德桌面
可用工具
GitHub工具
search_repositories
使用查询字符串搜索GitHub存储库。
创建_发行
在GitHub存储库中创建新问题。
矢量搜索工具
add_to_vector_store
将文档添加到向量存储中以进行语义搜索。
参数:
- content:要存储的文本内容
- 元数据:包含内容元数据的JSON字符串
例子:
{
"content": "This is a document about GitHub Actions",
"metadata": "{\"type\": \"documentation\", \"tags\": [\"github\", \"ci-cd\"]}"
}矢量搜索
在存储的文档中执行语义搜索。
参数:
- query:搜索查询文本
- limit:返回的最大结果数(默认值:5)
贡献
欢迎投稿!请随时提交拉取请求。
许可证
MIT许可证
