RAG-enabled MCP server using Contextual AI. Supports single-agent and multi-agent modes.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
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.
An MCP server acts as a bridge between AI interfaces (Cursor IDE or Claude Desktop) and a specialized Contextual AI agent. It enables:
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 IDIf 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.
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:
uv installation:Configuration locations:
.cursor/mcp.json in your project directory~/.cursor/mcp.json for system-wide accessThis project uses uv for dependency management, which provides faster and more reliable Python package installation.
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.
To add new capabilities:
@mcp.tool()Example:
For all the capabilities of Contextual AI, please check the official documentation.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/contextual-mcp-server)<a href="https://allmcps.com/mcp/contextual-mcp-server"><img src="https://allmcps.com/api/badge/contextual-mcp-server?style=directory" alt="Contextual Mcp Server on AllMCPs" /></a>