Skip to content

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 APIs

This 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

Terminal window
curl -fsSL https://cli.swytchcode.com/install.sh | sh

Windows (PowerShell)

Terminal window
irm https://cli.swytchcode.com/install.ps1 | iex

Verify the installation.

Terminal window
swy --version

2. 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.

Terminal window
swy login

This 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.

Terminal window
cd /path/to/your/project
swy init --editor=cursor --mode=sandbox

Replace 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.

Most desktop AI editors automatically manage the MCP server using standard input and output.

Terminal window
swy mcp serve

This is the recommended option for local development.


HTTP transport

For remote environments or shared servers, run the MCP server over HTTP.

Terminal window
swy mcp serve --transport http --port 5476

This serves over http://127.0.0.1:<port>/sse, localhost-only. HTTP transport requires a bearer token; stdio does not need one.

Terminal window
swy mcp token # print the current token
swy mcp token --rotate # invalidate it and generate a new one

The 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.

Terminal window
swy mcp serve \
--transport http \
--port 5476 \
-d

Daemon 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:

Terminal window
swy mcp serve --profile agent # default: 7 tools, execution only
swy mcp serve --profile full # 14 tools: adds init, bootstrap, get, doctor, plan, and more
  • agent (default) is a focused set for AI agents at task-execution time - discover, info, exec, list, search, add, and policy (read-only). Use this for day-to-day coding assistants that only need to run already-configured tools.
  • full includes everything in agent plus setup and management tools - init, bootstrap, version, get, add_workflow, doctor, and plan. 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

Terminal window
swy init --editor=cursor

Automatically updates:

~/.cursor/mcp.json

Claude Code

Terminal window
swy mcp serve --claude

Automatically registers the Swytchcode MCP server with Claude Code.


Hermes

Terminal window
swy init --editor=hermes

Automatically updates:

~/.hermes/config.yaml

OpenClaw

Terminal window
swy init --editor=openclaw

Automatically updates:

~/.openclaw/settings.json

GitHub Copilot

Terminal window
swy init --editor=copilot

Creates:

.vscode/mcp.json
.github/copilot-instructions.md

Windsurf

Terminal window
swy init --editor=windsurf

Automatically 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.


Gemini CLI

Initialize the project with:

Terminal window
swy init --editor=gemini

Then follow the Gemini CLI quickstart to complete the connection.


Codex

Initialize the project with:

Terminal window
swy init --editor=codex

Then 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.

Terminal window
swy mcp status

You can also inspect the server using the official MCP Inspector.

Terminal window
npx @modelcontextprotocol/inspector ./swy mcp serve

A 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 serve

If 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.