极客智坊 Response API 允许 OpenAI 模型通过内置 mcp 工具使用远程 MCP 服务器来执行任务。
模型上下文协议(MCP)是一个开放协议,旨在标准化应用程序向 LLMs 提供工具和上下文的方式。Responses API 中的 MCP 工具使开发者能够让模型访问托管在远程 MCP 服务器上的工具。这些 MCP 服务器由互联网上的开发者和组织维护,它们将这些工具开放给 MCP 客户端使用,例如 Responses API。
以下是调用远程 MCP 的请求示例:
curl --location --request POST 'https://geekai.co/api/v1/responses' \
--header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model": "gpt-4.1-mini",
  "tools": [
    {
      "type": "mcp",
      "server_label": "deepwiki",
      "server_url": "https://mcp.deepwiki.com/mcp",
      "require_approval": "never"
    }
  ],
  "input": "2025年3月26日版本的MCP规范支持哪些传输协议?"
}'
MCP 工具仅适用于 Responses API,并支持我们所有的支持 Response API 的模型。使用 MCP 工具时,您只需支付导入工具定义或进行工具调用所消耗的令牌费用,无需额外付费。