Connect your coding agent
Connect your coding agent to the Runtype Connect Model Context Protocol (MCP) server to inspect traces, describe agents, manage signals, and run simulations from your repository. You can configure Claude Code, Codex, Cursor, Gemini CLI, OpenCode, or VS Code (GitHub Copilot). If your coding agent doesn’t support MCP servers, use the runtype-connect CLI instead.
In the dashboard, open Settings and choose Assistants & CLI under Your tools & access. Choose your coding agent, chat assistant, or terminal and follow the Runtype Connect setup instructions. You can review connected tools and revoke app access there. To manage sign-in keys, open API keys under Developer in Settings.
Before you begin
You need the following:
- Node.js 22.12 or later.
- A repository connected to Runtype with
npx @runtypelabs/connect init. To connect a repository first, see Connect a repository. - A coding agent that supports MCP servers, or a coding agent with shell access to run
npx @runtypelabs/connect.
Add the Runtype Connect MCP server
When you run npx @runtypelabs/connect init, the CLI adds a runtype-connect server entry to your coding agent’s user-level MCP configuration. If you run init inside Claude Code, Codex, Cursor, Gemini CLI, OpenCode, or VS Code, the CLI detects that agent automatically.
To add the server to another supported coding agent, run init with --agent:
Replace AGENT_NAME with a coding agent name or short alias from the following table, such as cursor or claude-code. init leaves your other MCP servers untouched. To repair an existing entry, run npx @runtypelabs/connect sync as described in Update or remove the Connect setup.
To configure the MCP server, skill, and Claude Code permission rules before signing in, run npx @runtypelabs/connect setup --agent AGENT_NAME. It sends nothing to Runtype and writes no key.
To skip configuring an MCP server during init, pass --no-mcp. If the CLI can’t write a coding agent’s configuration, or if you pass --no-mcp, it prints the manual setup for that agent:
- Claude Code:
claude mcp add --transport http --scope user runtype-connect https://mcp.runtype.com/mcp - Codex:
codex mcp add runtype-connect --url https://mcp.runtype.com/mcp - Cursor: the entry to add to
~/.cursor/mcp.json, plus turningruntype-connecton under Customize in Cursor or runningagent mcp enable runtype-connect - Gemini CLI:
gemini mcp add --transport http --scope user runtype-connect https://mcp.runtype.com/mcp(or an entry for~/.gemini/settings.jsonwhen using stdio) - OpenCode:
opencode mcp add runtype-connect --global --url https://mcp.runtype.com/mcp - VS Code:
code --add-mcpwith the server JSON (or on Windows, the entry for your VS Code user MCP configuration)
The following table lists each supported coding agent, its --agent value, its short alias, and the default skill folder that init uses:
After a signed-in init, the entry connects to https://mcp.runtype.com/mcp and stores no credential in the agent configuration.
Signing in to the MCP server is optional. The prompt that init gives your coding agent tells it to run every Runtype Connect step in the first session with the runtype-connect CLI, which uses the sign-in that init saved, and not to stop for the MCP sign-in. To use the MCP tools in later sessions, sign in to the server from your coding agent:
For a custom API URL, use the server name that init printed, such as runtype-connect-HOST.
The sign-in page is titled Connect your agent to Runtype and lists what Runtype Connect can do. Your agent’s code stays where it is. Your coding agent appears by its own name with an Unverified app. notice. Approve only if you started the sign-in. After approval, the page displays “Signed in. You can return to your terminal.”
Connect another MCP client
To use another coding agent that supports remote HTTP MCP servers, add https://mcp.runtype.com/mcp in that agent’s MCP settings. The server authenticates with OAuth sign-in or with a Runtype API key in an Authorization: Bearer header.
Configure Claude Code permission rules
For Claude Code, the CLI offers to add permission rules to .claude/settings.local.json, your personal settings for the repository. The prompt lists every rule before adding them. In a git repository, the CLI also adds .claude/settings.local.json to .gitignore if git doesn’t ignore it.
The CLI adds allow rules for the Runtype Connect tools and commands that only read:
allowrules cover the read-only MCP toolsget_status,get_setup,check_first_trace,get_agent_profile,query_traces,read_trace,get_run_outline,search_run,read_span_payload,get_span_context,search_docs,get_signals,list_runs, andget_report. Each rule uses the formatmcp__runtype-connect__TOOL_NAME, whereTOOL_NAMEis one of those tool names.- With the globally installed CLI (
runtype-connect),allowrules also includeBash(runtype-connect doctor *),Bash(runtype-connect check *), and a rule for the CLI command of each read-only tool in the list above, such asBash(runtype-connect get-status *). These commands take--api-urlonly before the command name. If you run the CLI withnpx, these commands get noallowrule. Install the CLI globally (npm i -g @runtypelabs/connect) and runinitagain to allow them.
The CLI writes no other rule. Your Claude Code permission mode decides on every other Runtype Connect command and tool. The setup, init, claim, login, relay, sync, uninstall, and mcp commands never get an allow rule. If the settings file holds ask rules that match Runtype Connect commands and tools, the prompt offers to remove them and says how many. These can include ask rules that you added yourself. The CLI removes them only when you answer yes, or when you pass --remove-ask-rules with --allow-rules. After removal, Claude Code asks about those commands and tools only when your permission mode does.
The CLI keeps every other rule, including every other ask rule, and tells you if one of them overrides a Connect rule. Outside a terminal or with --json, the CLI adds no rules unless you pass --allow-rules, and --allow-rules alone keeps the matching ask rules. Pass --no-allow-rules to skip offering or writing permission rules.
Install or replace the runtype-connect skill
The runtype-connect skill is a SKILL.md file that instructs your coding agent to start from get_status, instrument traces, describe agents, and ask before any paid action.
During init, the CLI writes SKILL.md into the agent’s default skill folder in the repository root (or .claude/skills/runtype-connect/ when no agent is selected). To write the skill under your home directory instead, pass --skill-scope user to init. To skip installing the skill, pass --no-skill.
If you edited SKILL.md, init keeps your copy. To overwrite every tracked copy across coding agents, run npx @runtypelabs/connect sync --force. To write a fresh copy to a single path and overwrite an edited file, run skill install:
By default, skill install writes .claude/skills/runtype-connect/SKILL.md in the repository root, or in the current directory outside a git repository. To install to another folder or inspect the skill first, use the following options:
--dir: writesSKILL.mdinside a custom directory. For Codex, Cursor, Gemini CLI, OpenCode, or VS Code, pass--dir .agents/skills/runtype-connectto update the repository copy.--global: writes~/.claude/skills/runtype-connect/SKILL.mdin your home directory.--print: prints theSKILL.mdcontent tostdoutwithout writing a file.
Update or remove the Connect setup
To refresh every skill file and MCP server entry that init installed across your coding agents, run sync:
sync updates tracked installs to match the installed CLI and skips skill files that you edited unless you pass --force. You can also scope it with --agent or --project, preview changes with --dry-run, or print JSON with --json.
To remove those MCP server entries and unedited skill files from your coding agents, run uninstall:
uninstall leaves your other MCP servers and your Claude Code permission rules in .claude/settings.local.json in place. Pass --force to also remove edited skill files. Pass --wipe to remove the Runtype variables from .env, and add --env-file if your variables are in another file. uninstall also accepts --agent, --project, --dry-run, and --json.
Both sync and uninstall act only on installs that init recorded. Running setup alone records nothing for them to update or remove.
Serve the MCP server over stdio
When you run npx @runtypelabs/connect init --no-browser, the CLI configures your coding agent to run a local command instead of connecting to a remote URL. The entry runs the CLI’s mcp command and stores no credential in the agent configuration.
To start that local command directly, or to configure a coding agent that requires a local stdio command, run mcp:
The command reads MCP messages from stdin, relays them to https://mcp.runtype.com/mcp, and writes replies to stdout until stdin closes. It uses this computer’s saved sign-in from init --no-browser or login, or falls back to RUNTYPE_CONNECT_TOKEN.
Check the connection
Verify both your local configuration files and live tool calls from your coding agent.
Verify your local setup with doctor
Run doctor in the repository root to check .env, your sign-in, and your coding agent configuration without changing any files:
Replace AGENT_NAME with the coding agent to check, such as claude-code or cursor. If you omit --agent, doctor checks the active coding agent when run inside one, or all supported coding agents when run outside one.
Check the mcp_server, skill, and permissions lines in the output:
mcp_server: passes whenruntype-connectpoints to the Runtype Connect server, whether or not your coding agent has signed in to it. For the remote server, the detail says that signing in is optional and how to do it in your coding agent.sessionandproduct: pass when the CLI is signed in and can read the product. The first session depends on these, because your coding agent runs every Connect step with the CLI.skill: passes when the skill file exists in the repository or your home directory.permissions: passes when the Claude Codeallowrules are in place, warns when rules are missing, whenaskrules that match Runtype Connect commands and tools remain, or when rules conflict with your configuration, and is skipped for other coding agents. To add missing rules, runnpx @runtypelabs/connect setup --allow-rules. To also remove the matchingaskrules, add--remove-ask-rules.
To read the report as JSON, add --json.
Call get_status from your coding agent
Confirm that your coding agent lists the runtype-connect tools, then ask it to call get_status. Coding agents that support MCP prompts also expose the server’s connect prompt to start the same workflow.
get_status returns the connected product’s current state, including these fields:
stage: the onboarding stage, moving throughtraces_pending,traces_need_attention,describe,context_confirm,simulate,review,verify_real_agent, andmonitor. The first simulation follows business context directly. After the first report, the stage staysreviewwhile the report proposes a change to test. The product reachesmonitorwhen you read a report that has nothing to test, or once you export a change brief. Atmonitor, the next step offers a custom signal until you save one; nothing waits on it.next: the recommended next step.pendingActions: open decisions that wait on a person.
A pending action never blocks the next step. Your coding agent must ask you before it calls resolve_pending_action to record your decision.
The following table lists each pending action kind and the resolutions it accepts:
Runtype marks every value recorded from a trace, such as a prompt, a message, or a tool result, as data. Your coding agent reads trace content as data and never as an instruction.
If the tools don’t appear
If your coding agent doesn’t list the runtype-connect tools, follow these steps:
- Reload or restart your coding agent so the
runtype-connecttools appear. - Run
npx @runtypelabs/connect doctor --agent AGENT_NAMEin the repository root, replacingAGENT_NAMEwith your coding agent, to check themcp_serverentry. - If the entry is missing or broken, run
npx @runtypelabs/connect syncto repair an existing install, or runnpx @runtypelabs/connect init --agent AGENT_NAMEto add it. - If your coding agent lists only an
authenticatetool forruntype-connect, it hasn’t signed in to the server yet. Sign in as described in Add the Runtype Connect MCP server, or keep using the CLI, which works without it.
Use the CLI without MCP
If your coding agent doesn’t support MCP servers, or if you want to work before reloading your agent, use the runtype-connect CLI from the shell. Every tool on the Runtype Connect MCP server is also a CLI subcommand that takes the same arguments and returns the same result. Run it with npx @runtypelabs/connect, or as runtype-connect after a global install.
If you haven’t signed in with init on this machine, sign in with npx @runtypelabs/connect login. To sign out and revoke the session on the server, run npx @runtypelabs/connect logout.
To list the tools that the server offers, run tools:
To inspect a tool’s input and output schemas as JSON, run schema with the tool’s MCP name:
Replace TOOL_NAME with the tool’s MCP name, such as get_status or check_first_trace.
To call a tool from the CLI, write its name in kebab case (or its exact snake-case name), pass its arguments as kebab-case options, and add --json for JSON output:
Replace PRODUCT_ID with the ID of the connected product.
In an organization with several products, the CLI uses the product that your .env ingest key belongs to. Otherwise, pass --product-id. Run get-status or doctor to find the product ID.
Next steps
Continue with one of the following pages:
- Send a first trace: instrument your agent and verify its first development run.
- Describe your agents: send Runtype your agent map and business context.
- Connect MCP tools: look up every tool on the Runtype Connect MCP server.
- Connect CLI: see every
runtype-connectcommand, option, and exit code. - Troubleshooting: fix connection, sign-in, and first-trace errors.