GitLab文档MCP服务器
](https://www.npmjs.com/package/gitlab-docs-mcp) 
A. 模型上下文协议 服务器,为AI助手提供即时访问GitLab官方文档的权限。
特性
- 智能搜索 -在所有文档中进行快速、相关性排名搜索
- 区段筛选 -目标特定领域(CI/CD、API、管理员等)
- 完整内容访问 -检索完整的文档页面
- 始终保持最新 -自动与最新的GitLab文档同步
- 通用兼容性 -可与任何兼容MCP的AI助手配合使用
安装
此服务器可与任何兼容MCP的AI助手配合使用。这 模型上下文协议 允许AI助手通过标准化接口连接到外部工具和数据源。
GitHub副本(VS代码)
1.打开MCP配置
按 ⌘+移动+P (或 控制键+移动+P 在Windows/Linux上),键入 MCP: Open User Configuration,然后按Enter键。
2.添加到 mcp.json:
{
"servers": {
"gitlab-docs": {
"command": "npx",
"args": ["-y", "gitlab-docs-mcp"]
}
}
}3.重新加载VS代码
按 ⌘+移动+P (或 控制键+移动+P),类型 Developer: Reload Window,然后按Enter键。
备选方案: 您还可以在以下位置手动创建/编辑文件:
- macOS:
~/Library/Application Support/Code/User/mcp.json - 窗户:
%APPDATA%\Code\User\mcp.json - Linux:
~/.config/Code/User/mcp.json
克劳德桌面版
Claude Desktop是Anthropic的一款独立桌面应用程序,支持MCP服务器。
添加到您的Claude Desktop配置文件中:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 窗户: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"gitlab-docs": {
"command": "npx",
"args": ["-y", "gitlab-docs-mcp"]
}
}
}重新启动克劳德桌面。
光标IDE
Cursor具有内置的MCP支持。创建或编辑MCP配置文件:
1.创建/编辑配置文件
- 项目具体:
.cursor/mcp.json在项目根目录中 - 全球的:
~/.cursor/mcp.json在您的主目录中
2.添加服务器配置:
{
"servers": {
"gitlab-docs": {
"command": "npx",
"args": ["-y", "gitlab-docs-mcp"]
}
}
}3.重新启动游标
其他MCP客户端
对于其他兼容MCP的客户端(Zed、Windsurf等),将其配置为运行:
npx -y gitlab-docs-mcp有关所需的具体格式,请参阅客户的MCP配置文档。
用法
配置后,只需向您的AI助手询问GitLab:
对话示例:
You: "How do I set up a CI/CD pipeline in GitLab?"
Assistant: [Searches GitLab docs and provides detailed pipeline configuration guide]
You: "Show me how to configure GitLab Runner on Ubuntu"
Assistant: [Retrieves GitLab Runner installation documentation]
You: "What are the GraphQL mutations for updating issues?"
Assistant: [Searches API docs and shows GraphQL mutation examples]
You: "Explain GitLab's authentication options"
Assistant: [Provides overview from authentication documentation]AI助手将自动使用GitLab Docs MCP服务器搜索文档并提供准确、最新的答案。
可用工具
searchGitLabDocs
通过智能排名在2494个GitLab文档页面中搜索。
参数:
query-搜索词maxResults-最大结果(默认值:10,最大值:50)section-按部分筛选:ci、api、用户、管理员、开发
getDocPage
检索特定文档页面的完整内容。
参数:
path-文档路径(例如,“ci/yaml/README.md”)
listDocSections
浏览可用的文档部分及其结构。
故障排除
服务器没有响应?
- 确保已安装Node.js 22+:
node --version - 完全重新启动您的AI助手/客户端
- 检查应用程序日志中的MCP连接错误
文件是否过期? 服务器会自动使用npm发布的最新版本。只需重新启动MCP客户端即可获取更新。
贡献
发现错误或有功能请求?请访问 .
许可证
麻省理工学院-见 许可证 文件以获取详细信息。
