Codevisor Docs

MCP Servers

Manage the MCP servers behind Codevisor plugins and import harness-native servers.

Codevisor Server provides one Model Context Protocol gateway to agent sessions. The gateway combines Codevisor tools, Browser Use, Computer Use, and every enabled plugin. Each plugin is a managed MCP server row on /v1/mcps. Clients manage the list; they do not pass upstream credentials to individual agent harnesses.

Managed and native servers

Managed MCP servers are stored by Codevisor and can use HTTP or stdio. Codevisor owns their connection state, authorization, tool discovery, and per-project or per-session visibility. A server installed from the plugin catalog carries a catalogId and catalogVersion; Codevisor resolves its command or URL from the bundled catalog on each machine. A server added by hand has neither.

Native MCP servers already exist in a harness configuration file. A scan groups them by harness and coalesces equivalent entries into import candidates. The client sends only candidate identities when importing; Codevisor rereads values and secrets on the server machine.

Project-file MCP entries are read-only. For harnesses whose global format is safely writable, Codevisor can toggle or remove entries. It creates a one-time backup before the first edit, stores removed fragments, and exposes a restore action.

Add a managed server

Install a catalog plugin with POST /v1/plugins/catalog/{id}/install, using an id from GET /v1/plugins/catalog. The response is the new managed server.

Create a custom HTTP server:

POST /v1/mcps
Content-Type: application/json

{
  "name": "Issues",
  "transport": "http",
  "url": "https://mcp.example.com/mcp",
  "authType": "bearer",
  "bearerToken": "secret"
}

Or start a local stdio server on the Codevisor machine:

{
  "name": "Local tools",
  "transport": "stdio",
  "command": "npx",
  "args": ["-y", "@acme/mcp-server"],
  "env": { "ACME_TOKEN": "secret" }
}

HTTP servers support none, bearer, and oauth authorization. Stdio servers do not accept those authorization fields; put process credentials in env. Server responses expose only environment and header names, never their values.

MCP secrets are encrypted at rest with AES-256-GCM. Codevisor creates a machine-local key named mcp-secret-key in the data directory. A deployment may instead set CODEVISOR_MCP_SECRET_KEY to a base64-encoded 32-byte key. Back up the key with the database: encrypted credentials cannot be recovered without it.

Connect and authorize

POST /v1/mcps/detect-auth probes an HTTP URL and returns the detected authorization type. After a server is created or edited:

  • POST /v1/mcps/{id}/connect reconnects it and refreshes its tool catalog.
  • GET /v1/mcps/{id}/tools returns the tools currently exposed.
  • POST /v1/mcps/{id}/oauth-start returns an authorization URL.
  • POST /v1/mcps/{id}/oauth-disconnect clears OAuth tokens and disables the server.

The OAuth callback and completion routes are browser-flow transports, not general client APIs. A client should open the returned authorization URL and then refresh GET /v1/mcps until the server becomes connected.

connectionState is one of disconnected, connecting, connected, needsSetup, unavailable, needsAuthorization, expired, or error. Display the optional detail when present.

Scope tools

The enabled value on the managed server is the machine-wide switch. Project and session settings can further disable it:

PATCH /v1/projects/{projectId}/mcps/{mcpId}
Content-Type: application/json

{ "enabled": false }
PATCH /v1/sessions/{sessionId}/mcps/{mcpId}
Content-Type: application/json

{ "enabled": false }

The session setting is the narrowest scope. Effective availability is the machine setting AND the project setting AND the session setting; a narrower scope cannot enable a machine-disabled server. Both scope mutations return the resolved MCP list for that context.

Connect an MCP client from outside Codevisor

Any MCP client on the machine, such as Grok Build, Claude Desktop, or Cursor, can use the same gateway the agents in Codevisor get: the execute and skills tools, with Codevisor's agents, bots, machines, Browser Use, Computer Use, plugins, and skills behind them. Add Codevisor as a local stdio MCP server that runs:

codevisor mcp

For example, with Grok Build:

grok mcp add codevisor -- codevisor mcp

The Mac app installs the command at ~/.local/bin/codevisor; give a client that full path when it doesn't search that folder. Pass --project <name or id> to include that project's plugins and skills and to make agents.start default to it. Pass --port when the server doesn't use its usual port.

An outside client has no Codevisor chat, so it doesn't receive hidden event messages. It follows the agents it starts with agents.wait and agents.status, and background jobs with jobs.wait. agents.start needs harness (from harnesses.list) and, without --project, a project or checkout: "none". The connection reconnects by itself when the Codevisor server restarts.

To have an agent outside Codevisor install the server and connect itself, point it at codevisor.dev/SKILL.md. It covers installing, signing the machine in, adding the gateway, and delegating work to agents.

codevisor mcp opens its gateway with POST /v1/mcp-gateways. Any process that can run it has the same access as the connection token that codevisor token prints.

Import harness-native MCPs

  1. Call GET /v1/native-mcps and present its candidates and per-harness scan results.
  2. Send selected candidate identity values to POST /v1/native-mcps/import.
  3. Review each outcome. It is imported, skipped, or failed and can carry warnings.

An import may warn when a secret contains an unexpanded shell-variable placeholder or when the authorization probe cannot reach the server. Imported entries do not automatically remove the original harness-native entries.

Use the supportsDisable and supportsRemove flags from the scan before offering native edit actions. Removal and restoration use /v1/native-mcps/remove, /v1/native-mcps/removals, and /v1/native-mcps/removals/{id}/restore.

The API reference contains the request and response schemas for all managed, native, and scoped MCP routes.

On this page