Skip to content

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

Terminal window
npm install -g swytchcode

Use swy as a shorter alias for swytchcode. Verify the install:

Terminal window
swy --version

2. Sign in

Terminal window
swy login

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

Terminal window
swy init --editor=cursor

Installs the rule file at .cursor/rules/swytchcode.mdc and merges the stdio entry into ~/.cursor/mcp.json automatically.

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:

Terminal window
# Standard I/O (recommended for desktop editors)
swy mcp serve
# HTTP transport (remote/shared server)
swy mcp serve --transport http --port 5476
# Daemon (background) mode
swy mcp serve --transport http --port 5476 -d

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