连接器指南阅读约 4 分钟14 个 MCP 工具7 种语言

如何通过 MCP 将 xAI Grok 连接到 Meta Muse

让你的 AI 用你自己的 xAI API 密钥向 Grok 提问:Grok 模型的回答、基于网络或 X 实时搜索并附来源的回答、在后台生成的长回答,以及直接在聊天中用 Grok Imagine 生成或编辑的图片。

HC作者:HelpCode 团队更新于 4 分钟阅读 在 GitHub 开源

无需信用卡 · 7 天试用 · 提供自托管方案

xAI Grok

xAI Grok

Let your AI ask Grok with your own xAI API key: answers from Grok models, answers grounded in live web or X search with sources, long answers in the background, and pictures generated or edited with Grok Imagine right in the chat.

个工具

14

区域

INTL

类别

公共数据

身份验证

Bearer Token

所需环境变量

XAI_API_KEY
在 Cloud 上一键安装

7 天免费试用 · 无需信用卡

  • 7 天免费试用
    无需信用卡
  • 符合 GDPR,SOC 2 就绪
    数据驻留欧盟,审计日志
  • 在 GitHub 开源
    开源 · AGPL-3.0
  • 支持 ChatGPT、Claude、Gemini
    任何兼容 MCP 的客户端

跳过安装。2 分钟内即可运行。

在 cloud.anythingmcp.com 开始免费试用,一键添加 xAI Grok,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。

开始免费试用

摘要

让你的 AI 用你自己的 xAI API 密钥向 Grok 提问:Grok 模型的回答、基于网络或 X 实时搜索并附来源的回答、在后台生成的长回答,以及直接在聊天中用 Grok Imagine 生成或编辑的图片。

试试这样问

xAI Grok 的示例提示

点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。

xAI Grok · 通过 MCP 实时
分享
Opus 4.7

Claude 是 AI,可能会出错。请核对回答。

💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → xAI Grok、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无 git clone、无本地服务器。

xAI Grok + Meta Muse

让你的 AI 用你自己的 xAI API 密钥向 Grok 提问:Grok 模型的回答、基于网络或 X 实时搜索并附来源的回答、在后台生成的长回答,以及直接在聊天中用 Grok Imagine 生成或编辑的图片。

前提条件

完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:

XAI_API_KEY

步骤 1 — 获取凭证

  1. 登录 https://console.x.ai,在 Billing 中购买预付额度。Grok API 与 X Premium 或 SuperGrok 订阅相互独立,这些订阅不包含 API 使用;额度用完后请求会被拒绝。
  2. 打开 API Keys,创建一个密钥并复制(以 xai- 开头)。
  3. 按 xAI 显示的原样将其粘贴到 XAI_API_KEY,不要加 Bearer 一词,然后安装连接器。密钥只会发送给 xAI。
  4. 先运行 xai_get_api_key_info:它不收费,并能显示密钥的名称、团队和权限。

计费使用你自己的 xAI 额度:每次调用 Grok 都会消耗你的预付额度。模型列表、密钥详情、token 计数和获取结果都是免费的。除非你要求更多,连接器默认使用低成本设置:文本用 grok-4.3(每百万输入 token 约 1.25 美元,每百万输出 token 约 2.50 美元,上下文 100 万 token),图片用 grok-imagine-image(每张约 0.02 美元)。旗舰模型是 grok-4.7(2 美元和 6 美元),grok-imagine-image-2.0 生成质量更高的图片(约 0.04 美元)。每个回答都会显示其费用。

功能:

  • xai_create_response 通过 xAI 推荐的 Responses API 向 Grok 提问,支持通过链接输入图片、指令、推理强度和 JSON 输出。只有在你要求时才会保存回答;已保存的回答可以用 xai_get_response 读取并继续。
  • 借助 xai_web_search 和 xai_x_search,Grok 会自己搜索网络或 X 上的帖子,并附上来源回答。网络搜索可以限定在某些域名,X 搜索可以限定在某些账号和日期范围。搜索在 token 之外另行计费(网络约每 1,000 次搜索 5 美元;X 约每 1,000 条帖子 5 美元、每 1,000 个用户资料 10 美元),因此 AI 只在问题需要最新信息时才使用。
  • xai_start_deferred_completion 和 xai_get_deferred_completion 在后台处理长回答。AI 每 10 到 30 秒查看一次,结果可在 24 小时内获取一次。
  • xai_generate_image 和 xai_edit_image 用 Grok Imagine 生成或修改图片,并直接显示在聊天中。编辑时,原图通过公开链接传入。
  • xai_tokenize_text 免费计算 token 数,xai_list_language_models、xai_list_image_models 和 xai_list_models 显示你的密钥可以使用的模型及价格。

先确认:每张图片都要花钱,因此 AI 在每次调用 xai_generate_image 或 xai_edit_image 之前都会先征得你的确认,并且除非你要更多,只生成一张。xai_delete_response 在安装时处于关闭状态;启用后它同样会先确认,且删除的回答无法恢复。

时间限制:通过连接器的调用会在 30 秒后中断。快速回答请保持较低的推理强度,较长的回答交给后台工具。超过 4 MB 的图片不会在聊天中显示,所以请保持 1k 分辨率。

不可信内容:搜索结果、帖子和回答来自开放网络和 X。AI 会把其中的指令当作数据,而不是命令。

常见错误:400 Incorrect API key provided 表示密钥错误:xAI 对无效密钥返回 400 而不是 401,请从控制台重新复制。401 No credentials presented:缺少密钥。403:团队额度已用完,或密钥没有访问此端点或模型的权限(xai_get_api_key_info 会列出其权限);请在 Billing 中充值。404:模型不存在或你的团队无权访问,请查看 xai_list_language_models。422:某个字段格式不对,消息会指出是哪一个。429:速率限制;请稍候并重试一次。

该连接器不支持流式回答,不用 Chat Completions 生成普通回答(由 Responses API 负责),也不支持视频生成、语音、文件、collections、批处理任务以及兼容 Anthropic 的端点。

步骤 2 — 安装 adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

步骤 3 — 在 Muse 中添加连接器

你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(https://cloud.anythingmcp.com/mcp/…)。本指南中出现 YOUR_SERVER_ID 的地方都用它替换。

Muse 以自定义连接器的形式添加远程 MCP 服务器,并通过 OAuth 登录。

  1. 在 Muse 中打开 Settings → Connectors,选择 Add custom connector。
  2. 粘贴 MCP 服务器 URL https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID。
  3. Muse 会打开 AnythingMCP 的登录页面:登录并批准访问。
  4. 在聊天中,向 Muse 提出需要用到 xAI Grok 的工具的请求。

你也可以在聊天中完成设置,适用于网页版、iOS 和 Android 应用以及 WhatsApp。给 Muse 发送这条消息:

Create a Custom Connector for a new remote MCP server, then connect to it:
Name: AnythingMCP
Transport: remote streamable HTTP
URL: https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID
Auth: OAuth

自托管?请用你实例的公网 HTTPS 地址替换 https://cloud.anythingmcp.com。Muse 从 Meta 的云端连接,因此 localhost 无法使用。

可用工具

ToolWhat it does
xai_list_language_modelsList the Grok language models the API key can use, with id, aliases, input and output modalities, and prices
xai_list_modelsList every model id the xAI API key can use (language, image and video models) with owner and creation time
xai_list_image_modelsList the Grok Imagine image models the key can use, with id, aliases, maximum prompt length and price per image (pricing lists…
xai_create_responseAsk Grok and get its answer through xAI's Responses API, the API xAI recommends
xai_web_searchAsk Grok a question it answers by searching the web itself (Responses API with the web_search server-side tool; the old Live Search…
xai_x_searchAsk Grok a question it answers by searching posts on X (Responses API with the x_search server-side tool), optionally limited to some…
xai_get_responseGet a stored xAI response by id (one created with store true), with output_text, citations, status and usage
xai_delete_responseDelete a stored xAI response, so it can no longer be read or continued
xai_start_deferred_completionStart a long Grok answer in the background (deferred chat completion) and get a request_id at once, for questions that may take longer than…
xai_get_deferred_completionFetch the result of a deferred Grok answer started with xai_start_deferred_completion
xai_generate_imageCreate pictures from a text description with Grok Imagine and return them as images the user can see
xai_edit_imageChange a picture with Grok Imagine from a text instruction (e.g. 'make the sky stormy', 'remove the car') and return the result as an image…
xai_tokenize_textCount the tokens a text uses with a Grok model's tokenizer, and list them, e.g. to estimate the cost of a long prompt
xai_get_api_key_infoGet the details of the xAI API key in use: redacted key, name, team id, permissions (acls) and whether the key or the team is blocked or…

示例提示

  • “让 Grok 在 X 上搜索本周大家对我们产品发布的评价,并列出它用到的帖子。”
  • “用 Grok 的网络搜索查找 Node.js 最新的发布说明,并附上来源做个总结。”
  • “用 Grok Imagine 为我们的电子报生成一张温馨阅读角的图片,但先和我确认费用。”
  • “这份合同文本用 Grok 的分词器有多少个 token?用 grok-4.3 做摘要大概要花多少钱?”

FAQ

Muse 在哪些地区可用? Meta 目前在美国和加拿大提供 Muse,可在网页版、iOS 和 Android 应用以及 WhatsApp 中使用。

Meta 会审核这个连接器吗? 不会。Meta 不审核自定义连接器。Muse 只能看到你在 AnythingMCP 中为此 MCP 服务器启用的工具,你也可以随时在 Settings → Connectors 中断开它。

下一步

这份指南对你有帮助吗?

你的 xAI Grok 智能体只差一次点击。

安装连接器,粘贴密钥,向 Meta Muse 提问。免费试用 7 天,无需信用卡。

相关指南

连接器

如何通过 MCP 将 xAI Grok 连接到 ChatGPT

让你的 AI 用你自己的 xAI API 密钥向 Grok 提问:Grok 模型的回答、基于网络或 X 实时搜索并附来源的回答、在后台生成的长回答,以及直接在聊天中用 Grok Imagine 生成或编辑的图片。

连接器

如何通过 MCP 将 xAI Grok 连接到 Claude

让你的 AI 用你自己的 xAI API 密钥向 Grok 提问:Grok 模型的回答、基于网络或 X 实时搜索并附来源的回答、在后台生成的长回答,以及直接在聊天中用 Grok Imagine 生成或编辑的图片。

连接器

如何通过 MCP 将 xAI Grok 连接到 Cursor

让你的 AI 用你自己的 xAI API 密钥向 Grok 提问:Grok 模型的回答、基于网络或 X 实时搜索并附来源的回答、在后台生成的长回答,以及直接在聊天中用 Grok Imagine 生成或编辑的图片。

连接器

如何通过 MCP 将 xAI Grok 连接到 Gemini

让你的 AI 用你自己的 xAI API 密钥向 Grok 提问:Grok 模型的回答、基于网络或 X 实时搜索并附来源的回答、在后台生成的长回答,以及直接在聊天中用 Grok Imagine 生成或编辑的图片。

连接器

xAI Grok 接入 MCP:在任意 AI 代理中使用 Grok 回答、网络和 X 搜索

让你的 AI 用你自己的 xAI API 密钥向 Grok 提问:Grok 模型的回答、基于网络或 X 实时搜索并附来源的回答、在后台生成的长回答,以及直接在聊天中用 Grok Imagine 生成或编辑的图片。

连接器

如何通过 MCP 将 Avito 连接到 Meta Muse

让你的 AI 使用你的 Avito 企业账户:列出广告并修改价格,读取浏览、联系和来电统计,检查自动上传 (autoload) 的上传记录及其错误、Feed 格式和钱包,并读取 Avito Messenger 聊天。发送消息和修改自动上传设置为可选功能,默认关闭。