What is MCP?
Model Context Protocol (MCP) is an open standard that enables AI assistants like OpenCode to interact with external tools, databases, and services. MCP was developed by Anthropic and donated to the Linux Foundation in December 2025, with over 1,200 servers available in the ecosystem.
Why Use MCP Servers?
- Extended Capabilities: Query databases, manage files, automate browsers, and more
- Standardized Integration: One protocol for all tools, no custom integrations needed
- Security First: Sandboxed execution with explicit permissions
- Growing Ecosystem: 1,200+ servers available from official and community sources
Installing MCP Servers
Configuration File
OpenCode uses a configuration file to manage MCP servers. Create or edit ~/.config/opencode/config.toml:
[mcp]
enabled = true
[mcp.servers.filesystem]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory"]
[mcp.servers.github]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]
env = { GITHUB_PERSONAL_ACCESS_TOKEN = "ghp_your_token_here" }
Project-Level Configuration
For project-specific servers, create .opencode.json in your project root:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}
Official Reference Servers
These are maintained by the MCP team and are the most reliable options:
Filesystem Server
Access and manage files in specified directories.
[mcp.servers.filesystem]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/projects"]
Capabilities:
- Read, write, and edit files
- Create and delete directories
- Search files with glob patterns
- Get file metadata and stats
GitHub Server
Full GitHub API integration for repository management.
[mcp.servers.github]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]
env = { GITHUB_PERSONAL_ACCESS_TOKEN = "ghp_xxx" }
Capabilities:
- Create and manage repositories
- Handle pull requests and issues
- Manage branches and commits
- Access GitHub search API
Git Server
Local Git operations for version control.
[mcp.servers.git]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-git"]
Capabilities:
- Clone, pull, push operations
- Branch management
- Commit history and diffs
- Status and staging
PostgreSQL Server
Query and manage PostgreSQL databases.
[mcp.servers.postgres]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:pass@localhost:5432/mydb"]
Capabilities:
- Execute SQL queries
- Schema introspection
- Data manipulation (INSERT, UPDATE, DELETE)
- Transaction support
SQLite Server
Lightweight database operations for SQLite.
[mcp.servers.sqlite]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-sqlite", "--db-path", "./data.db"]
Capabilities:
- SQL query execution
- Schema management
- Database file operations
- Read-only or read-write modes
Memory Server
Persistent knowledge graph for context retention.
[mcp.servers.memory]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-memory"]
Capabilities:
- Store and retrieve knowledge entities
- Create relationships between concepts
- Persistent memory across sessions
- Graph-based querying
Sequential Thinking Server
Enhanced reasoning with dynamic thought chains.
[mcp.servers.sequential-thinking]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-sequential-thinking"]
Capabilities:
- Multi-step reasoning chains
- Hypothesis testing
- Complex problem decomposition
- Thought revision and refinement
Fetch Server
HTTP request capabilities for web APIs.
[mcp.servers.fetch]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-fetch"]
Capabilities:
- GET, POST, PUT, DELETE requests
- Custom headers and authentication
- JSON and text response handling
- URL content extraction
Popular Community Servers
Playwright MCP
Browser automation and testing with Microsoft Playwright.
[mcp.servers.playwright]
command = "npx"
args = ["-y", "@anthropic/mcp-server-playwright"]
Use Cases:
- End-to-end testing
- Web scraping with JavaScript rendering
- Screenshot capture
- Form automation
- Accessibility testing
Brave Search Server
Web search integration using Brave Search API.
[mcp.servers.brave-search]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-brave-search"]
env = { BRAVE_API_KEY = "your_api_key" }
Capabilities:
- Web search queries
- News search
- Image search
- Local search results
Puppeteer Server
Chrome browser automation (alternative to Playwright).
[mcp.servers.puppeteer]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-puppeteer"]
Capabilities:
- Headless Chrome control
- Page navigation and interaction
- PDF generation
- Performance profiling
Database Servers
Supabase MCP
Full Supabase platform integration.
[mcp.servers.supabase]
command = "npx"
args = ["-y", "supabase-mcp-server"]
env = { SUPABASE_URL = "https://xxx.supabase.co", SUPABASE_KEY = "your_key" }
Features:
- Database queries
- Authentication management
- Storage operations
- Real-time subscriptions
Neo4j MCP
Graph database operations for Neo4j.
[mcp.servers.neo4j]
command = "npx"
args = ["-y", "@neo4j/mcp-neo4j"]
env = { NEO4J_URI = "bolt://localhost:7687", NEO4J_USER = "neo4j", NEO4J_PASSWORD = "password" }
Capabilities:
- Cypher query execution
- Node and relationship management
- Graph traversal
- Schema inspection
ClickHouse MCP
Analytics database for ClickHouse.
[mcp.servers.clickhouse]
command = "npx"
args = ["-y", "@clickhouse/mcp-server"]
env = { CLICKHOUSE_URL = "http://localhost:8123" }
Use Cases:
- Analytical queries
- Time-series data
- Log analysis
- OLAP operations
Productivity Servers
Notion MCP
Notion workspace integration.
[mcp.servers.notion]
command = "npx"
args = ["-y", "notion-mcp-server"]
env = { NOTION_API_KEY = "secret_xxx" }
Capabilities:
- Read and update pages
- Database queries
- Create new content
- Search workspace
Linear MCP
Issue tracking with Linear.
[mcp.servers.linear]
command = "npx"
args = ["-y", "@linear/mcp-server"]
env = { LINEAR_API_KEY = "lin_api_xxx" }
Features:
- Create and update issues
- Manage projects and cycles
- Search issues
- Workflow automation
Slack MCP
Slack workspace integration.
[mcp.servers.slack]
command = "npx"
args = ["-y", "slack-mcp-server"]
env = { SLACK_BOT_TOKEN = "xoxb-xxx" }
Capabilities:
- Send messages
- Read channel history
- Manage channels
- User lookups
Cloud & DevOps Servers
AWS MCP
Amazon Web Services integration.
[mcp.servers.aws]
command = "npx"
args = ["-y", "aws-mcp-server"]
env = { AWS_ACCESS_KEY_ID = "xxx", AWS_SECRET_ACCESS_KEY = "xxx", AWS_REGION = "us-east-1" }
Supported Services:
- S3 (storage)
- Lambda (functions)
- EC2 (compute)
- DynamoDB (database)
- CloudWatch (monitoring)
Docker MCP
Container management for Docker.
[mcp.servers.docker]
command = "npx"
args = ["-y", "docker-mcp-server"]
Capabilities:
- List and manage containers
- Build and push images
- Network management
- Volume operations
Kubernetes MCP
Kubernetes cluster operations.
[mcp.servers.kubernetes]
command = "npx"
args = ["-y", "kubernetes-mcp-server"]
Features:
- Pod management
- Deployment operations
- Service configuration
- Log retrieval
Using Python Servers
Some MCP servers are written in Python and use uvx instead of npx:
[mcp.servers.python-example]
command = "uvx"
args = ["mcp-server-example"]
Make sure you have uv installed:
# Install uv (Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh
Example: Full Development Setup
Here's a comprehensive configuration for full-stack development:
[mcp]
enabled = true
# File system access for project
[mcp.servers.filesystem]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/projects"]
# GitHub integration
[mcp.servers.github]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]
env = { GITHUB_PERSONAL_ACCESS_TOKEN = "${GITHUB_TOKEN}" }
# PostgreSQL database
[mcp.servers.postgres]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-postgres", "${DATABASE_URL}"]
# Browser automation for testing
[mcp.servers.playwright]
command = "npx"
args = ["-y", "@anthropic/mcp-server-playwright"]
# Web search capability
[mcp.servers.brave-search]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-brave-search"]
env = { BRAVE_API_KEY = "${BRAVE_API_KEY}" }
# Knowledge memory
[mcp.servers.memory]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-memory"]
Security Best Practices
1. Use Environment Variables
Never hardcode credentials in configuration files:
# Add to ~/.bashrc or ~/.zshrc
export GITHUB_TOKEN="ghp_..."
export DATABASE_URL="postgresql://..."
export BRAVE_API_KEY="..."
Then reference them in config:
env = { GITHUB_PERSONAL_ACCESS_TOKEN = "${GITHUB_TOKEN}" }
2. Limit File System Access
Only grant access to necessary directories:
# Good - specific project directory
args = ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/myproject"]
# Avoid - entire home directory
args = ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me"]
3. Audit Server Permissions
Review what each server can access before installation:
# Check npm package contents
npm info @modelcontextprotocol/server-github
# Review source code on GitHub
# https://github.com/modelcontextprotocol/servers
4. Use Read-Only When Possible
For databases, use read-only connections when you don't need write access:
[mcp.servers.postgres-readonly]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-postgres", "postgresql://readonly_user:pass@host/db"]
Troubleshooting
Server Not Starting
Error: MCP server 'github' failed to start
Solutions:
- Check npm/npx is installed and in PATH
- Verify the package name is correct
- Check environment variables are set
- Try running the command manually to see errors
Authentication Errors
Error: GitHub API authentication failed
Solutions:
- Verify token has required scopes (repo, read:org)
- Check token hasn't expired
- Ensure environment variable is exported
- Try regenerating the token
Connection Timeouts
Error: Database connection timeout
Solutions:
- Verify database server is running
- Check firewall rules
- Confirm connection string is correct
- Test connection with
psqlor other client
Resources
- Official MCP Servers: github.com/modelcontextprotocol/servers
- Awesome MCP Servers: github.com/wong2/awesome-mcp-servers
- MCP Specification: spec.modelcontextprotocol.io
- MCP Server Directory: mcp-awesome.com (1,200+ servers)