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.
What is MCP?
The Model Context Protocol (MCP) lets you connect external tools and services to your AI agents. Think of it as a plugin system that gives agents superpowers:- Query databases
- Search documentation
- Access APIs
- Read cloud resources
- Execute custom tools
MCP Architecture
How it works:- You configure MCP servers in 1Code settings
- Servers expose “tools” the agent can call
- Agent decides when to use which tools
- Tools execute and return results
- Agent uses results to accomplish tasks
Finding MCP Servers
Built-in Plugin Marketplace
1Code includes a curated marketplace of popular MCP servers:Browse plugins
Click Add Server > Browse MarketplacePopular plugins:
- GitHub: Query issues, PRs, code search
- PostgreSQL: Execute SQL queries
- Filesystem: Read/write files with permission controls
- Brave Search: Web search for documentation
- Puppeteer: Browser automation
Community Servers
Explore community-created servers:- Awesome MCP Servers
- MCP Server Registry
- NPM packages tagged
mcp-server - GitHub repos with
mcp-servertopic
Adding MCP Servers
Stdio Servers (Local Processes)
Most MCP servers run as local processes communicating via stdio:Choose agent
Select which agent can use this server:
- Claude Code: For Claude-specific tools
- Codex: For Codex-specific tools
- Both: Available to all agents
Configure connection
Enter the command to start the server:Example: NPM packageExample: Python script
Set scope
Choose when the server is available:
- Global: Always available
- Project-specific: Only for specific repositories
HTTP/SSE Servers (Remote)
Some servers run as HTTP services:Configuring Common Servers
GitHub MCP Server
Query repositories, issues, and pull requests:- Go to GitHub Settings > Developer settings > Personal access tokens
- Generate new token (classic)
- Grant scopes:
repo,read:org,read:user - Copy token to 1Code settings
search_repositoriessearch_codesearch_issuesget_file_contentscreate_issuecreate_pull_request
PostgreSQL MCP Server
Execute SQL queries from chat:query: Execute SELECT queriesexecute: Run INSERT/UPDATE/DELETEdescribe_table: Get table schemalist_tables: List all tables
Filesystem MCP Server
Safe file system access with permissions:read_file: Read file contentswrite_file: Write to fileslist_directory: List directory contentssearch_files: Find files by pattern
Brave Search MCP Server
Web search for finding documentation:- Visit brave.com/search/api
- Sign up for free tier (2000 queries/month)
- Copy API key to 1Code
brave_web_search: General web searchbrave_local_search: Location-based search
Managing MCP Servers
Viewing Connected Servers
The MCP settings panel shows all configured servers:- Status indicator: Green (connected), Red (failed), Yellow (needs auth)
- Tool count: How many tools the server exposes
- Last used: When the agent last called this server
- Scope: Global or project-specific
Enabling/Disabling Servers
Toggle servers on/off without deleting:- Find the server in settings
- Click the toggle switch
- Server starts/stops immediately
- Disabled servers don’t appear to agents
- Temporarily disable expensive API servers
- Turn off servers for specific projects
- Debug issues by eliminating servers
Editing Server Configuration
- Click the server name in settings
- Modify connection details, env vars, or scope
- Click Save
- Server reconnects with new configuration
Deleting Servers
- Click the three-dot menu on the server card
- Select Delete
- Confirm deletion
- Server is removed immediately
Using MCP Servers in Chat
Automatic Tool Usage
Agents automatically use MCP tools when relevant: Example:Explicit Tool Mentions
Mention MCP servers explicitly with@:
Tool Call Display
MCP tool calls appear as expandable cards:- Tool name: Which tool was called
- Input: Arguments passed to the tool
- Output: Formatted results
- Timing: How long the call took
MCP Server Development
Create your own MCP servers to expose custom tools:Quick Start
server.ts
Adding to 1Code
Once your server is ready:- Package as NPM module or standalone script
- Add to 1Code via Settings > MCP Servers
- Test with your agent
- Share with the community!
Security and Permissions
Best Practices
Least Privilege
Grant MCP servers only the permissions they need. Use read-only tokens when possible.
Scope Appropriately
Use project-specific scoping to limit server access to relevant repositories.
Audit Tools
Review what tools a server exposes before enabling it for agents.
Rotate Credentials
Regularly rotate API keys and tokens used by MCP servers.
Authentication Flows
Some MCP servers need OAuth authentication:- Add server with OAuth config
- Click Authenticate in settings
- Browser opens to provider’s auth page
- Grant required permissions
- Redirected back to 1Code
- Server connects automatically
- GitHub
- Microsoft
- Slack
- Linear
Troubleshooting
Server shows 'failed' status
Server shows 'failed' status
Check:
- Command is correct and executable is in PATH
- Environment variables are set properly
- Required API keys are valid
- Network access for HTTP servers
- Click server > View Logs to see error messages
- Test command manually in terminal
- Verify dependencies are installed (
npxfor NPM servers)
Tools not appearing in agent
Tools not appearing in agent
Cause: Server might be disabled or scoped incorrectly.Solution:
- Verify server is enabled (toggle is on)
- Check scope matches your current project
- Restart the chat to refresh tool list
- Try mentioning the server explicitly with
@servername
Authentication errors
Authentication errors
Cause: Expired tokens or incorrect credentials.Solution:
- Click Logout then Authenticate again
- Regenerate API keys in the service’s settings
- Update environment variables in server config
- Check token has required scopes/permissions
Tool calls timing out
Tool calls timing out
Cause: Server is slow or external API is down.Solution:
- Check server logs for performance issues
- Verify external APIs are reachable
- Increase timeout in server config if needed
- Consider caching for frequently called tools
Server won't start (Windows)
Server won't start (Windows)
Cause: Windows path or shell issues.Solution:
- Use full paths:
C:\\Program Files\\nodejs\\npx.cmd - Set shell explicitly in config:
"shell": "cmd.exe" - Check Windows Defender isn’t blocking execution
- Run 1Code as administrator if needed
Next Steps
Custom Models
Configure custom AI models that work with your MCP servers.
Automations
Trigger agents with MCP tools automatically from external events.
Skills
Create custom skills that bundle MCP servers with prompts.
MCP Docs
Learn more about MCP protocol and server development.