Browse docs
On this page

Connect AI agents (MCP)

Let Claude, Cursor, VS Code Copilot and any other MCP client query your logs, dashboards and alert rules, and propose changes for you to approve. Sign in from the agent with OAuth, or use a personal access token.

Connect the agent you already use and it can search your logs, read your dashboards and check your alert rules without you copying anything out of the product. Claude Code, Claude Desktop, Cursor, VS Code Copilot, Codex and any other client that speaks the Model Context Protocol (MCP) work.

Add the server address to your agent and sign in when it asks: you choose which of your workspaces it reaches and what it may do, and nothing else needs setting up. Agents that cannot sign in use a personal access token instead. No add-on is needed, and your agent's own AI model does the reasoning.

What is MCP?

The Model Context Protocol is an open standard for connecting AI agents to other tools and data. A service that supports it runs an MCP server: a list of tools, each with a name, a description and the inputs it takes. ObiStack's server has tools such as "run an ObiQL query" and "list dashboards".

When you ask your agent a question, it reads those descriptions, decides which tools would help, and calls them, often several in a row: look up the fields, write a query, run it, then refine it. Each call runs in ObiStack with your token, and the result goes back to the agent, which answers you in its own words. You see each tool call as it happens, so you can check what was run.

You set this up once per agent. After that, ObiStack is simply something your agent can look things up in.

The server address

https://api.obistack.com/v1/mcp

The server uses MCP's Streamable HTTP transport. An agent authenticates by signing in with OAuth (below), or by sending a personal access token as Authorization: Bearer <token> on every request.

Connect your agent (OAuth)

Most MCP clients can sign in with OAuth. Add the server address with no token, and the client opens ObiStack in your browser the first time it connects:

  1. Sign in to ObiStack if you are not already.
  2. Check the name of the agent asking to connect, and where you will be sent back to.
  3. Choose All my workspaces (the default, including ones you join later) or Chosen workspaces and tick the ones the agent may work in.
  4. Choose Read-only (the default) or Full access (see the scopes below), and click Connect.

Your browser hands the agent a one-time code, and the agent finishes signing in by itself. The agent works in one workspace at a time, as you, with your role and your Data Scopes there. It starts in your default workspace (the one you open when you sign in) when it reaches it, and otherwise asks you which one to use. Ask it to switch at any time.

Claude Code

Shell
claude mcp add --transport http obistack https://api.obistack.com/v1/mcp

Then run /mcp inside Claude Code, choose obistack and sign in.

Cursor

Add this to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json for every project, then click Login beside obistack in Cursor's MCP settings:

JSON
{
  "mcpServers": {
    "obistack": { "url": "https://api.obistack.com/v1/mcp" }
  }
}

VS Code (GitHub Copilot)

Add this to .vscode/mcp.json. VS Code asks you to sign in when the server first starts:

JSON
{
  "servers": {
    "obistack": { "type": "http", "url": "https://api.obistack.com/v1/mcp" }
  }
}

Claude Desktop and claude.ai

Open Settings, Connectors, choose Add custom connector, and paste https://api.obistack.com/v1/mcp as the URL. Claude opens the sign-in page when you connect.

See and revoke connected agents

Open Account (the gear beside sign-out), then Connected agents, to see every agent you connected by signing in: which app, the workspaces it reaches, its access and when it was last used. Click Revoke to disconnect one; it is refused on its next request in every workspace. Connecting and revoking an agent both appear in the activity history of each workspace it reaches.

How the sign-in works

For anyone building an MCP client, the server follows the MCP authorization specification:

  • An unauthenticated request to https://api.obistack.com/v1/mcp gets 401 with a WWW-Authenticate header whose resource_metadata points at https://api.obistack.com/.well-known/oauth-protected-resource/v1/mcp. That names the authorization server, whose metadata is at https://api.obistack.com/.well-known/oauth-authorization-server.
  • Clients register with dynamic client registration at https://api.obistack.com/v1/oauth/register. Only public clients are supported (token_endpoint_auth_method none). A redirect URI must use https, http on localhost, 127.0.0.1 or [::1], or the app's own scheme, and must not have a fragment.
  • The authorization code flow requires PKCE with S256. The scopes are read and write; the person's choice on the consent screen decides, and the token response's scope says which they chose.
  • https://api.obistack.com/v1/oauth/token takes a form-encoded body. The code lasts ten minutes and works once. An access token lasts an hour. A refresh token works once, returns a new pair, and lapses after 90 days without use. A refused or expired access token gets 401 with error="invalid_token".

Connect your agent (access token)

For a client that cannot sign in, create an access token for the agent. Use a user access token if you want the agent to work in more than one of your workspaces:

  1. Open Account (the gear beside sign-out), then User access tokens.
  2. Click + Create token and name it after the agent, such as "Claude Code".
  3. Choose the scope that matches what you want the agent to do (below), which of your workspaces it reaches, and when it expires.
  4. Click Create token and copy it. It is shown only once.

For a single workspace you can instead use a workspace access token, from Preferences, Workspace access tokens. See API Keys for expiry and revoking. Ingest keys and analytics keys are refused.

When the token reaches more than one workspace, the agent starts in your default workspace (the one you open when you sign in) if the token reaches it, and otherwise asks you which one to work in. Ask it to switch at any time. To always use one workspace, add an ObiStack-Workspace header with the workspace's slug to the server's configuration.

  • Read-only lets the agent search logs, read dashboards and alert rules, and test queries. It cannot propose changes. This is the safest choice.
  • Full access also lets the agent propose new or changed dashboards, alert rules, saved searches and data inputs, and silence a rule. Nothing changes until you approve each one in ObiStack. Your role must be able to make changes. See Let the agent make changes.

In the examples below, replace <your-token> with that token.

Claude Code with a token

Shell
claude mcp add --transport http obistack https://api.obistack.com/v1/mcp \
  --header "Authorization: Bearer <your-token>"

Run /mcp inside Claude Code to check that obistack is connected.

Cursor with a token

Add this to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json for every project:

JSON
{
  "mcpServers": {
    "obistack": {
      "url": "https://api.obistack.com/v1/mcp",
      "headers": { "Authorization": "Bearer <your-token>" }
    }
  }
}

VS Code with a token

Add this to .vscode/mcp.json. VS Code asks for the token the first time the server starts and stores it securely:

JSON
{
  "inputs": [
    { "type": "promptString", "id": "obistack-token", "description": "ObiStack personal access token", "password": true }
  ],
  "servers": {
    "obistack": {
      "type": "http",
      "url": "https://api.obistack.com/v1/mcp",
      "headers": { "Authorization": "Bearer ${input:obistack-token}" }
    }
  }
}

Claude Desktop with a token

Claude Desktop reaches remote servers that use a token through the mcp-remote bridge, which needs Node.js. Open Settings, Developer, Edit Config and add:

JSON
{
  "mcpServers": {
    "obistack": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote", "https://api.obistack.com/v1/mcp",
        "--header", "Authorization: Bearer ${OBISTACK_TOKEN}"
      ],
      "env": { "OBISTACK_TOKEN": "<your-token>" }
    }
  }
}

Restart Claude Desktop after saving.

Codex

Set OBISTACK_TOKEN to your token in your shell, then add this to ~/.codex/config.toml:

toml
[mcp_servers.obistack]
url = "https://api.obistack.com/v1/mcp"
bearer_token_env_var = "OBISTACK_TOKEN"

Any other MCP client

Point the client at https://api.obistack.com/v1/mcp as a Streamable HTTP server with an Authorization: Bearer <token> header. To check the connection by hand:

Shell
curl -s https://api.obistack.com/v1/mcp \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Use it

Ask in plain words, the way you would ask a teammate. You do not need to name a tool or write the query: the agent picks the tools it needs and writes the ObiQL itself.

  • Check it is connected. In Claude Code, run /mcp and look for obistack. In other clients, look for ObiStack in the list of connected servers or tools.
  • Be specific when you can. Name the source, service or time range you mean, such as "api.prod.com in the last hour". Without one, the agent starts by looking at which sources and fields you have.
  • Point it at ObiStack when it could look elsewhere. In a code project the agent may answer from your code instead of your logs. Start with "Check ObiStack:" and it will use the tools.
  • Allow the tools. Most agents ask before they use a tool for the first time. The read tools only read, and the create, update, set and silence tools only propose a change for you to approve, so it is safe to always allow them. Keep asking for decide_change: that permission prompt is your check that the agent records the answer you actually gave.
  • Ask follow-ups. The agent keeps what it found, so "now just the 5xx errors" or "show me that as a timechart" builds on the last answer.
  • Check its work. Ask "show me the query you used". Query results include a link that opens the full result in the Explorer.

Example prompts

Copy one into your agent and change the names to your own sources and services. See Use it for how to phrase your own.

Investigate an incident

Prompt
Why did checkout errors spike in the last hour? Show me the query you used.
Prompt
What changed on api.prod.com around 14:05 today? Compare the ten minutes before and after.
Prompt
Find the slowest requests to /v1/orders this morning and tell me what they have in common.
Prompt
Is the payment-worker still logging timeouts, or did they stop after yesterday's deploy?

Explore your data

Prompt
Which sources sent data today, and which have gone quiet?
Prompt
Which services log the most warnings this week?
Prompt
What fields does api.prod.com send? Which ones would be useful to filter on?
Prompt
Break down 5xx responses on api.prod.com by endpoint and status code for the last 24 hours.

Write and check queries

Prompt
Write an ObiQL query for p95 latency by endpoint and check that it runs.
Prompt
Turn this Splunk search into ObiQL:
index=web status>=500 | stats count by host
Prompt
This query returns nothing. Work out why and fix it:
service=checkout level=eror | stats count

Design dashboards and alerts

Prompt
Design a dashboard for my data source api.prod.com: request rate, error rate, p95 latency and the slowest endpoints. Test every panel.
Prompt
Look at my Checkout dashboard. Which panels are slow or empty, and how would you fix them?
Prompt
Suggest an alert for checkout error rate, and backtest it over the last week so I know how often it would have fired.
Prompt
Which alert rules fired yesterday, and what were they watching?

The agent tests a dashboard design against your data, running every panel's query. With a full-access token it can then propose saving it for you to approve. See Let the agent make changes.

Learn ObiStack

Prompt
How do I send logs from a Node.js app? Check the docs and give me the steps.
Prompt
What does | mvexpand do in ObiQL? Show me an example on my data.

Tools

These tools only read. An agent cannot run | delete or query audit data with any token.

ToolWhat it does
get_schemaFields in your data, with their types and how often they appear.
list_sourcesEvery source that has sent data, with its kind and when it was first and last seen.
search_fieldsFinds fields by name across every source in the last 30 days.
run_queryRuns an ObiQL query over a time range and returns the result, with a link that opens it in the Explorer.
list_saved_searchesYour saved queries.
list_dashboards / get_dashboardDashboards and their panels.
preview_dashboardChecks a draft dashboard: validates and runs each panel's query without saving anything.
list_alert_rules / get_alert_ruleAlert rules and their conditions.
get_alert_eventsWhen an alert rule fired.
backtest_alertHow often a rule would have fired over a past window.
list_add_onsThe workspace's add-ons and whether each is on.
list_data_inputsThe data inputs set up in the workspace (checks, ingest keys, polling sources and the rest), with each one's id, kind, status and when it last received an event.
list_notification_groupsThe notification groups in the workspace, with each one's id, how many destinations it has and how many alerts, agents or categories it is attached to.
get_notification_groupOne notification group's destinations and what it is attached to. For Slack, PagerDuty and webhook destinations it shows only the type, never the URL or key.
get_code_overviewCode Observability's headline numbers: repositories reporting, builds today, critical findings with a fix, newly disclosed findings and failing default branches.
list_code_repositories / get_code_repositoryThe repositories that report from CI, with their latest build, build success rate and open findings, and one repository's images, branches and finding counts.
list_code_buildsA repository's CI builds, newest first, filtered by branch or status.
list_code_findingsVulnerabilities, secrets, misconfigurations and licence issues from your CI scans, worst first, with whether a fix exists and where the affected code is running.
list_running_codeWhich builds are running now, on which services and hosts.
search_code_componentsWhich of your images contain a package, optionally within a version range.
search_docs / read_docs_pageThis documentation, including the ObiQL reference, so the agent can check query syntax.

With a full-access token, and a role that can make changes, the agent also gets these. Each one only proposes the change for you to approve:

ToolWhat it proposes
create_dashboard / update_dashboardA new dashboard, private to you, or a change to one you can edit.
create_saved_searchA saved query.
create_alert_rule / update_alert_ruleA new alert rule, or a change to one, including who it emails and which notification groups it notifies.
silence_alert_ruleSilencing a rule for a while.
set_add_onTurning an add-on on or off for the whole workspace. Only a workspace Owner or Admin can approve it.
create_data_inputA new data input: a liveness check, an ingest or application key, or an API polling source that uses an auth profile you already have. A new key's token is never shown to the agent; open the input in ObiStack and use Rotate key to get one.
update_data_inputPausing, resuming, renaming or removing a data input, or setting its description. Removing it keeps the events it already sent.
create_notification_groupA new notification group, optionally with the emails it sends to, and optionally as a default group that every alert notifies. Slack, PagerDuty and webhook destinations are added in ObiStack, since they need a URL or key.
update_notification_groupRenaming a notification group, setting its description, adding emails, removing a destination, attaching it to or detaching it from alerts, agents or whole categories, making it a default group that every alert notifies or no longer one, or deleting it. A group your organization shares can only be attached or detached.
get_change_statusNot a change: tells the agent whether you approved, rejected or have not yet decided a change it proposed.
decide_changeNot a proposal: records the answer you gave the agent, approve or reject, for a change it proposed. Approve makes the change.

Let the agent make changes

Connect with a Full access token, and the agent can propose dashboards, alert rules, saved searches and data inputs, and silence a rule. It never makes a change by itself:

  1. You ask, for example: "Design a dashboard for api.prod.com, test every panel, then save it."

  2. The agent proposes the change. Nothing is saved yet.

  3. If your client supports MCP elicitation, it asks you right there: the prompt shows a summary of the change and a link to the full diff in ObiStack. Choose Approve to make the change, or Reject. The agent gets your answer straight away.

    If your client cannot show that prompt (the Claude Code VS Code extension is one), or you dismiss it, the agent asks you itself, as a multiple-choice question where it can, with the summary and the link to the full diff. It records your answer with decide_change, and your client asks your permission before that call runs.

    You can also open the link in ObiStack, where you see what would change, including a preview of a dashboard's panels, and click Approve or Reject.

  4. The agent learns what you decided and carries on.

You can always open the link and decide in ObiStack instead, even while the prompt is showing; whichever you answer first counts. Only a change proposed with your token can be decided through it, and the agent is told never to decide without your answer. Approval links expire after 24 hours. If a dashboard, rule or data input was edited after the agent proposed a change to it, approving is refused so nothing is overwritten; ask the agent to propose it again. An approved change is limited by your role, as if you made it yourself, and appears in your workspace's activity history.

Agents that can run commands, such as Claude Code, Cursor or Codex, can also make changes directly with the obi CLI, for example obi apply, using the same token in OBI_TOKEN. Those changes do not wait for your approval.

To teach your agent how to set up a project, write alert rules and work an incident in ObiStack, install the Agent Skills.

What the agent can see

  • Only what you can see. Each tool call runs as you, so your role and your Data Scopes apply exactly as they do in the Explorer. An agent reaches only the workspaces you chose for it that you are still a member of, and a workspace token reaches its one workspace.
  • Up to 20 example log lines per query. Aggregates such as counts, rates and percentiles come back in full. Individual log lines are cut to 20 per query, with long values shortened, so results fit in the agent's context. The Explorer link in each result always opens the full result.
  • Your data goes to your agent's model. Results the agent receives are sent to whichever AI provider your agent uses, under your agreement with them.

Limits and usage

  • A query returns at most 200 rows, and each tool result is capped in size. Ask the agent to aggregate (| stats, | timechart) or narrow the time range for large questions.
  • Queries count toward the token's Query API allowance and appear in query usage as API key queries.
  • The server keeps no session data apart from the workspace a user access token chose. It does not push notifications or send sampling requests.

Disconnect an agent

Revoke an agent that signed in from Account, Connected agents. Revoke a token-connected agent's token in Account, User access tokens (or Preferences, Workspace access tokens for a workspace token). The agent is refused on its next request. Leaving a workspace also cuts the agent off from it.

Errors

StatusMeaning
401No bearer token, or the token is invalid, expired or revoked. The WWW-Authenticate header points the client at sign-in.
403The token is not a personal access token. On an approval link: open it in ObiStack while signed in.
405The request was not a POST. The server does not open an event stream.

A tool that fails - an invalid query, an unknown dashboard - returns a normal MCP result with isError: true and a message the agent can act on.