模型上下文协议服务器

Grafbase MCP服务器实现了模型上下文协议,用于在Grafbase网关中配置和暴露MCP端点。

  • by grafbase
  • Rust
  • 本地部署
  • 1227 星标
  • 更新于
在 GitHub 查看 grafbase/grafbase

使用说明

Grafbase MCP服务器

此机箱包含Grafbase网关中模型上下文协议的实现。您可以在 文档页面.

入门

通过运行以下命令,可以使用Grafbase CLI启动Grafbase MCP服务器:

npx grafbase mcp <url>

哪里 <url> 是GraphQL API的URL。

MCP服务器在以下位置监听请求 http://127.0.0.1:5000/mcp 默认情况下。要将其添加到Cursor中,请在项目中创建一个.Cursor/mcp.json文件,其中包含以下内容:

{
  "mcpServers": {
    "my-graphql-api": {
      "url": "http://127.0.0.1:5000/mcp"
    }
  }
}

在Grafbase网关中设置MCP

Grafbase网关可以配置为使用以下Grafbase.toml配置公开MCP端点:

[mcp]
enabled = true # defaults to false
# Path at which to expose the MCP service
path = "/mcp"
# Whether mutations can be executed
execute_mutations = false

另请参阅 集成测试.