MCP Server
Swytchcode integrates with AI editors and coding assistants through the Model Context Protocol (MCP).
Once connected, your AI client can discover the tools available in your project, inspect their schemas, and execute approved actions through the Swytchcode CLI.
Whether you’re using Cursor, Claude Code, Windsurf, Copilot, Gemini CLI, Codex, Hermes, or OpenClaw, every client communicates with the same Swytchcode MCP server.
What is MCP?
The Model Context Protocol (MCP) is an open standard that allows AI applications to communicate with external tools using a consistent interface.
Instead of an AI generating raw HTTP requests or shell commands, it sends structured requests to an MCP server, which handles tool discovery and execution.
In a Swytchcode project, the CLI acts as the MCP server.
AI Client │ ▼Swytchcode MCP Server │ ▼Swytchcode CLI │ ▼External APIsThis provides the same experience across every supported AI client without requiring editor-specific integrations.
Why Swytchcode uses MCP
Swytchcode uses MCP to provide a consistent, secure, and editor-independent execution layer.
Standardized tool interface
Every supported AI client communicates with the same protocol.
Instead of maintaining different integrations for Cursor, Claude Code, Windsurf, or other editors, Swytchcode exposes a single MCP interface that works everywhere.
Secure execution
Every tool execution passes through the Swytchcode execution engine.
Before an API request is executed, Swytchcode:
- verifies the requested tool
- validates the input
- evaluates project policies
- authenticates the integration
- executes the request
This prevents AI clients from bypassing your project’s execution rules.
Reliable tool discovery
Swytchcode exposes every enabled tool along with its metadata.
Each tool includes:
- Canonical ID
- Description
- Input schema
- Output schema
- Documentation
This allows AI clients to understand what tools are available without guessing API names or parameters.
Works across every supported editor
The same MCP server can be used with:
- Cursor
- Claude Code
- Windsurf
- GitHub Copilot
- Gemini CLI
- Codex
- Hermes
- OpenClaw
Changing editors does not require changing your project configuration.
Set up the MCP server
Before connecting an AI client, install the CLI and initialize your project.
1. Install the Swytchcode CLI
macOS / Linux
curl -fsSL https://cli.swytchcode.com/install.sh | shWindows (PowerShell)
irm https://cli.swytchcode.com/install.ps1 | iexVerify the installation.
swy --version2. Sign in
Authenticate the CLI with your Swytchcode account.
You can sign in through the CLI or use app.swytchcode.com to manage your account in the browser.
swy loginThis opens a browser-based authentication flow and securely stores your credentials for future CLI commands.
Signing in is optional, but required for downloading integrations and using authenticated services.
3. Initialize your project
Navigate to your project and initialize Swytchcode.
cd /path/to/your/project
swy init --editor=cursor --mode=sandboxReplace cursor with your preferred AI client.
Supported editors include:
- Cursor
- Claude Code
- Windsurf
- GitHub Copilot
- Gemini CLI
- Codex
- Hermes
- OpenClaw
During initialization, Swytchcode prepares your project and configures the selected editor when supported.
4. Start the MCP server
Swytchcode supports multiple transport modes depending on your workflow.
Standard I/O (Recommended)
Most desktop AI editors automatically manage the MCP server using standard input and output.
swy mcp serveThis is the recommended option for local development.
HTTP transport
For remote environments or shared servers, run the MCP server over HTTP.
swy mcp serve --transport http --port 5476This serves over http://127.0.0.1:<port>/sse, localhost-only. HTTP transport requires a bearer token; stdio does not need one.
swy mcp token # print the current tokenswy mcp token --rotate # invalidate it and generate a new oneThe token is stored at ~/.swytchcode/mcp_token - pass it in your client’s Authorization header when connecting over HTTP.
Daemon mode
Run the server in the background.
swy mcp serve \ --transport http \ --port 5476 \ -dDaemon mode keeps the MCP server running even after the terminal has been closed.
Tool profiles
The MCP server exposes two sets of tools, selected with --profile:
swy mcp serve --profile agent # default: 7 tools, execution onlyswy mcp serve --profile full # 14 tools: adds init, bootstrap, get, doctor, plan, and moreagent(default) is a focused set for AI agents at task-execution time -discover,info,exec,list,search,add, andpolicy(read-only). Use this for day-to-day coding assistants that only need to run already-configured tools.fullincludes everything inagentplus setup and management tools -init,bootstrap,version,get,add_workflow,doctor, andplan. Use this when you want the AI client itself to be able to install integrations or diagnose the project, not just execute tools.
Each MCP tool maps to an equivalent CLI command. See the MCP Reference for the full tool-by-tool table.
Configure your AI client
Some AI clients can be configured automatically, while others require a small amount of manual setup.
Cursor
swy init --editor=cursorAutomatically updates:
~/.cursor/mcp.jsonClaude Code
swy mcp serve --claudeAutomatically registers the Swytchcode MCP server with Claude Code.
Hermes
swy init --editor=hermesAutomatically updates:
~/.hermes/config.yamlOpenClaw
swy init --editor=openclawAutomatically updates:
~/.openclaw/settings.jsonGitHub Copilot
swy init --editor=copilotCreates:
.vscode/mcp.json
.github/copilot-instructions.mdWindsurf
swy init --editor=windsurfAutomatically merges the stdio entry into:
~/.codeium/windsurf/mcp_config.jsonIf you’d rather configure it by hand, open Settings → MCP Servers and add a new server with command swy mcp serve and transport stdio.
Gemini CLI
Initialize the project with:
swy init --editor=geminiThen follow the Gemini CLI quickstart to complete the connection.
Codex
Initialize the project with:
swy init --editor=codexThen complete the remaining setup using the Codex quickstart.
Verify the connection
After the MCP server is running, verify that your AI client can communicate with Swytchcode.
If you’re using daemon mode, check the server status.
swy mcp statusYou can also inspect the server using the official MCP Inspector.
npx @modelcontextprotocol/inspector ./swy mcp serveA successful connection means your AI client can:
- Discover available tools
- Inspect tool schemas
- Execute enabled methods
- Execute workflows
- Receive structured responses
Troubleshooting
No tools appear in the AI client
Verify that:
- The MCP server is running.
- The project has enabled tools.
- The correct project directory is open.
- The CLI is authenticated.
Unable to connect to the MCP server
Check that the configured command is:
swy mcp serveIf you’re using HTTP transport, verify that the configured port matches the running server.
Tool execution fails
If the AI client can connect but tool execution fails:
- Confirm the integration has been authenticated.
- Verify that the tool has been added to your project.
- Check the CLI output for validation or policy errors.
Your AI coding assistant is now connected to Swytchcode and ready to discover and execute trusted tools.
Related Pages
Browse all examples →Zoom via MCP
Drives Zoom entirely through Swytchcode as an MCP server in Claude, Cursor, Codex, Copilot, or Windsurf.
MCP Reference
Explore the complete MCP configuration, commands, and server options.
Policy Rules
Define custom policies to control when and how tools are allowed to execute.
Retries
Learn how Swytchcode automatically retries transient failures for reliable API execution.
Idempotency
Prevent duplicate operations by safely handling retries for mutating API requests.