Skip to main content
Glama

MCP 专家服务器

模型上下文协议服务器,使用 Claude AI 提供智能查询生成和文档辅助。该服务器会分析您的 API 文档并提供两个主要工具:

  • create-query :根据自然语言请求生成查询

  • 文档:根据问题提供相关文档信息

先决条件

  • Node.js >= 18

  • Claude 的 Anthropic API 密钥

Related MCP server: MCP Outline Server

安装

  1. 克隆存储库

  2. 安装依赖项:

npm install
  1. 使用您的 Anthropic API 密钥创建一个.env文件:

ANTHROPIC_API_KEY=your_api_key_here

设置

在运行服务器之前,您需要:

  1. 构建项目并运行安装脚本:

npm run build npm run setup

这将:

  • 创建所需的目录( docs/prompts/

  • 创建默认提示文件

  • 生成初始服务描述

  1. 将您的 API 文档文件添加到docs/目录(支持.txt.md.json文件)

  2. 可选择在prompts/目录中自定义提示:

    • system-prompt.txt :Claude 的主系统提示

    • tool-metadata.txt :工具描述的附加上下文

    • query-metadata.txt :查询生成的附加上下文

    • service-description.txt :自动生成的服务描述

用法

独立服务器

启动服务器:

npm start

服务器通过模型上下文协议公开两个工具:

  • create-query :根据自然语言请求生成查询

    { "name": "create-query", "arguments": { "request": "Find all users who signed up in the last week" } }
  • 文档:从文档中获取信息

    { "name": "documentation", "arguments": { "request": "How do I authenticate API requests?" } }

Claude 桌面集成

  1. 将此配置添加到您的 Claude Desktop 配置文件:

{ "mcpServers": { "expert": { "command": "node", "args": ["/ABSOLUTE/PATH/TO/expert-server/build/index.js"], "env": { "ANTHROPIC_API_KEY": "your_api_key_here" } } } }
  1. /ABSOLUTE/PATH/TO/expert-server替换为服务器安装的实际绝对路径。

  2. 重新启动 Claude Desktop。

目录结构

. ├── docs/ # Your API documentation files ├── prompts/ # System prompts and metadata │ ├── system-prompt.txt # Main system prompt │ ├── tool-metadata.txt # Tool description context │ ├── query-metadata.txt # Query generation context │ └── service-description.txt # Generated service description ├── src/ # Source code │ ├── index.ts # Entry point │ ├── server.ts # MCP server implementation │ └── services/ # Core services │ └── expertService.ts # Claude integration └── package.json

发展

  • 构建项目:

npm run build
  • 服务器使用 TypeScript 并遵循模块化架构

  • 所有 Claude 交互均由 ExpertService 类处理

  • 调试日志以 [DEBUG] 前缀写入 stderr

故障排除

如果遇到连接问题:

  1. 确保您已运行安装脚本:

npm run setup
  1. 检查prompts/目录中是否存在所有必需的文件

  2. 验证您的ANTHROPIC_API_KEY是否设置正确

  3. 在 Claude Desktop 配置中使用绝对路径

  4. 检查调试日志(写入 stderr)

环境变量

  • ANTHROPIC_API_KEY :您的 Anthropic API 密钥(必需)

执照

麻省理工学院

-
security - not tested
F
license - not found
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/crazyrabbitLTC/mcp-expert-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server