MCP Explained: How Model Context Protocol Connects AI to Your Tools
What is MCP?
Model Context Protocol (MCP) is an open standard that lets AI assistants connect to external tools, data sources, and services. Instead of copy-pasting context between your AI chat and your tools, MCP lets the AI read your files, query your databases, call your APIs, and take actions — all through a standardized interface.
Think of MCP as USB-C for AI: one standard connector that works with any tool and any AI client.
Why MCP matters
Before MCP, connecting an AI assistant to your tools required custom integrations for every combination. If you wanted Claude to read your GitHub issues, you wrote a Claude-specific integration. If you wanted the same for GPT, you wrote a separate one. MCP eliminates this by defining a standard protocol any AI client can use.
What MCP enables:
- AI assistants that can read your codebase, docs, and databases
- Tools that work with any MCP-compatible AI client (Claude Desktop, Cursor, Riven, etc.)
- Standardized permission and security model for tool access
- Real-time context injection — the AI sees your data as you work
How MCP works
MCP uses a client-server architecture:
- MCP Client — The AI application (Claude Desktop, Cursor, Riven Chat) that connects to servers
- MCP Server — A lightweight process that exposes your tools, resources, and prompts to the client
- Transport — Communication happens over stdio (local) or HTTP/SSE (remote)
The client discovers what the server offers (tools, resources, prompts) and makes them available to the AI model. When the AI needs to use a tool, the client calls the server and returns the result.
Riven MCP Server
Riven offers an official MCP server that brings Riven's capabilities into any MCP-compatible client:
- Chat completions — Send messages to any of Riven's 75+ models
- Research tasks — Launch long-running research and get cited answers
- Multi-model council — Get multiple model perspectives on a question
- Model catalog — Browse available models and their capabilities
Setup with Claude Desktop
- Install the Riven MCP server:
npm install -g @rivenai/mcp- Add to your Claude Desktop config (
~/Library/Application Support/Claude/claude_desktop_config.jsonon macOS):
{
"mcpServers": {
"riven": {
"command": "riven-mcp",
"env": {
"RIVEN_API_KEY": "rvn_..."
}
}
}
}- Restart Claude Desktop. You'll see Riven tools available in the chat.
Setup with Cursor
- Install the server:
npm install -g @rivenai/mcp- Add to Cursor settings (
.cursor/mcp.jsonin your project):
{
"mcpServers": {
"riven": {
"command": "riven-mcp",
"env": {
"RIVEN_API_KEY": "rvn_..."
}
}
}
}- Reload Cursor. Riven tools are now available in the AI panel.
Setup with any MCP client
The Riven MCP server follows the standard MCP protocol, so it works with any compatible client:
RIVEN_API_KEY=rvn_... riven-mcpThe server communicates over stdio using JSON-RPC, following the MCP specification.
What you can do with Riven MCP
Chat with any model
Ask Claude Desktop to use Riven for chat completions:
> "Use Riven to ask DeepSeek V4 to explain how transformer attention works"
Claude calls the Riven MCP server, which sends the request to DeepSeek V4 through Riven's API, and returns the response.
Run research tasks
> "Use Riven to research the top 5 competitors in the observability space"
Riven launches a research task that searches the web, synthesizes findings, and returns a cited report — all from within Claude Desktop.
Get multi-model perspectives
> "Use Riven's council feature to get GPT-5.6, Claude, and Gemini's take on this architecture decision"
Riven sends the question to multiple models simultaneously and returns all perspectives.
Building your own MCP server
MCP servers are simple to build. Here's a minimal example using the MCP SDK:
from mcp.server import Server
from mcp.types import Tool
server = Server("my-tools")
@server.list_tools()
async def list_tools():
return [
Tool(
name="get_weather",
description="Get current weather for a city",
inputSchema={
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"}
},
"required": ["city"]
}
)
]
@server.call_tool()
async def call_tool(name: str, arguments: dict):
if name == "get_weather":
# Your logic here
return [{"type": "text", "text": f"Weather in {arguments['city']}: Sunny, 72F"}]
if __name__ == "__main__":
import asyncio
asyncio.run(server.run_stdio())This exposes a get_weather tool that any MCP client can call. The Riven MCP server uses the same pattern but exposes Riven's API capabilities.
Security considerations
- API keys — Store your Riven API key in environment variables, never in config files that are committed to git
- Permissions — MCP clients show users which tools are available and ask for confirmation before calling them
- Local first — For stdio transport, the server runs locally and data doesn't leave your machine (except API calls to Riven)
- Scoping — Use a Riven API key with restricted model access and budget limits for production deployments
Getting started
- Get a Riven API key — free, no credit card required
- Install the Riven MCP server
- Read the MCP setup guide
- Browse the MCP specification
The Riven MCP server is open source and available at github.com/rivenai/riven-mcp.