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

将 Cohere MCP 连接到 Gemini CLI

用你自己的 API 密钥使用 Cohere:Command 模型基于你的文档作答并给出引用,用于语义搜索的嵌入向量,搜索结果重排序,语音转文字,文档图片解析,token 计数,以及查看账户的模型、数据集、批处理和嵌入任务。

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

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

Cohere

Cohere

Let your AI use Cohere with your own API key: chat with Command models (with citations from your documents), create embeddings, rerank search results, transcribe audio, parse document images, count tokens, and check models, datasets, batches and embed jobs.

个工具

17

区域

INTL

类别

公共数据

身份验证

Bearer Token

所需环境变量

COHERE_API_KEY
在 Cloud 上一键安装

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

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

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

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

开始免费试用

摘要

用你自己的 API 密钥使用 Cohere:Command 模型基于你的文档作答并给出引用,用于语义搜索的嵌入向量,搜索结果重排序,语音转文字,文档图片解析,token 计数,以及查看账户的模型、数据集、批处理和嵌入任务。

试试这样问

Cohere 的示例提示

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

Cohere · 通过 MCP 实时
分享
Opus 4.7

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

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

Cohere + Gemini

用你自己的 API 密钥使用 Cohere:Command 模型基于你的文档作答并给出引用,用于语义搜索的嵌入向量,搜索结果重排序,语音转文字,文档图片解析,token 计数,以及查看账户的模型、数据集、批处理和嵌入任务。

前提条件

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

COHERE_API_KEY

步骤 1 — 获取凭证

设置大约需要 2 分钟。你需要一个 Cohere 账户;试用密钥免费。

  1. 在 https://dashboard.cohere.com 注册,打开 API Keys(https://dashboard.cohere.com/api-keys)。
  2. 复制试用密钥;或者先在 Billing 中添加付款方式,再创建生产密钥。
  3. 把它粘贴到 COHERE_API_KEY,不要带 Bearer 字样。连接器以 Authorization: Bearer 发送密钥,且只发给 Cohere。
  4. 安装连接器并运行 cohere_check_api_key 或 cohere_list_models 来检查密钥。

哪些工具会产生费用:cohere_chat、cohere_embed、cohere_rerank、cohere_transcribe_audio 和 cohere_parse_document 会运行模型。使用生产密钥时每次调用都会计费:对话按输入和输出 token 计费,嵌入按 token 或图片计费,重排序按每次最多 100 个文档的搜索计费(较长的文档按多个计)。试用密钥免费,但有每分钟和每月的限制,且不得用于商业用途。AI 会在大规模或重复调用前征求你的确认,并设置 max_tokens 来限制对话回复长度。cohere_tokenize、cohere_detokenize、cohere_check_api_key 以及所有列表和读取工具都不收费。

模型:ID 会变化,所以请用 cohere_list_models(可按 endpoint 筛选 chat、embed 或 rerank)查看最新列表,用 cohere_get_model 查看单个模型的上下文长度、功能和端点。

  • 对话:command-a-03-2025(默认选择)、command-a-reasoning-08-2025(推理)、command-a-vision-07-2025(图像)、command-a-translate-08-2025(翻译)、command-r7b-12-2024(小巧便宜)。
  • 嵌入:embed-v4.0(文本和图片)、embed-v5.0-pro、embed-v5.0-fast、embed-multilingual-v3.0。
  • 重排序:rerank-v5.0-fast(默认)、rerank-v5.0-pro(更准确)、rerank-v3.5。
  • 转写:cohere-transcribe-03-2026。解析:parse-v5.0。

带引用的回答:cohere_chat 接收 model 和 messages,一次性返回完整回复。传入 documents(普通字符串,或带 id 和包含 title、snippet 的 data 的对象)即可得到基于文档的回答,回复中会带有指向这些文档的 message.citations。response_format 强制输出 JSON,tools 增加函数调用,thinking 的 type 设为 disabled 可关闭推理模型的推理。

语义搜索:cohere_embed 把最多 96 段文本(或以 data URI 表示的图片)转为向量;存储的内容用 input_type search_document,查询用 search_query。这里默认使用 embed-v4.0,256 维(output_dimension 可选 256、512、1024 或 1536)。cohere_rerank 按与查询的相关度对最多 1,000 个文档排序,返回包含 index(在你列表中的位置)和 0 到 1 之间 relevance_score 的 results;top_n 只保留最好的几条。

音频和文档:cohere_transcribe_audio 接收音频文件的公开链接(flac、mp3、mpeg、mpga、ogg、wav,通过本连接器最大 10 MB)以及必填的 language(ISO-639-1);连接器会下载文件并上传到 Cohere。cohere_parse_document 把页面图片(扫描件、照片、截图;公开链接或最大 20 MB 的 data URI)转换为内嵌表格的 Markdown,或转换为版面块。暂不支持 PDF。

Token:cohere_tokenize 按模型统计文本的 token 数,例如在对话调用之前;cohere_detokenize 把 token ID 还原为文本。

账户数据:cohere_list_datasets、cohere_get_dataset 和 cohere_get_dataset_usage(已用存储,每个组织上限 10 GB);Batch API 任务用 cohere_list_batches 和 cohere_get_batch;嵌入任务用 cohere_list_embed_jobs 和 cohere_get_embed_job。

数据格式:对话返回 message.content[](type 为 text、带 text 的条目)、finish_reason(COMPLETE、MAX_TOKENS、STOP_SEQUENCE、TOOL_CALL、ERROR)以及记录计费输入和输出 token 的 usage.billed_units。嵌入向量位于 embeddings.float,按文本顺序每段一个向量。日期为 UTC 的 ISO 8601 格式。

分页:cohere_list_models 和 cohere_list_batches 返回 next_page_token;AI 会把它作为 page_token 传回,直到它为空。cohere_list_datasets 使用 limit 和 offset 分页。

安装时关闭的工具:没有。全部 17 个工具都已启用,且没有任何工具会删除数据。

限制:每次嵌入调用最多 96 段文本,每次重排序最多 1,000 个文档;音频最大 10 MB,文档图片最大 20 MB。试用密钥的每分钟和每月限制较低。

常见错误:400 表示请求有误(例如模型不接受的参数,或超过 96 段文本);401 表示密钥错误;402 表示需要付款方式(请在 Billing 中添加);404 表示模型、数据集、批处理或任务不存在;422 表示请求无法处理;429 表示达到速率限制(AI 会等待,而不是循环重试);499 表示请求已取消;500 和 503 是 Cohere 端的问题,请稍后重试一次。

该连接器不进行流式回复,也不创建、取消或删除数据集、批处理和嵌入任务。Classify、Summarize、Generate、connectors 和微调已被 Cohere 弃用,因此不包含在内。

步骤 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 — 在 Gemini 中添加连接器

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

Gemini CLI 从 ~/.gemini/settings.json(Windows 上为 %USERPROFILE%\.gemini\settings.json)读取 MCP 服务器。添加:

{
  "mcpServers": {
    "anythingmcp": {
      "httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
      "headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
    }
  }
}
  1. 在 AnythingMCP 的 MCP Servers → 你的服务器 → API keys 中创建 MCP API 密钥,并用它替换 YOUR_MCP_API_KEY。
  2. 保存文件并重启 gemini。
  3. 在 Gemini CLI 中运行 /mcp(或在终端运行 gemini mcp list),anythingmcp 应显示为已连接。
  4. 开始输入提示,Gemini CLI 现在可以调用 Cohere 的工具。

可用工具

ToolWhat it does
cohere_list_modelsList the Cohere models available to this key, with endpoints they serve (chat, embed, rerank), context length, features and whether they…
cohere_get_modelRead one Cohere model by name: endpoints, default endpoints, context length, features (e.g. tools, vision, reasoning), tokenizer URL and…
cohere_check_api_keyCheck that the Cohere API key is valid and active; returns valid plus the organization and owner ids
cohere_chatAsk a Cohere Command model and get its reply (Chat API v2, non-streaming)
cohere_embedTurn up to 96 texts (or images as data URIs) into embedding vectors for semantic search, clustering or classification (Embed API v2)
cohere_rerankOrder a list of documents by relevance to a query (Rerank API v2) and return the top results with their index in the list and a…
cohere_transcribe_audioTranscribe speech in an audio file to text with Cohere Transcribe
cohere_parse_documentParse an image of a document page (scan, photo, screenshot) into markdown, with tables inlined, or into layout blocks (Parse API v2)
cohere_tokenizeSplit a text into tokens with the tokenizer of a Cohere model and return the token ids and token strings, e.g. to count tokens before a…
cohere_detokenizeTurn a list of token ids back into text with the tokenizer of a Cohere model
cohere_list_datasetsList the datasets of the Cohere account (inputs for embed jobs, batches and fine-tuning) with id, name, type, validation status and…
cohere_get_datasetRead one Cohere dataset: name, type, validation status and error, schema, size and its parts
cohere_get_dataset_usageRead how much dataset storage the Cohere organization uses, in bytes (the limit is 10 GB per organization)
cohere_list_batchesList the Batch API jobs of the Cohere account with id, name, model, status, input and output dataset ids and request counts
cohere_get_batchRead one Cohere batch job: status, model, input and output dataset ids, request counts (succeeded, failed) and timestamps
cohere_list_embed_jobsList the embed jobs of the Cohere account with job id, name, status, model, input and output dataset ids and creation time
cohere_get_embed_jobRead one Cohere embed job: status (processing, complete, cancelling, cancelled, failed), model, truncate setting, input dataset and the…

示例提示

  • “只用这三段政策摘录回答关于我们退货期限的问题,并标出每句话来自哪段摘录。”
  • “这 20 条商品描述中,哪些最符合冬季防水登山靴?请重排序并给出前 5 条及其分数。”
  • “这段合同文本在 command-a-03-2025 下有多少个 token?”
  • “把 https://example.com/scans/invoice-0425.png 这张扫描发票转换成 Markdown,包括明细表格。”
  • “我的 Cohere 嵌入任务和批处理中,哪些还在运行?有没有失败的?”

FAQ

Gemini CLI 从哪里读取 MCP 服务器? 用户级配置位于 ~/.gemini/settings.json,项目级配置位于项目内的 .gemini/settings.json。gemini mcp list 会列出每个服务器及其连接状态。

下一步

这份指南对你有帮助吗?

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

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

相关指南

连接器

Cohere MCP 服务器:对话、嵌入与重排

用你自己的 API 密钥使用 Cohere:Command 模型基于你的文档作答并给出引用,用于语义搜索的嵌入向量,搜索结果重排序,语音转文字,文档图片解析,token 计数,以及查看账户的模型、数据集、批处理和嵌入任务。

连接器

将 Cohere MCP 连接到 ChatGPT

用你自己的 API 密钥使用 Cohere:Command 模型基于你的文档作答并给出引用,用于语义搜索的嵌入向量,搜索结果重排序,语音转文字,文档图片解析,token 计数,以及查看账户的模型、数据集、批处理和嵌入任务。

连接器

将 Cohere MCP 连接到 Claude

用你自己的 API 密钥使用 Cohere:Command 模型基于你的文档作答并给出引用,用于语义搜索的嵌入向量,搜索结果重排序,语音转文字,文档图片解析,token 计数,以及查看账户的模型、数据集、批处理和嵌入任务。

连接器

将 Cohere MCP 连接到 Cursor

用你自己的 API 密钥使用 Cohere:Command 模型基于你的文档作答并给出引用,用于语义搜索的嵌入向量,搜索结果重排序,语音转文字,文档图片解析,token 计数,以及查看账户的模型、数据集、批处理和嵌入任务。

连接器

将 Cohere MCP 连接到 Meta Muse

用你自己的 API 密钥使用 Cohere:Command 模型基于你的文档作答并给出引用,用于语义搜索的嵌入向量,搜索结果重排序,语音转文字,文档图片解析,token 计数,以及查看账户的模型、数据集、批处理和嵌入任务。

连接器

将 Cohere MCP 连接到 Microsoft Copilot

用你自己的 API 密钥使用 Cohere:Command 模型基于你的文档作答并给出引用,用于语义搜索的嵌入向量,搜索结果重排序,语音转文字,文档图片解析,token 计数,以及查看账户的模型、数据集、批处理和嵌入任务。