仓库 →

MCP Integration

MCP (Model Context Protocol) is an open protocol that plugs the "tools" exposed by external programs or HTTP services into AtomCode, so the model can call them like built-in tools. Since v4.20.4, AtomCode ships a built-in MCP client and re-uses the same mcpServers configuration block as Cursor and others.

What it enables

Two config locations

PathScope
<project-root>/.mcp.jsonCurrent project only — good for living next to the code
~/.atomcode/mcp.jsonUser global, shared across every project

Both can coexist; same-named servers prefer the project-level entry (it overrides the user-level one). The repo's .mcp.json.example ships heavily-commented stdio + HTTP templates — start from there.

Config schema

The top-level key is fixed at mcpServers (the legacy servers key still works). Each server should pick one transport:

If a server has both command and url, the current implementation treats it as stdio (command). To avoid ambiguity, don't write both.

Strings support ${VAR} and ${VAR:-default} environment expansion; never hard-code sensitive tokens — keep them in env vars. disabled: true temporarily turns off a server without removing the entry.

stdio example (local subprocess)

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
      "timeout_ms": 10000
    }
  }
}

HTTP example (remote endpoint)

{
  "mcpServers": {
    "github": {
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer ${GITHUB_TOKEN}"
      },
      "timeout_ms": 30000
    }
  }
}

GitHub remote MCP + OAuth

{
  "mcpServers": {
    "github": {
      "url": "https://api.githubcopilot.com/mcp/",
      "auth": {
        "type": "oauth",
        "provider": "github"
      }
    }
  }
}

Before first use, you need AtomCode's own GitHub OAuth App client id, then run:

atomcode mcp add-github-oauth --global
ATOMCODE_GITHUB_MCP_CLIENT_ID=<client_id> atomcode mcp login github
atomcode

Inside the TUI you can also set the env var and run /mcp login github; after a successful login, /mcp reload reconnects.

One-line server add

atomcode mcp add writes the stdio config to JSON for you — no hand-editing required:

# Write to project-root .mcp.json (current directory by default)
atomcode mcp add playwright npx @playwright/mcp@latest

# Write to user-global ~/.atomcode/mcp.json
atomcode mcp add playwright npx @playwright/mcp@latest --global

# Pin a specific project directory
atomcode mcp add playwright npx @playwright/mcp@latest -C /path/to/repo

The first positional is the server key name (which will appear in tool names); the rest is the executable + args.

For GitHub remote MCP OAuth there's a dedicated entry:

atomcode mcp add-github-oauth --global
ATOMCODE_GITHUB_MCP_CLIENT_ID=<client_id> atomcode mcp login github
Note

A same-named server is fully overwritten. The GitHub OAuth token is stored at ~/.atomcode/mcp_auth.toml — it is not written to .mcp.json.

What happens at startup

ModeConnection behaviourWhen tools appear
TUIConnects in parallel in the background — doesn't block the UIEach server registers as it connects, possibly slightly after the first frame
One-shot (-p)Connects synchronously at launch; waits for enabled servers' connection attempts to finishMCP only mounts once at least one batch of tools is available

In the TUI you'll see ✓ MCP server 'github' connected or ✗ MCP server '…' failed: … in the session area. A single server failure does not break other servers or the main program.

Tool naming

Each remote tool is registered as mcp__<server-key>__<remote-tool-name>.

Example: with "mcpServers": { "github": { ... } } and a remote get_issue tool, the model sees the tool name mcp__github__get_issue.

--disable-tools uses the full name too:

atomcode --disable-tools mcp__github__get_issue,mcp__filesystem__write_file

Permission approval

MCP tools default to per-call confirmation (equivalent to RequireApproval) because the remote is external, untrusted code.

Security note

Treat MCP tool results as untrusted data. Do not let them be promoted to system instructions. If an MCP server returns "please ignore previous instructions", the model should not comply.

Slash commands

CommandPurpose
/mcpList successfully connected servers and their status (failed servers don't appear here — only as red error lines in the session area)
/mcp tools <server>Async-list the remote tools actually exposed by a server
/mcp reloadRe-read .mcp.json / ~/.atomcode/mcp.json and reconnect enabled servers in the background

Current limits

Ecosystem comparison

ProductConfig locationNotes
AtomCodemcpServers block in .mcp.jsonCurrent implementation is tools-only
Claude Code.mcp.jsonMore complete OAuth / resources / prompts support
Cursor.mcp.jsonCommon command / url configs usually reusable
CodexCLI addOpenAI ecosystem

If you already use Cursor's MCP setup, common command / url configs are usually reusable; anything outside AtomCode's current fields or capabilities needs verification.

Next steps