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

  1. Run /init within Vesper Code to set up your .agents directory
  2. Create .agents/mcp.json with your MCP server configuration
  3. Set any required environment variables (e.g., export NOTION_TOKEN="your-token")
  4. Start Vesper Code

Search Order

Vesper Code searches for mcp.json in these locations (later ones override earlier):

  1. {cwd}/.agents/mcp.json — Project-specific
  2. {cwd}/../.agents/mcp.json — Parent directory (monorepos)
  3. ~/.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

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.