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.
| Setting | Value |
|---|---|
| Address | https://app.gotmode.com/mcp/metrics |
| Transport | Streamable HTTP. Every message is one POST, answered with one JSON object. |
| Sign in | A key that may use Metrics' tools, sent as Authorization: Bearer, or OAuth, where you pick what the client may do |
| Reaches | The projects the key names, and nothing else |
Connect a client
Make an MCP key, then paste one block of config into your client.
- Open Metrics, then Setup, and scroll to MCP server
- Pick Read only or Read and write, name the key and choose Make an MCP key
- 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.
{
"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.
- 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
- 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
- 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.
Keys and access
The server lists the tools the key may use, and nothing else.
| Key | Where to make it | Can use |
|---|---|---|
| MCP key, read only | Metrics, Setup, MCP server | The tools that change nothing, such as queries, lists and reports, on its one project |
| MCP key, read and write | Metrics, Setup, MCP server | Every tool, including the ones that create, change and delete, on its one project |
| Org key | Keys | The tools of what it names for Metrics, Read or Read and change, on the projects it names |
| Personal key | Account, Personal keys | The same, acting as you, never more than you can do in the app |
| Connected app | The client's own OAuth sign in, then Allow on Mode's page | What 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 asmetrics_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.
Tools
The server lists every tool with its description and arguments, so your client shows the full list. These are the families.
| Family | Read | Write |
|---|---|---|
| Queries | run_sql, sql_schema, run_trend, run_funnel, run_retention, run_paths, run_insight, run_dashboard, explain_query | |
| Sharing | list_shares, get_sharing | set_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 |
| Definitions | list_definitions | create_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 |
| Dashboards | run_dashboard answers each note in its place beside the insight tiles | create_dashboard_from_template, duplicate_dashboard, copy_dashboard_tile to duplicate, copy or move a tile. Each needs the right to change dashboards |
| People and sessions | insight_recordings, person_events, list_cohort_people, list_recordings, get_heatmap, get_clickmap | save_insight_cohort, delete_recording |
| Cohorts and exports | export_csv | create_definition, update_definition |
| Setup | list_projects, list_sources, list_products, list_keys, get_embed_snippet, page_titles | setup_tracking, configure_source, create_key, rotate_key, revoke_key, set_internal_traffic, set_page_titles |
| Links and ads | list_links, link_stats, goal_attribution, fraud_report | create_link, create_pixel, create_conversion_goal, track_conversion |
| Flags and experiments | list_flags, evaluate_flags, get_experiment_results | create_flag, update_flag, create_experiment, update_experiment for fixed or bandit traffic, start_experiment, stop_experiment |
| Errors, logs and traces | list_issues, search_logs, search_traces, llm_costs | triage_issue, upload_source_map |
| Warehouse and exports | list_warehouse_tables, list_exports | create_warehouse_source, create_export, run_export |
| Revenue | revenue_stats, revenue_timeseries, revenue_ltv | |
| Entities | entities, entity_history | |
| Connected systems | systems_available, connected_systems, system_kept, system_deliveries, system_actions, test_system, suggest_row_events | connect_system, set_system, replay_system, sync_system, system_sign_in, disconnect_system, set_system_actions, run_system_action, see Connected systems |
| Orders from any system | revenue_sources, revenue_source_kept, test_revenue_mapping | connect_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.
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.
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
429with aRetry-Afterheader 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.
| Code | Means |
|---|---|
read_only | The key is read only and the tool changes something |
card_required | The org has no card on file |
access_restricted | Access to the org is restricted because a payment is overdue. An owner pays in Settings, and access is back at once |
too_many_queries | The project already runs 6 queries and this one waited 5 seconds for a turn |
store_busy | Mode is running as many queries as it can right now |
quota_exceeded | The project ran more queries than it may in a minute or an hour |
rate_limited | The key sent more than 600 requests in a minute, answered as HTTP 429 |
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.
| Server | Address | Key | Tools |
|---|---|---|---|
| Mode Metrics | /mcp/metrics | An MCP key, or an org key or personal key with Metrics | The Metrics tools above |
| Mode Relay | /mcp/relay | An org key or personal key with Relay at Send and change | Sending and what happened to each message, suppressions, senders and reputation, lists, broadcasts and sequences, and inboxes, threads and replies |
| Mode Promote | /mcp/promote | An org key or personal key with Promote at Read, or Read and change | Programs, rules and tiers, partners and their links, coupons, referrals and commissions, the portal and fraud |
| Mode Agent | /mcp/agent | A personal key with Mode Agent, or an API token | list_agents, read_agent, ask_agent, read_conversation, list_runs, list_approvals, decide_approvals |
| Your org | /mcp/org, and the older /mcp/account | A personal key with People or Access, or an API token | list_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 | /mcp | Any of the above | Each 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.comand 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_billingreads 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_approvalsrefuses 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-Orgheader. 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_agentanswers at once with the message's id, as the agents API does. The agent's reply is written after it, read withread_conversation, and what it waits on a person for withread_agentorlist_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
/mcplists none of its tools.
Protocol details
For anyone writing a client or debugging one.
- The server speaks MCP revisions
2026-07-28,2025-11-25,2025-06-18and2025-03-26on the same address. - A
2026-07-28client sends each request on its own with its version in_metaand in theMCP-Protocol-Version,Mcp-MethodandMcp-Nameheaders. It can callserver/discover,tools/listandtools/call. - An older client starts with
initialize, then callstools/list,tools/callandping. - The server keeps no session and opens no event stream.
GETandDELETEanswer405. - It offers tools only. There are no resources, prompts or subscriptions.
- Without a valid MCP key the answer is
401, whoseWWW-Authenticateheader names the server's protected resource metadata. With a secret key that has no MCP scope it is403. Every other server answers the same,401without a key Mode knows and403for a key that may not use it. - OAuth follows the MCP authorization spec. The metadata is at
/.well-known/oauth-protected-resource/mcp/metricsand/.well-known/oauth-authorization-server. Clients register themselves, use the authorization code with PKCES256and no client secret, and name the server as theresource. Redirect addresses arehttps, orhttpon 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.
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"}}}'