MCP (Model Context Protocol) allows AI agents to use external tools and services. 1Code provides full MCP server lifecycle management with a built-in plugin marketplace.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/21st-dev/1code/llms.txt
Use this file to discover all available pages before exploring further.
Why It Matters
AI agents have limited built-in capabilities:- Can’t access databases
- Can’t call external APIs
- Can’t integrate with third-party services
- Can’t use specialized tools
- Query databases (PostgreSQL, MySQL, MongoDB)
- Call APIs (GitHub, Linear, Slack, Stripe)
- Use dev tools (Docker, Kubernetes, AWS CLI)
- Access specialized services (vector DBs, search engines)
What is MCP?
MCP is an open protocol that defines how AI agents communicate with external tools. Architecture:create_issue- Create a GitHub issuelist_pull_requests- List PRs for a repomerge_pull_request- Merge a PR
Installing MCP Servers
From the Plugin Marketplace
Installed servers appear in the MCP Widget in the sidebar.
Manual Installation
For custom servers not in the marketplace: Stdio Servers:src/main/lib/trpc/routers/plugins.ts:175) scans installed plugins and discovers their MCP servers.
MCP Widget
The MCP Widget shows all active servers and their tools.Server List
Each server displays:- Name and icon
- Number of available tools
- Status indicator (connected, failed, needs-auth)
- Expand to see tools
Using Tools
Click any tool to insert an @ mention:src/renderer/features/details-sidebar/sections/mcp-widget.tsx:65) groups tools by server and formats tool names for readability.
Configuring MCP Servers
Server Settings
Each server can have custom configuration: Example: PostgreSQL- Settings → Plugins → Installed
- Click the gear icon next to a server
- Edit JSON configuration
- Save - server restarts automatically
Environment Variables
Servers often need secrets (API keys, passwords). Store them as env vars:.env files from:
- Project root (
.env) - User home (
~/.1code/.env) - System environment
Authentication
Some servers require OAuth or bearer tokens. OAuth Servers: Click “Login” in the server settings to start OAuth flow. Example: Linear- Click “Login” next to Linear server
- Browser opens to Linear’s OAuth page
- Approve permissions
- Return to 1Code - server is now authenticated
Creating Custom MCP Servers
Server Types
- Stdio
- HTTP
Communicates via stdin/stdout. Best for local tools.
Publishing to Marketplace
- Create a plugin package:
- Publish to npm:
- Submit to marketplace:
- Go to https://1code.dev/marketplace/submit
- Enter your package name
- Fill in description, category, tags
- Submit for review
Use Cases
Database Operations
Query PostgreSQL, MySQL, MongoDB directly from chat. No manual SQL needed.
API Integration
Call GitHub, Linear, Slack APIs. Create issues, send messages, deploy code.
Dev Tools
Run Docker commands, deploy to Kubernetes, manage AWS resources.
Custom Workflows
Build company-specific tools. Internal APIs, deployment scripts, etc.
Popular MCP Servers
Official Servers
- @modelcontextprotocol/server-postgres - PostgreSQL queries
- @modelcontextprotocol/server-github - GitHub API
- @modelcontextprotocol/server-slack - Slack messaging
- @modelcontextprotocol/server-google-drive - Google Drive access
Community Servers
- @mcp/linear - Linear issue management
- @mcp/stripe - Stripe payment operations
- @mcp/docker - Docker container management
- @mcp/aws - AWS CLI wrapper
Codex MCP Support
Codex has enhanced MCP support with additional features:Global vs Project Servers
Global Servers: Available to all chats (configured in~/.codex/config.toml).
Project Servers:
Available only to chats in a specific project (configured in <project>/.codex/config.toml).
Codex automatically discovers both and merges them.
MCP CLI
Codex provides a CLI for managing servers:Best Practices
Use Scoped Servers
Install database/API servers per-project, not globally. Prevents accidental access to wrong data.
Version Pin Dependencies
Pin MCP server versions in package.json to avoid breaking changes.
Test Locally First
Before using in chat, test server tools manually with
mcp-cli.Monitor Tool Usage
Check Settings → Debug → MCP Logs to see which tools agents are calling.
Troubleshooting
Server shows 'needs-auth'
Server shows 'needs-auth'
Cause: OAuth or bearer token required.Fix:
- Click “Login” in server settings
- Or add
bearerTokento config - Or set environment variable with token
Server shows 'failed'
Server shows 'failed'
Cause: Server command not found or crashed on startup.Fix:
- Check that the server binary is installed (
which <command>) - View logs in Settings → Debug → MCP Logs
- Try running the command manually to see errors
Tools not appearing in MCP Widget
Tools not appearing in MCP Widget
Cause: Server hasn’t responded yet or no tools registered.Fix:
- Wait 5-10 seconds for server to initialize
- Click “Refresh” in the MCP Widget
- Check server logs for errors
Agent not using MCP tools
Agent not using MCP tools
Cause: Tools not mentioned in prompt or agent chose not to use them.Fix:
- Use @ mentions to hint which tools to use
- Be explicit: “Use the GitHub server to create an issue”
- Check if the server is enabled in settings
Related Features
- Multi-Agent Support - Different agents have different MCP support levels
- Visual UI - MCP tool calls are displayed in the chat UI
- Background Agents - MCP servers work in cloud sandboxes too