Overview
Access Cohere models optimized for RAG, embeddings, and enterprise NLP.
Setup
Run with npx:
npx -y @modelcontextprotocol/server-cohereConfiguration
COHERE_API_KEY environment variableDocumentation
Cohere MCP
Overview
Cohere MCP 是一个模型上下文协议服务器,允许 AI 代理与 Cohere API 进行交互。Cohere 是专注于企业级 NLP 的 AI 公司,其模型在文本生成、嵌入和检索增强生成(RAG)方面表现卓越。通过此 MCP 服务器,AI 可以访问 Cohere 的多种模型,包括 Command R+、Command R、Embed 等。
Cohere MCP 使得 AI 代理能够使用企业级的 NLP 模型,特别适合 RAG 应用、文本嵌入、多语言支持和企业级部署场景。
Features
- 多模型支持:Command R+、Command R、Embed 等
- RAG 优化:专为检索增强生成优化
- 多语言支持:支持 100+ 语言
- 嵌入模型:高质量的文本嵌入
- 工具调用:原生支持工具调用
- 企业级:SOC 2 合规,数据隐私保障
Installation
# 使用 npx 运行
npx -y @modelcontextprotocol/server-cohere
# 或使用 uvx
uvx mcp-server-cohere
Configuration
添加以下配置到 claude_desktop_config.json:
{
"mcpServers": {
"cohere": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-cohere"],
"env": {
"COHERE_API_KEY": "your-api-key"
}
}
}
}
获取 Cohere API Key
- 访问 https://dashboard.cohere.com/
- 创建账户
- 转到 API Keys 页面
- 创建新密钥
Available Models
| 模型 | 上下文窗口 | 用途 |
|---|---|---|
command-r-plus | 128K | 高质量复杂任务 |
command-r | 128K | 平衡性能成本 |
embed-english-v3.0 | - | 文本嵌入 |
embed-multilingual-v3.0 | - | 多语言嵌入 |
Available Tools
| Tool | Description |
|---|---|
cohere_list_models | 列出可用模型 |
cohere_chat | 执行聊天请求 |
cohere_generate | 生成文本 |
cohere_embed | 生成嵌入向量 |
cohere_rerank | 重新排序搜索结果 |
cohere_classify | 文本分类 |
cohere_summarize | 文本摘要 |
Usage Examples
示例 1:RAG 应用
AI: 使用 Command R+ 基于检索的文档回答问题
Cohere MCP:
- 检索相关文档
- 调用 cohere_chat 使用 RAG 模式
- 返回基于文档的回答
示例 2:文本嵌入
AI: 为以下文本生成嵌入向量
Cohere MCP:
- 调用 cohere_embed
- 使用 embed-multilingual-v3.0
- 返回向量
示例 3:搜索结果重排序
AI: 对以下搜索结果进行重排序
Cohere MCP:
- 调用 cohere_rerank
- 传入查询和搜索结果
- 返回按相关性排序的结果
Pros
- ✅ RAG 原生优化
- ✅ 多语言支持(100+ 语言)
- ✅ 高质量嵌入模型
- ✅ 企业级安全和合规
- ✅ 原生工具调用支持
- ✅ 开源免费客户端
Cons
- ❌ 模型选择相对较少
- ❌ 需要 API Key
- ❌ 某些功能需要付费
- ❌ 社区规模相对较小
When to Use
- 需要构建 RAG 系统时
- 需要高质量文本嵌入时
- 需要多语言支持时
- 需要企业级部署时
- 需要文本重排序时
