MCP Servers
The Model Context Protocol (MCP) is an open standard that lets you connect AI agents to external tools and data sources.
Quick Start
Add MCP tools with a mcp.json file in your .agents/ directory. Servers configured here are automatically available to all base agents.
Example: Notion Integration
Create .agents/mcp.json:
{"mcpServers": {"notionApi": {"command": "npx","args": ["-y", "@notionhq/notion-mcp-server"],"env": {"NOTION_TOKEN": "$NOTION_TOKEN"}}}}
Set your NOTION_TOKEN environment variable and start Vesper Code — Notion tools are now available.
Setup Steps
- Run
/initwithin Vesper Code to set up your.agentsdirectory - Create
.agents/mcp.jsonwith your MCP server configuration - Set any required environment variables (e.g.,
export NOTION_TOKEN="your-token") - Start Vesper Code
Search Order
Vesper Code searches for mcp.json in these locations (later ones override earlier):
{cwd}/.agents/mcp.json— Project-specific{cwd}/../.agents/mcp.json— Parent directory (monorepos)~/.agents/mcp.json— Global
More Examples
GitHub Integration
{"mcpServers": {"github": {"command": "npx","args": ["-y", "@modelcontextprotocol/server-github"],"env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_TOKEN"}}}}
Multiple Servers
{"mcpServers": {"notion": {"command": "npx","args": ["-y", "@notionhq/notion-mcp-server"],"env": {"NOTION_TOKEN": "$NOTION_TOKEN"}},"github": {"command": "npx","args": ["-y", "@modelcontextprotocol/server-github"],"env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_TOKEN"}}}}
Remote API (HTTP)
{"mcpServers": {"myApi": {"type": "http","url": "https://api.example.com/mcp","headers": {"Authorization": "$API_TOKEN"}}}}
Environment Variables
Use the $VAR_NAME syntax to reference environment variables from your shell:
export NOTION_TOKEN="your-notion-integration-token"
Or use a .env file in your project root.
Finding MCP Servers
- MCP Server Registry — Official and community servers
- NPM — Search for
mcp-serverpackages
Troubleshooting
MCP tools not appearing: Check that mcp.json is valid JSON, verify it's in .agents/mcp.json, and restart Vesper Code.
Environment variable not found: Ensure the variable is exported in your shell and restart your terminal after adding to .bashrc/.zshrc.
Server not connecting: Run the MCP server command manually to test it works.