MCP Examples
This page contains example configurations for popular MCP servers. Use these as templates for your own ~/.cosine/mcp.json file.
File System Access
Section titled “File System Access”Grant Cosine read/write access to specific directories:
{ "mcpServers": { "documents": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/pz/Documents"] }, "projects": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/pz/projects", "/Users/pz/work"] } }}GitHub Integration
Section titled “GitHub Integration”Connect to GitHub’s API for repository operations:
{ "mcpServers": { "github": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here" } } }}Required Environment Variables
Section titled “Required Environment Variables”| Variable | Description |
|---|---|
GITHUB_PERSONAL_ACCESS_TOKEN | GitHub personal access token with appropriate scopes |
PostgreSQL Database
Section titled “PostgreSQL Database”Query PostgreSQL databases directly:
{ "mcpServers": { "postgres": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:pass@localhost/mydb"] } }}SQLite Database
Section titled “SQLite Database”Access SQLite databases:
{ "mcpServers": { "sqlite": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-sqlite", "/path/to/database.db"] } }}Slack Integration
Section titled “Slack Integration”Send messages and interact with Slack channels:
{ "mcpServers": { "slack": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-slack"], "env": { "SLACK_BOT_TOKEN": "xoxb-your-token", "SLACK_TEAM_ID": "T123456" } } }}Multiple Servers
Section titled “Multiple Servers”Configure multiple MCP servers for different purposes:
{ "mcpServers": { "filesystem": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/pz/projects"] }, "github": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token" } }, "slack": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-slack"], "env": { "SLACK_BOT_TOKEN": "xoxb-your-token", "SLACK_TEAM_ID": "T123456" } } }}Web Search with Brave
Section titled “Web Search with Brave”Enable web search capabilities:
{ "mcpServers": { "brave-search": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-brave-search"], "env": { "BRAVE_API_KEY": "your_brave_api_key" } } }}HTTP Requests with Fetch
Section titled “HTTP Requests with Fetch”Make HTTP requests to any URL:
{ "mcpServers": { "fetch": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-fetch"] } }}Browser Automation with Puppeteer
Section titled “Browser Automation with Puppeteer”Control browsers programmatically:
{ "mcpServers": { "puppeteer": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-puppeteer"] } }}Git Operations
Section titled “Git Operations”Perform Git operations on local repositories:
{ "mcpServers": { "git": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-git"] } }}Using Environment Variable References
Section titled “Using Environment Variable References”For better security, you can reference environment variables in your config:
{ "mcpServers": { "github": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" } }, "postgres": { "transport": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-postgres", "${DATABASE_URL}"] } }}Then export the variables in your shell:
export GITHUB_TOKEN=ghp_your_tokenexport DATABASE_URL=postgresql://user:pass@localhost/mydbcos startRemote MCP Servers
Section titled “Remote MCP Servers”Connect to an MCP server running as a web service:
{ "mcpServers": { "remote-api": { "transport": "streamable", "url": "http://localhost:3000/mcp" } }}This is useful for:
- Connecting to MCP servers running in Docker containers
- Using MCP servers deployed on internal infrastructure
- Developing and testing custom MCP servers
Next Steps
Section titled “Next Steps”- MCP Configuration - Learn about MCP configuration options
- MCP Server Management - Learn about managing and troubleshooting MCP servers
- Building Custom MCP Servers - Create your own integrations