
Contextual Mcp Server
io.github.NitishGourishetty由 GitHub 账号 NitishGourishetty 发布v0.1.0更新于 Oct 24, 2026
RAG-enabled MCP server using Contextual AI. Supports single-agent and multi-agent modes.
概览
一个本地 MCP 服务器,将助手连接到 Contextual AI 的 RAG 智能体,让问题基于你的知识库作答并附上引用。
- 可以做什么
- 把特定领域的问题发送给专用的 Contextual AI 智能体,并在聊天客户端中返回答案(query 命令)。从 Contextual AI 知识库中检索相关片段,给出有来源依据的回答。回答附带引用与出处,并保留对话上下文以支持追问。支持单智能体和多智能体模式,查询工具的说明文字决定客户端何时把问题转给该智能体。
- 适用场景
- 当你已有 Contextual AI 智能体和知识库,希望 Cursor 或 Claude Desktop 依据这些文档回答问题并给出引用,而不是依赖模型的通用知识时使用。
- 运行要求
- 以 Python 包形式通过 stdio 在本地运行(需要 Python 3.10 或更高版本;README 使用 uv 管理依赖)。需要 Contextual AI API 密钥(API_KEY),单智能体模式下还需要智能体 ID(AGENT_ID)。需要 Cursor 或 Claude Desktop 等兼容客户端;仅限桌面环境,在远程开发环境中可能无法使用。
安装
在 SourceWeft 中
- 打开 控制台中的 Contextual Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Contextual MCP Server
A Model Context Protocol (MCP) server that provides RAG (Retrieval-Augmented Generation) capabilities using Contextual AI. This server integrates with a variety of MCP clients. It provides flexibility in you can decide what functionality to offer in the server. In this readme, we will show integration with the both Cursor IDE and Claude Desktop.
Contextual AI now offers a hosted server inside the platform available at: https://mcp.app.contextual.ai/mcp/
After you connect to the server, you can use the tools, such as query, provided by the platform MCP server.
For a complete walkthrough, check out the MCP user guide.
Overview
An MCP server acts as a bridge between AI interfaces (Cursor IDE or Claude Desktop) and a specialized Contextual AI agent. It enables:
- Query Processing: Direct your domain specific questions to a dedicated Contextual AI agent
- Intelligent Retrieval: Searches through comprehensive information in your knowledge base
- Context-Aware Responses: Generates answers that are:
- Grounded in source documentation
- Include citations and attributions
- Maintain conversation context
Integration Flow
Prerequisites
- Python 3.10 or higher
- Cursor IDE and/or Claude Desktop
- Contextual AI API key
- MCP-compatible environment
Installation
- Clone the repository:
- Create and activate a virtual environment:
- Install dependencies:
Configuration
Configure MCP Server
The server requires modifications of settings or use. For example, the single_agent server should be customized with an appropriate docstring for your RAG Agent.
The docstring for your query tool is critical as it helps the MCP client understand when to route questions to your RAG agent. Make it specific to your knowledge domain. Here is an example:
or
The server also requires the following settings from your RAG Agent:
API_KEY: Your Contextual AI API keyAGENT_ID: Your Contextual AI agent ID
If you'd like to store these files in .env file you can specify them like so:
The repo also contains more advance MPC servers for multi-agent systems or a document-agent.
AI Interface Integration
This MCP server can be integrated with a variety of clients. To use with either Cursor IDE or Claude Desktop create or modify the MCP configuration file in the appropriate location:
- First, find the path to your
uvinstallation:
- Create the configuration file using the full path from step 1:
- Move to the correct folder location, see below for options:
Configuration locations:
- For Cursor:
- Project-specific:
.cursor/mcp.jsonin your project directory - Global:
~/.cursor/mcp.jsonfor system-wide access - For Claude Desktop:
- Use the same configuration file format in the appropriate Claude Desktop configuration directory
Environment Setup
This project uses uv for dependency management, which provides faster and more reliable Python package installation.
Usage
The server provides Contextual AI RAG capabilities using the python SDK, which can available a variety of commands accessible from MCP clients, such as Cursor IDE and Claude Desktop. The current server focuses on using the query command from the Contextual AI python SDK, however you could extend this to support other features such as listing all the agents, updating retrieval settings, updating prompts, extracting retrievals, or downloading metrics.
Example Usage
Key Benefits
- Accurate Responses: All answers are grounded in your documentation
- Source Attribution: Every response includes references to source documents
- Context Awareness: The system maintains conversation context for follow-up questions
- Real-time Updates: Responses reflect the latest documentation in your datastore
Development
Modifying the Server
To add new capabilities:
- Add new tools by creating additional functions decorated with
@mcp.tool() - Define the tool's parameters using Python type hints
- Provide a clear docstring describing the tool's functionality
Example:
Limitations
- The server runs locally and may not work in remote development environments
- Tool responses are subject to Contextual AI API limits and quotas
- Currently only supports stdio transport mode
For all the capabilities of Contextual AI, please check the official documentation.
来源:README.md,提交 b3a5a4f
工具
0版本历史
1- v0.1.0最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。