kode-ai.rs
Kode AI MCP服务器
这是一个MCP(模型上下文提供者)服务器,与GitHub存储库连接,扫描文档文件并将其提供给LLM进行上下文化。
它旨在用作后端服务,可以查询与特定主题或问题相关的文档。对于使用内部工具的开发人员特别有用。
特性
- 扫描GitHub存储库中的文档文件(md、mdx等)
- 以适合LLM上下文的格式存储文档
- 提供工具以获取所有文档或根据查询查找相关文档
需求
- 2024年或之后生锈
- 私有存储库的GitHub个人访问令牌(PAT)
用法
运行服务器
要运行服务器,您需要使用您的代理(如Github Copilot)进行设置:
1.建设项目
cargo build --release2.在副驾驶室内运行服务器
{
"servers": {
"kode-ai": {
"type": "stdio",
"command": "/path/to/kode-ai-rs/target/release/kode-ai-rs",
"args": []
}
}
}3.配置服务器
您可以向服务器提供参数来配置它。服务器将从CLI参数中读取配置。
配置示例
{
"servers": {
"kode-ai": {
"type": "stdio",
"command": "/path/to/kode-ai-rs/target/release/kode-ai-rs",
"args": [
"--github-repo", "my-private-repo",
"--github-token", "your_github_personal_access_token",
"--github-owner", "your_github_username",
"--github-subfolder", "./docs"
]
}
}
}MCP工具
服务器提供三个工具:
1.get_all_docs
从存储库获取所有文档。
输入:
{
"limit": 10
}注: limit 字段是可选的,限制了返回的文档数量。
输出:
{
"documents": [
{
"path": "docs/README.md",
"title": "Documentation",
"summary": "This is the main documentation file.",
"content": "# Documentation\n\nThis is the main documentation file."
}
]
}注意:输出将包括多个文档(如果可用)。
2.获取文档
按路径获取特定文档。 输入:
{
"path": "docs/installation.md"
}输出:
{
"document": {
"path": "docs/installation.md",
"title": "Installation Guide",
"summary": "This guide explains how to install the software.",
"content": "# Installation Guide\n\nThis guide explains how to install the software."
}
}3.查找相关文档
查找与查询相关的文档。
输入:
{
"query": "How to install",
"limit": 5
}注: limit 字段是可选的,限制了返回的文档数量。
输出:
{
"total": 1,
"returned": 1,
"documents": [
{
"path": "docs/installation.md",
"title": "Installation Guide",
"summary": "This guide explains how to install the software.",
"content": "# Installation Guide\n\nThis guide explains how to install the software."
}
]
}注意:输出将包括多个文档(如果可用),按与查询的相关性排序。如果找不到文档,将返回一个空数组并显示一条消息。
许可证
GPL-3.0许可证
kode-ai.rs - Kode AI MCP Server
Copyright (C) 2025 Sami Taaissat
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .