MCP setup
Use this guide when you want to connect an IDE or terminal agent to Swytchcode through MCP. It’s the fastest path to a working setup: install the CLI, sign in, initialize your editor, and confirm your AI client can see Swytchcode’s tools.
Browse the full, up-to-date list of supported APIs at swytchcode.com/apis.
1. Install the CLI
npm install -g swytchcodeirm https://cli.swytchcode.com/install.ps1 | iexcurl -fsSL https://cli.swytchcode.com/install.sh | shUse swy as a shorter alias for swytchcode. Verify the install:
swy --version2. Sign in
swy loginThis is a device-flow browser login that saves your session to ~/.swytchcode/auth.json. Sign in before initializing your editor - fetching integrations and connecting provider accounts through your AI client both need an authenticated session. In CI or headless environments, set the SWYTCHCODE_TOKEN environment variable instead; the CLI reads it only from the process environment, not .env files.
3. Initialize Swytchcode for your editor
swy init --editor=<name> does two things at once: it creates .swytchcode/ and tooling.json for the project, and it registers the MCP server for the editor you pick - as a stdio subprocess, so there’s no daemon or manual URL/port setup for any of the editors below.
swy init --editor=cursorInstalls the rule file at .cursor/rules/swytchcode.mdc and merges the stdio entry into ~/.cursor/mcp.json automatically.
swy mcp serve --claudeRegisters the MCP server with Claude Code so it discovers tools automatically. Claude Code is the one editor this doesn’t handle via swy init --editor=: since its config format isn’t meant to be hand-written, this shells out to the claude CLI (claude mcp add) instead, so you’ll need claude on your PATH.
swy init --editor=windsurfAutomatically merges the stdio entry into ~/.codeium/windsurf/mcp_config.json. If you’d rather configure it by hand, open Settings → MCP Servers and add a new server with command swy mcp serve and transport stdio.
swy init --editor=copilotThis writes .vscode/mcp.json and .github/copilot-instructions.md so Copilot can connect.
swy init --editor=geminiThis writes GEMINI.md and merges the MCP server into ~/.gemini/settings.json so Gemini CLI can connect.
swy init --editor=codexThis writes AGENTS.md and merges the MCP server into ~/.codex/config.toml so Codex can connect.
swy init --editor=hermesThis writes AGENTS.md (shared with Codex) and merges the MCP server into ~/.hermes/config.yaml so Hermes can start it automatically.
swy init --editor=openclawThis writes OPENCLAW.md and merges the MCP server into ~/.openclaw/settings.json so OpenClaw can connect.
Re-running init with a different --editor later is safe - it warns about any orphaned files left over from the previous choice.
4. Other MCP clients
Every editor above is wired up automatically by swy init --editor=<name>. If you’re connecting a different MCP-compatible client, or need a specific transport, run the server directly:
# Standard I/O (recommended for desktop editors)swy mcp serve
# HTTP transport (remote/shared server)swy mcp serve --transport http --port 5476
# Daemon (background) modeswy mcp serve --transport http --port 5476 -dThen point your client at the equivalent of:
{ "mcpServers": { "swytchcode": { "command": "swy", "args": ["mcp", "serve"] } }}5. Confirm the connection
Ask your editor or agent:
Connect GitHub and show me the tools available from the Swytchcode MCP server.If the tools show up and it can list them, the MCP server is wired up correctly. If nothing appears, check that the project you initialized is the one open in your editor and that the CLI is signed in (swy whoami).
Where to go next
Browse all examples →Zoom via MCP
Drives Zoom entirely through Swytchcode as an MCP server in Claude, Cursor, Codex, Copilot, or Windsurf.
MCP Overview
Learn how the built-in MCP server works and how it exposes your trusted tools to AI coding assistants.
CLI Overview
Understand how the Swytchcode CLI manages projects, integrations, authentication, and tool execution behind MCP.
Authentication
Connect your Swytchcode account and securely manage provider credentials for tool execution.
MCP Reference
Explore the complete MCP server configuration, commands, and supported options.