Coveo MCP Server
Enables AI agents to query Coveo's unified index for search, passage retrieval, and generative question answering, supporting multiple transport modes for client compatibility.
README
Coveo MCP Server
Disclaimer
The Coveo MCP Server is provided as-is, intended purely for educational and exploratory purposes. It’s not a production-ready product.
Overview
This is a simple MCP server that connects to Coveo and executes queries. It provides tools for:
- Search functionality
- Passage retrieval
- Question answering
How It Works
The Coveo MCP Server acts as a bridge, exposing powerful Coveo APIs as simple, consumable tools for any MCP-compatible client, like Anthropic's Claude.
flowchart TD
subgraph Your Application
MCP_CLIENT["MCP Client (e.g., Claude)"]
end
subgraph This Project
MCP_SERVER["Coveo MCP Server"]
end
subgraph Coveo Platform
SEARCH_API["Search API"]
PASSAGE_API["Passage Retrieval API"]
ANSWER_API["Generative Answering API"]
end
MCP_CLIENT -- "Requests tools" --> MCP_SERVER
MCP_SERVER -- "Calls API" --> SEARCH_API
MCP_SERVER -- "Calls API" --> PASSAGE_API
MCP_SERVER -- "Calls API" --> ANSWER_API
What You Can Build
By connecting your AI agents to Coveo's unified index, you can build powerful, secure, and accurate applications. For example:
-
A Customer Support Agent: An automated agent that answers customer questions using your official knowledge base and product documentation, complete with citations.
-
An Internal Knowledge Chatbot: A secure chatbot for employees to query internal resources like HR policies, technical documentation, or sales enablement materials, while respecting all user permissions.
-
A Commerce Copilot: An assistant that helps shoppers find the best product by understanding natural language queries and retrieving precise information from product catalogs.
-
A Research Assistant: An agent that can quickly summarize and synthesize information from a vast repository of documents by using
passage_retrievalto gather context before generating a report.
Available Tools
Expose Coveo's powerful APIs as simple, easy-to-use tools for your agents.
🛠️ search_coveo
Use search_coveo to retrieve metadata, titles, or URLs. Ideal for broadly exploring information, navigating sources, or presenting lists of content.
Input:
query(string)numberOfResults(int, optional, default: 5)
Output: JSON formatted search results or an error message.
🛠️ passage_retrieval
Use passage_retrieval to extract highly relevant text snippets. Useful for building answers, summaries, or new documents from source material.
Input:
query(string)numberOfPassages(int, optional, default: 5)
Output: JSON formatted passages or an error message.
🛠️ answer_question
Use answer_question when you need a complete, consistent, and well-structured answer, powered by Coveo's Relevance Generative Answering engine.
Input:
query(string)
Output: A generated answer from Coveo sources with citations.
Get Started in 4 steps
Go from zero to a running Coveo MCP server in minutes.
1. Clone the Repository
Get the source code on your local machine.
git clone https://github.com/coveo-labs/coveo-mcp-server.git
cd coveo-mcp-server
2. Configure Your Environment
Copy the example environment file and add your Coveo API credentials.
cp .env.example .env
Then, edit the .env file with your credentials:
COVEO_API_KEY="<your-api-key>"
COVEO_ORGANIZATION_ID="<your-organization-id>"
COVEO_ANSWER_CONFIG_ID="<your-answer-config-id>"
3. Install Dependencies
We recommend using uv for fast dependency management.
# Install in editable mode with development dependencies
# Note the quotes around '.[dev]' to prevent shell errors
uv pip install -e '.[dev]'
4. Run the Server
Start the server. By default, it uses the modern streamable-http transport.
python -m coveo_mcp_server
The server will be available at http://127.0.0.1:8000.
Alternative Transport Options
The server supports multiple transport methods:
-
Streamable HTTP (Default): The new standard for MCP servers
python -m coveo_mcp_server -
SSE Transport (Legacy): For older clients that require SSE
USE_SSE=true python -m coveo_mcp_server -
STDIO Transport: For direct stdio communication
USE_STDIO=true python -m coveo_mcp_server
Core Features
- Asynchronous by Design: Leverages
httpxandasynciofor non-blocking API requests. - Grounded Generative Answering: Go beyond search results with AI-generated answers complete with citations from your indexed content.
- Semantic Passage Retrieval: Intelligently extracts the most relevant text snippets, not just whole documents.
- Easy Configuration: Simple setup using a
.envfile for your Coveo credentials. - Multiple Transports: Supports modern
streamable-http, legacySSE, and directSTDIOfor maximum client compatibility. - Fully Tested: Includes a comprehensive test suite with
pytestto ensure reliability.
Development & Testing
Development Setup
If you want to edit the source code or contribute to this project, set up a local development environment.
-
Create and Activate a Virtual Environment
First, create a virtual environment in the project's root directory. This will keep all the necessary dependencies isolated.
# Create the virtual environment python -m venv .venv # Activate it (macOS/Linux) source .venv/bin/activate # Or activate it (Windows) # .\.venv\Scripts\activate -
Install Dependencies
With the virtual environment active, install the project in "editable" mode. This allows you to make changes to the code and have them immediately reflected without reinstalling.
# Install in editable mode with development dependencies # Note the quotes around '.[dev]' to prevent shell errors uv pip install -e '.[dev]'This command installs the package in editable mode (
-e) and includes the extra development dependencies ([dev]), such as pytest, which are defined in thepyproject.tomlfile.
Testing Your Server
Testing with MCP Inspector
You can test the server with the MCP Inspector in two ways:
- Using the
mcp devcommand:
mcp dev src/coveo_mcp_server/__main__.py
This will start the MCP Inspector at http://localhost:5173, where you can interact with and test the server's functionality.
- Using
npxwith the MCP Inspector:
npx @modelcontextprotocol/inspector \
uv \
--directory /[path to project]/coveo-mcp-server \
run \
--with mcp \
mcp run src/coveo_mcp_server/__main__.py
Testing your server with Claude for Desktop
First, make sure you have Claude for Desktop installed. You can install the latest version here. If you already have Claude for Desktop, make sure it's updated to the latest version.
We'll need to configure Claude for Desktop for whichever MCP servers you want to use. To do this, open your Claude for Desktop App configuration at ~/Library/Application Support/Claude/claude_desktop_config.json in a text editor. Make sure to create the file if it doesn't exist.
Here's an example configuration:
{
"mcpServers": {
"coveo_mcp_server": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/coveo-mcp-server/src/coveo_mcp_server",
"run",
"__main__.py"
]
}
}
}
Note: If Claude for Desktop cannot find the uv command, you may need to specify the full path in the configuration:
"command": "/opt/homebrew/bin/uv"
Running the Test Suite
This project includes comprehensive unit tests.
Running All Tests
To run the tests and generate a coverage report:
./run_tests.sh
Or use pytest directly:
pytest tests/ -v --cov=src/coveo_mcp_server
Testing Transport Modes
To verify all transport modes are working correctly:
python test_transports.py
This script will verify that:
- Streamable-HTTP transport starts correctly (default)
- SSE transport starts correctly (legacy)
- STDIO transport can be imported and initialized
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。