Skip to Content
OpenInspect
Integrations

MCP server

Let Claude, Claude Code, or another MCP client investigate sessions, automation runs, and cost and reliability analytics, and optionally find where to start sessions and start, steer, stop, archive, and rename them, create and run automations, or import skills, signing in with OAuth or using a personal access token.

Last reviewed View as MarkdownEdit on GitHubGive feedback

The OpenInspect MCP server lets an MCP client such as Claude or Claude Code read your sessions, their child sessions, automation runs, and cost and reliability analytics, and optionally find where to start sessions and start, steer, stop, archive, and rename them, create and run automations, or import skills, without opening the web UI. Your control plane serves it at /mcp. A client signs in with OAuth, or uses a personal access token you give it.

Connect with OAuth

Add the server's URL to your client and sign in when it asks. Settings › Access tokens shows the exact URL while MCP clients are allowed, and administrators also find it under Settings › API policy; it is your control plane's URL followed by /mcp.

Settings, API policy: the Allow MCP clients switch with the MCP server's URL, the apps that can sign in, the longest token lifetime, and the permissions tokens may hold
Settings › API policy. The MCP server's URL is under Allow MCP clients.
  • Claude (claude.ai, Desktop, and mobile): add a custom connector with the URL.

  • Claude Code:

    claude mcp add --transport http open-inspect https://<your-control-plane>/mcp

    Then run /mcp in a session and choose to authenticate.

The client opens a page on OpenInspect, where you sign in if you aren't already. The page names the app by the host that serves it, such as claude.ai, with the name the app gives itself, such as Claude Code, and the place it will return you to. Choose what it may do:

  • Read only, the default, lets it read your sessions, automations, skills, and analytics: what the MCP tools read. It cannot change anything.
  • Hand off work also lets it start sessions and send them prompts, on the repositories and environments you can use.
  • Choose permissions picks individual permissions from those your role holds and your workspace allows, including other reads.

Then choose how long the connection lasts, up to your workspace's lifetime cap, and select Allow. The app receives a personal access token with exactly that grant. It appears under Settings › Access tokens named after the app, such as Claude Code (claude.ai), and marked Issued to with the app's host, such as claude.ai. You can revoke it there like any other; whatever is using it then has to sign in again. One app signed in on several devices holds a token for each, so revoke each one you want to stop. Disconnecting the app in the client does not revoke the token; revoke it in Settings. There is no refresh: when the token expires, the app asks you to sign in again.

The token works wherever a personal access token does, not only at /mcp: the app could call the API directly with it, within the same grant.

When a read-only connection tries something it isn't allowed to do, such as sending a prompt, and you could grant it, the client asks you to sign in again for more access, with the extra permissions selected. If you approve within 15 minutes with any write permission, the new token replaces the one that was refused, and the page says which. Choosing Read only replaces nothing. Tokens on your other devices are untouched. If more than one of your devices was refused in that time, OpenInspect cannot tell which one is signing in, so it replaces none of them; revoke the old ones under Settings › Access tokens if you no longer need them.

Only apps your workspace allows can sign in. By default these are Claude's apps; an administrator can change the list under Settings › API policy.

Connect with a token

A client that cannot sign in with OAuth, or a script, can send a token instead:

  1. Create a token under Settings › Access tokens. For investigation, select Read-only. Add write permissions only if you want the assistant to make changes; see the table below.

  2. Register the server with your client, sending the token as a header:

    claude mcp add --transport http open-inspect https://<your-control-plane>/mcp \
      --header "Authorization: Bearer oi_pat_..."

    A client that only runs local servers can reach it through a bridge such as mcp-remote with the same header.

A token you paste is never asked to step up: a tool it lacks the permission for returns an error naming what is missing, and you create a token with more if you need it.

Tools that return a session (create_session, list_sessions, get_session, list_session_children, get_session_child) include a url that opens it in the web app. It is left out when the deployment has no web app URL configured.

The server is stateless: each request stands alone, so a client checks on a session by calling get_session again rather than waiting for a notification. An administrator can turn MCP off under Settings › API policy. Tokens keep working with the API directly, including those apps received by signing in, unless the administrator also turns OAuth sign-in off, which stops those.

Local server (deprecated)

The repository also contains a local stdio server with the same tools, in packages/mcp-server. It will be removed once the hosted server covers everything it does; prefer the hosted URL above. To run it, build it from a checkout and register it:

npm run build -w @open-inspect/shared
npm run build -w @open-inspect/mcp-server
claude mcp add open-inspect \
  --env OPEN_INSPECT_CONTROL_PLANE_URL=https://<your-control-plane> \
  --env OPEN_INSPECT_TOKEN=oi_pat_... \
  -- node /absolute/path/to/packages/mcp-server/dist/index.js

Its control plane URL must use https://; plain http:// is accepted only for a loopback address such as localhost. Set OPEN_INSPECT_WEB_APP_URL to your web app's URL to have it return session links too.

What it can do

ToolNeeds the token to hold
list_sessions, get_session, get_session_events, get_session_messages, get_session_diff, get_session_diff_fileRead sessions
list_session_children, get_session_childRead sessions
list_session_targetsCreate sessions, Read repositories, and Read environments
list_modelsCreate sessions
create_sessionCreate sessions, Read sessions, Collaborate in sessions, and use of its target
send_promptRead sessions and Collaborate in sessions
stop_session, archive_session, unarchive_session, rename_sessionRead sessions and Manage session lifecycle
list_automations, list_automation_invocations, get_automation_runRead automations
list_skillsRead skills
get_cost_analytics, get_reliability_analyticsRead analytics
create_automationCreate automations, Create sessions, and use of its targets
trigger_automationRun your automations or Run any automation, Create sessions, and use of its targets
import_skill_from_git, update_skill_from_gitManage skills (administrators), which always comes with Read skills

list_session_targets lists where a new session can start, as the new-session picker in the web UI offers it: each of your teams with the repositories and environments its sessions can use, and, unless your workspace requires a team, what a session without a team can use. If you belong to no team, it is one list. A team granted every repository says so rather than listing them all again. Each list shows up to 50 entries (up to 200 on request) with how many matched in all, and the whole answer is kept small enough for an MCP client to hold; the assistant narrows a long list with a search term or one team. list_models lists the models enabled for your workspace that a harness can run, with the reasoning efforts each takes. Both need Create sessions, since they read your teams and the model list only to choose where a new session goes. A read-only connection that calls either is asked to step up once, for everything starting a session takes (what Hand off work grants), so finding a target and starting the session there need one sign-in. On a GitLab deployment, both answer that the source control provider is not implemented, as the other tools do.

stop_session ends only the prompt a session is working on, not the session: prompts queued behind it then run, and the session takes new ones. A session with a prompt in progress or queued cannot be archived, so wait for its queue to drain before archiving it; stopping alone does not clear the queue. list_session_children and get_session_child read the child sessions an agent started from a session, including a child's final response and its event history. get_cost_analytics and get_reliability_analytics report the totals, per-day series, and by-source tables of the Analytics Cost and Reliability tabs, for a range of 7, 14, 30, or 90 days and the same Human, Agents, Automations, or All scope, counting only the sessions you can see.

A token without a tool's permission gets an error that names the missing permission, or, where the control plane does not say which one, the permissions the tool needs. A connection made with OAuth is asked to step up instead, when you could grant the permission. The token never exceeds your own role or your workspace's API policy, and no tool can call the routes that delete a session, change who can see it, start, prompt, or cancel a child session, open a session's sandbox editor, terminal, or tunnels, delete or pause an automation, delete a skill, or reach secrets or workspace settings. A run started with trigger_automation uses only what the token was granted, even where your role allows more.

Keep the assistant in check

Session transcripts and diffs are content the agent and your repositories produced, and they go straight into the assistant's context. Treat them as untrusted. Text in a session can try to persuade the assistant to call a write tool, and that call would act with your authority:

  • A session started or prompted this way runs its instructions in a sandbox, as you, straight away. The agent there can run any command the sandbox allows, with that session's secrets and repository access, and can push branches and open pull requests. Withholding the sandbox URLs from a token does not limit this.
  • An automation runs its instructions later, in a sandbox, as you.
  • A skill assigned globally loads into every later session in the workspace.
  • The lifecycle tools reach every session you can manage, not only your own. With Manage session lifecycle, a token can stop, archive, or rename a teammate's session wherever you could in the browser. A session stopped this way loses the prompt it was working on; an archived or renamed one can be restored or renamed back.
  • A workspace owner can see every member's private sessions, so a workspace owner's token with Read sessions and Manage session lifecycle can stop, archive, unarchive, or rename them too. Each such action is recorded in the audit log as the token's, and as a break-glass access to a private session. Administrators' tokens, like administrators, cannot reach private sessions. If you are a workspace owner, issue assistant tokens without Manage session lifecycle unless you want this.
  • A prompt can still have the agent start child sessions from its sandbox, though no tool starts one directly.

A read-only token cannot be talked into writing: the control plane refuses the call whatever the assistant sends. The token's grant is the only limit anything enforces.

The server marks its write tools as not read-only, and many MCP clients ask before running such a tool by default. That marking is a hint, though, and whether you are asked depends on your client's settings: a client set to approve tools automatically runs writes without asking. If you give a token write permissions, check how your client handles write tools, and read what a write is about to create before you approve it.

On this page