Documentation

MCP servers.

Query and change Mode Metrics, send and read mail with Mode Relay, run Mode Promote and ask your agents from any MCP client, with a key you make in the app.

MCP servers

What it is

An MCP server for one project's Mode Metrics. Connect a coding agent, a desktop AI app or an IDE and it can query your data and change your setup with the same tools Mode's own agents use.

MCP, the Model Context Protocol, is the open standard AI apps use to reach outside tools. Any client that speaks it over HTTP can connect. You give it the server's address and a key, or it signs in to Mode with OAuth, and it lists the tools it may use.

SettingValue
Addresshttps://app.gotmode.com/mcp/metrics
TransportStreamable HTTP. Every message is one POST, answered with one JSON object.
Sign inA key that may use Metrics' tools, sent as Authorization: Bearer, or OAuth, where you pick what the client may do
ReachesThe projects the key names, and nothing else
MCP servers

Connect a client

Make an MCP key, then paste one block of config into your client.

  1. Open Metrics, then Setup, and scroll to MCP server
  2. Pick Read only or Read and write, name the key and choose Make an MCP key
  3. Copy the config, which now holds the key, into your client's MCP settings

Owners and admins of the org make MCP keys. The key is shown once, already inside the config. Reload the client and its tool list holds the Mode Metrics tools.

json
{
  "mcpServers": {
    "mode-metrics": {
      "type": "http",
      "url": "https://app.gotmode.com/mcp/metrics",
      "headers": {
        "Authorization": "Bearer YOUR_MCP_KEY"
      }
    }
  }
}

A client that asks for an address and a header takes the address above and Authorization with Bearer and your key.

Connect with OAuth

A client that signs in with OAuth needs only the address. Add https://app.gotmode.com/mcp/metrics, or https://app.gotmode.com/mcp for every product, and the client opens Mode in your browser.

  1. Sign in to Mode if you aren't already. The page names the client as it named itself and where Mode sends you back to
  2. Pick the orgs, what the client may do in each product, the projects and how long it works, the same choices as a personal key
  3. Choose Allow, or Decline to send the client away with nothing

The client gets a personal key of yours, named for it, that never does more than you can do in the app. It is listed under Personal keys on your Account page as a connected app, and revoking it there disconnects the client at once. The client is made by someone other than Mode, so allow only one you trust, since you answer for what it does with the access you give it.

An MCP key is a secret key. Keep it in your client's config on your own machine, never in page source or version control. Revoke it under Keys on the Setup page and it stops working at once.
MCP servers

Keys and access

The server lists the tools the key may use, and nothing else.

KeyWhere to make itCan use
MCP key, read onlyMetrics, Setup, MCP serverThe tools that change nothing, such as queries, lists and reports, on its one project
MCP key, read and writeMetrics, Setup, MCP serverEvery tool, including the ones that create, change and delete, on its one project
Org keyKeysThe tools of what it names for Metrics, Read or Read and change, on the projects it names
Personal keyAccount, Personal keysThe same, acting as you, never more than you can do in the app
Connected appThe client's own OAuth sign in, then Allow on Mode's pageWhat you picked there, acting as you, never more than you can do in the app
  • A read only key does not even list the tools that change something.
  • A key over several projects names the one a call means with project, by name or id. A key over one project runs every call there.
  • Whatever project a call names, it runs on a project the key reaches or is refused. No key reaches an org it doesn't name.
  • One address for every product a key may use is https://app.gotmode.com/mcp, where each tool is named for its product, such as metrics_run_sql.
  • Each call is counted for the key, and the Keys page shows how many it made this month.
  • An ingest key is public and is refused. So is a secret key made for the HTTP API, unless it was also given an MCP scope.
  • A few tools act on your whole org and not on one project. Setting LLM prices, reading your agents' tool audit and making a credential to your data lake are refused to a key. Do those in the app.
  • A key can't hand out more than it holds. Through MCP it makes or rotates a secret key only with what it has itself, and only when it was given Make, rotate and revoke Metrics keys. Make other keys in the app.
MCP servers

Tools

The server lists every tool with its description and arguments, so your client shows the full list. These are the families.

FamilyReadWrite
Queriesrun_sql, sql_schema, run_trend, run_funnel, run_retention, run_paths, run_insight, run_dashboard, explain_query
Sharinglist_shares, get_sharingset_sharing, rotate_share_link, revoke_share_link for a dashboard's or insight's link and embed. Setting visibility to Private immediately revokes both. Sharing again gives a new link and embed code. Each needs the right to share on the project
Definitionslist_definitionscreate_definition, update_definition, delete_definition for insights, dashboards, cohorts, actions and more. A dashboard's tiles may be notes of plain text, each tile has a width and a height, and refresh sets how often its open page runs every tile again. A trend insight's display takes type (line, bar, stacked_bar, area, number, bar_total, pie, table), cumulative, log_scale, percent_stack, show_values, smoothing (1, 7 or 28), unit (number, percent, duration, currency with currency such as USD) and hidden, and a bad one is refused with the key that is wrong
Dashboardsrun_dashboard answers each note in its place beside the insight tilescreate_dashboard_from_template, duplicate_dashboard, copy_dashboard_tile to duplicate, copy or move a tile. Each needs the right to change dashboards
People and sessionsinsight_recordings, person_events, list_cohort_people, list_recordings, get_heatmap, get_clickmapsave_insight_cohort, delete_recording
Cohorts and exportsexport_csvcreate_definition, update_definition
Setuplist_projects, list_sources, list_products, list_keys, get_embed_snippet, page_titlessetup_tracking, configure_source, create_key, rotate_key, revoke_key, set_internal_traffic, set_page_titles
Links and adslist_links, link_stats, goal_attribution, fraud_reportcreate_link, create_pixel, create_conversion_goal, track_conversion
Flags and experimentslist_flags, evaluate_flags, get_experiment_resultscreate_flag, update_flag, create_experiment, update_experiment for fixed or bandit traffic, start_experiment, stop_experiment
Errors, logs and traceslist_issues, search_logs, search_traces, llm_coststriage_issue, upload_source_map
Warehouse and exportslist_warehouse_tables, list_exportscreate_warehouse_source, create_export, run_export
Revenuerevenue_stats, revenue_timeseries, revenue_ltv
Entitiesentities, entity_history
Connected systemssystems_available, connected_systems, system_kept, system_deliveries, system_actions, test_system, suggest_row_eventsconnect_system, set_system, replay_system, sync_system, system_sign_in, disconnect_system, set_system_actions, run_system_action, see Connected systems
Orders from any systemrevenue_sources, revenue_source_kept, test_revenue_mappingconnect_revenue_source, set_revenue_source, reread_revenue_source, import_orders

insight_recordings takes a selection with the effective query and bucket, and returns paged people and sessions with availability and missing reasons. Its search keeps the people whose distinct id or person id holds the text. save_insight_cohort saves its complete bounded membership and requires permission to change definitions. list_recordings also accepts insight_selection. See selection fields, limits, and pagination.

run_sql takes a range (last, or from and to) and a timezone for the statement's {{from}}, {{to}} and {{timezone}}, and variables for any other {{name}} it writes, each a text, a number or {"type": "date", "value": "2026-11-01"}, written in as an escaped literal. sql_schema answers every table it may read with its columns and their types, and the property keys the project's events and people carry. A SQL insight saved with create_definition declares its variables in its query's variables, each with a type and a default, and run_insight takes variables to run it with other values. create_definition and update_definition add an insight to a dashboard in the same call with dashboard (by id or name) or new_dashboard (a new one's name).

A cohort's definition in create_definition and update_definition is groups of criteria joined by all or any, each an event done so many times, not done or done for the first time in the last days, a person property, or being in or out of another cohort, as the API reference lists. A cohort that names itself, however far round, is refused with the names it went through. create_definition of a cohort with copy_of and a name saves who is in that cohort now as a static one, update_definition with add_distinct_ids or remove_distinct_ids alone changes a static one, and export_csv answers the people of a cohort, the project's people or its events as CSV text, at most 10,000 rows, with cut true when there were more.

Every tool takes an optional project. Leave it out, the key already decides the project.

The query tools, run_sql, run_insight, run_metric and run_dashboard answer a kept answer while it is fresh (a minute or a few for a range that includes today, hours for one that has ended) and run it otherwise, the same answers the app shows. Each answer, and each tile of a dashboard, says computed_at and cached. Pass refresh: true to run it now. A refresh asked more than 6 times a minute for one answer comes back kept, with refresh_limited.

Some write tools can't be undone. A tool that deletes something, or revokes or rotates a key, is marked destructive in its description and in the hints your client reads, so a client that asks before destructive calls will ask. Use a read only key when the client only needs to look.

Every change made through MCP is written to your org's audit log like any other change, marked as made over MCP with the key that made it.

MCP servers

Limits and billing

MCP use counts the same as any other use of Mode Metrics. It has no price of its own.

  • A key sends up to 600 requests a minute, shared with the Metrics API when the same key is used for both. Past that the answer is 429 with a Retry-After header in seconds.
  • SQL runs under the same limits as the SQL page and the API. A project runs up to 6 queries at once and one past that waits its turn for up to 5 seconds.
  • What a tool uses, such as export rows or conversions sent, is metered and billed exactly as it is from the app.
  • The org needs a card on file, as for everything paid in Mode. Without one, every tool call is refused. While access to the org is restricted for an overdue payment or a disputed charge, every tool call is refused too, see Failed payments.

A tool call that is refused or fails comes back as a tool result marked as an error, with the reason in error, so your client's model can read it. Where waiting helps it also has a code and retry_after in seconds.

CodeMeans
read_onlyThe key is read only and the tool changes something
card_requiredThe org has no card on file
access_restrictedAccess to the org is restricted because a payment is overdue. An owner pays in Settings, and access is back at once
too_many_queriesThe project already runs 6 queries and this one waited 5 seconds for a turn
store_busyMode is running as many queries as it can right now
quota_exceededThe project ran more queries than it may in a minute or an hour
rate_limitedThe key sent more than 600 requests in a minute, answered as HTTP 429
MCP servers

Every Mode MCP server

Mode Relay, Mode Promote, Mode Agent and your account each have a server of their own, the same shape as Metrics', and one address joins them all.

ServerAddressKeyTools
Mode Metrics/mcp/metricsAn MCP key, or an org key or personal key with MetricsThe Metrics tools above
Mode Relay/mcp/relayAn org key or personal key with Relay at Send and changeSending and what happened to each message, suppressions, senders and reputation, lists, broadcasts and sequences, and inboxes, threads and replies
Mode Promote/mcp/promoteAn org key or personal key with Promote at Read, or Read and changePrograms, rules and tiers, partners and their links, coupons, referrals and commissions, the portal and fraud
Mode Agent/mcp/agentA personal key with Mode Agent, or an API tokenlist_agents, read_agent, ask_agent, read_conversation, list_runs, list_approvals, decide_approvals
Your org/mcp/org, and the older /mcp/accountA personal key with People or Access, or an API tokenlist_people, invite_person as admin, member or viewer, change_member_role, remove_member, set_member_projects, invitations and guests, transfers, and with Access list_roles, create_role, update_role, delete_role, list_grants, give_role, change_grant_role, set_grant_end, take_member_project, get_guardrails, set_guardrails, reset_guardrails, check_access, list_account_keys, create_account_key, update_account_key, rotate_account_key, revoke_account_key, revoke_api_token, get_slack_settings, set_slack_settings, and get_pooled_learning, with set_pooled_learning for an owner's key given it, and for an owner's key that may read billing get_agent_usage and get_billing, read only
Everything a key may use/mcpAny of the aboveEach server's tools, named for their product, such as relay_send_email or agent_ask_agent, and search, which finds any page, setting or record of a project by name, as the search API does
  • Every address is on https://app.gotmode.com and connects with the same config as above, with its own address and key.
  • Relay's and Promote's servers work as Metrics' does. Each lists the tools of Mode's own agents for that product that the key may use, a key with Promote at Read lists the tools that change nothing, a key over several projects names one with project, and each call is counted for the key.
  • A send to many recipients, lifting a suppression a bounce or a complaint wrote, and resuming a paused stream wait for a person, so through MCP they are refused with needs_person. Do them in the app.
  • Payouts and tax forms are read only by a key also given Prepare payouts and read tax forms, the same as through the API. A key never approves, prepares, retries or sends a payout.
  • Billing is read only on every server. get_billing reads the plan, usage, add-ons, spending limits, invoices, the card's brand and last four digits and the org's tax ID for an owner's key. No tool turns on a product or an add-on, sets a limit, changes a card, takes billing over, accepts a transfer of the org or its billing or a project move that starts a fee, or approves a charge or a payout. decide_approvals refuses to approve those. An owner does each signed in to Mode.
  • Mode Agent's server acts as the person who made the key, in one org. A personal key over several orgs names the one it means with the Mode-Org header. A key at Read lists and reads the agents, Message and decide also asks them and decides what they wait on. It never approves an irreversible or high-impact call (erasing a person, shortening retention, lifting a suppression, a send to many recipients, anything that moves money or changes billing) or a call its own message started. Those wait for a person signed in to Mode, see Approvals.
  • ask_agent answers at once with the message's id, as the agents API does. The agent's reply is written after it, read with read_conversation, and what it waits on a person for with read_agent or list_approvals.
  • An org key can't use Mode Agent's server or the org's, since what they do acts as a person.
  • The org's server lists only the tools the key's level holds, and each acts as you, the same as the org API. Mode Agent reads roles, grants, guardrails and keys, checks access and reads the Slack settings and pooled learning for the person who asks it. It changes roles, grants, when a grant ends, guardrails, keys, the Slack settings, and pooled learning only as that person, never past what they may do themself, and each change waits on Approvals until they or an owner approve that exact call.
  • An org without a product reaches nothing of that product's server, and /mcp lists none of its tools.
MCP servers

Protocol details

For anyone writing a client or debugging one.

  • The server speaks MCP revisions 2026-07-28, 2025-11-25, 2025-06-18 and 2025-03-26 on the same address.
  • A 2026-07-28 client sends each request on its own with its version in _meta and in the MCP-Protocol-Version, Mcp-Method and Mcp-Name headers. It can call server/discover, tools/list and tools/call.
  • An older client starts with initialize, then calls tools/list, tools/call and ping.
  • The server keeps no session and opens no event stream. GET and DELETE answer 405.
  • It offers tools only. There are no resources, prompts or subscriptions.
  • Without a valid MCP key the answer is 401, whose WWW-Authenticate header names the server's protected resource metadata. With a secret key that has no MCP scope it is 403. Every other server answers the same, 401 without a key Mode knows and 403 for a key that may not use it.
  • OAuth follows the MCP authorization spec. The metadata is at /.well-known/oauth-protected-resource/mcp/metrics and /.well-known/oauth-authorization-server. Clients register themselves, use the authorization code with PKCE S256 and no client secret, and name the server as the resource. Redirect addresses are https, or http on the loopback address. A code works once, for five minutes. The access token is the personal key, valid until the key ends, with no refresh token. A client can give it back at /oauth/mcp/revoke.
bash
curl https://app.gotmode.com/mcp/metrics \
  -H "Authorization: Bearer $MODE_MCP_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "run_sql", "arguments": {"sql": "SELECT count() FROM events WHERE ts > now() - INTERVAL 1 DAY"}}}'

Let AI run your marketing.

Mode Agent does the daily work. You approve the spend.

Get early access