MCP Server Configuration
RAPID supports MCP (Model Context Protocol) servers to extend AI agent capabilities with external tools, data sources, and services.
Overview
Section titled “Overview”MCP servers provide AI agents with access to:
- Documentation context - Library and framework documentation
- Web search - Real-time information retrieval
- Browser automation - Web scraping and testing
- Database access - Query and manage databases
- File system - Read and write files
- Memory - Persistent knowledge graphs
Quick Start
Section titled “Quick Start”Initialize with MCP Servers
Section titled “Initialize with MCP Servers”When initializing a new RAPID project, you can specify which MCP servers to enable:
# Default setup (context7 + tavily)rapid init
# Specify serversrapid init --mcp context7,tavily,playwright
# Skip MCP configurationrapid init --no-mcpManaging MCP Servers
Section titled “Managing MCP Servers”Use the rapid mcp command to manage servers:
# List configured serversrapid mcp list
# Show available templatesrapid mcp list --templates
# Add a server from templaterapid mcp add playwright
# Add a custom serverrapid mcp add myserver --type remote --url https://api.example.com/mcp
# Enable/disable serversrapid mcp disable tavilyrapid mcp enable tavily
# Remove a serverrapid mcp remove playwright
# Show server statusrapid mcp status
# Regenerate config filesrapid mcp syncAvailable Server Templates
Section titled “Available Server Templates”RAPID includes built-in templates for popular MCP servers:
| Server | Type | Description | Required Secrets |
|---|---|---|---|
context7 | Remote | Documentation context for libraries | CONTEXT7_API_KEY |
tavily | Remote | Web search and data extraction | TAVILY_API_KEY |
playwright | Stdio | Browser automation and web scraping | None |
github | Stdio | GitHub operations (PRs, issues) | GITHUB_TOKEN |
filesystem | Stdio | File system access | None |
memory | Stdio | Persistent knowledge graph | None |
postgres | Stdio | PostgreSQL database access | DATABASE_URL |
slack | Stdio | Slack messaging | SLACK_TOKEN |
fetch | Stdio | HTTP content retrieval | None |
sqlite | Stdio | SQLite database access | None |
Configuration
Section titled “Configuration”In rapid.json
Section titled “In rapid.json”MCP servers are configured in the mcp section:
{ "mcp": { "configFile": ".mcp.json", "servers": { "context7": { "enabled": true, "type": "remote", "url": "https://mcp.context7.com/mcp", "headers": { "Context7-API-Key": "${CONTEXT7_API_KEY}" } }, "tavily": { "enabled": true, "type": "remote", "url": "https://mcp.tavily.com/mcp", "headers": { "Authorization": "Bearer ${TAVILY_API_KEY}" } }, "playwright": { "enabled": true, "type": "stdio", "command": "npx", "args": ["@playwright/mcp@latest"] } } }}Server Types
Section titled “Server Types”Remote (HTTP) Servers
Section titled “Remote (HTTP) Servers”Remote servers communicate over HTTP:
{ "myserver": { "type": "remote", "url": "https://api.example.com/mcp", "headers": { "Authorization": "Bearer ${API_KEY}" } }}Stdio Servers
Section titled “Stdio Servers”Stdio servers run as local processes:
{ "myserver": { "type": "stdio", "command": "npx", "args": ["@example/mcp-server"], "env": { "API_KEY": "${API_KEY}" } }}Variable Substitution
Section titled “Variable Substitution”Server configurations support variable substitution:
| Syntax | Description |
|---|---|
${VAR} | Environment variable |
${env:VAR} | Environment variable from container |
${localEnv:VAR} | Environment variable from host |
Generated Config Files
Section titled “Generated Config Files”RAPID generates two config files from your rapid.json:
.mcp.json
Section titled “.mcp.json”Used by Claude Code and other MCP-compatible tools:
{ "mcpServers": { "context7": { "type": "http", "url": "https://mcp.context7.com/mcp", "headers": { "Context7-API-Key": "${CONTEXT7_API_KEY}" } } }}opencode.json
Section titled “opencode.json”Used by OpenCode with its specific format:
{ "$schema": "https://opencode.ai/config.json", "mcp": { "context7": { "type": "remote", "url": "https://mcp.context7.com/mcp", "headers": { "Context7-API-Key": "{env:CONTEXT7_API_KEY}" } } }}Secrets for MCP Servers
Section titled “Secrets for MCP Servers”Most MCP servers require API keys or tokens. Configure these in the secrets.items section:
{ "secrets": { "provider": "1password", "vault": "Development", "items": { "CONTEXT7_API_KEY": "op://Development/Context7/api-key", "TAVILY_API_KEY": "op://Development/Tavily/api-key", "GITHUB_TOKEN": "op://Development/GitHub/pat" } }}Getting API Keys
Section titled “Getting API Keys”| Server | Where to Get Key |
|---|---|
| Context7 | context7.com |
| Tavily | tavily.com |
| GitHub | github.com/settings/tokens |
| Slack | api.slack.com/apps |
Using MCP Servers
Section titled “Using MCP Servers”Once configured, MCP servers are automatically available to your AI agents during rapid dev:
- RAPID loads secrets from your secret provider
- Generates
.mcp.jsonandopencode.jsonwith resolved references - Sets
MCP_CONFIG_FILEenvironment variable - Launches the agent with MCP servers available
Example Workflow
Section titled “Example Workflow”# 1. Initialize project with MCPrapid init --mcp context7,tavily
# 2. Add your API keys to secrets# Edit rapid.json secrets.items
# 3. Verify secrets are accessiblerapid secrets verify
# 4. Start development with MCP serversrapid devAdding Custom MCP Servers
Section titled “Adding Custom MCP Servers”You can add any MCP-compatible server:
# Add a custom remote serverrapid mcp add myapi \ --type remote \ --url https://api.example.com/mcp \ --header "Authorization=Bearer ${API_KEY}"
# Add a custom stdio serverrapid mcp add mytool \ --type stdio \ --command npx \ --args "@example/mcp-server,--config,./config.json"Troubleshooting
Section titled “Troubleshooting”Server Not Appearing
Section titled “Server Not Appearing”If a server doesn’t appear in agent tools:
- Check it’s enabled:
rapid mcp status - Verify secrets:
rapid secrets verify - Regenerate configs:
rapid mcp sync
Authentication Errors
Section titled “Authentication Errors”If you get authentication errors:
- Verify the API key is correct
- Check the header format matches the server’s requirements
- Ensure secrets are loaded:
rapid secrets list
Stdio Server Fails to Start
Section titled “Stdio Server Fails to Start”If a stdio server won’t start:
- Check the command is installed:
which npx - Verify the package exists
- Check for error messages in agent output