MIA · MCP documentation

MIA MCP server

A remote Model Context Protocol server that lets an AI assistant query your MIA data through the MIA GraphQL API. Read-only, signed in as you.

https://mcp.mia.tech

Connect

Add the server URL to your assistant. The first call opens MIA's sign-in in your browser: sign in with your MIA account and approve the connection. There is no API key to paste, store or rotate.

claude.ai / ChatGPT · add a custom connector with this URL

https://mcp.mia.tech

Claude Code · terminal

claude mcp add --transport http mia https://mcp.mia.tech

Claude Desktop · claude_desktop_config.json

{
  "mcpServers": {
    "mia": { "type": "http", "url": "https://mcp.mia.tech" }
  }
}

Cursor · .cursor/mcp.json

{
  "mcpServers": {
    "mia": { "url": "https://mcp.mia.tech" }
  }
}

Any client that supports remote MCP servers over Streamable HTTP with OAuth works the same way. Clients set up with the older https://mcp.mia.tech/mcp keep working. In Claude Code, run /mcp or start a new session after adding it so the tools load.

How an agent works

Five stateless tools, read in order: Explore → Describe → Run, with mcp_status on demand and give_feedback to report a problem. The server remembers nothing between calls, so an agent may start at any tool. explore_mcp, describe_entity and mcp_status carry next_steps, a list of suggested calls.

  1. explore_mcp to see which entities your account holds.
  2. describe_entity("MediaSpot") to get its resolvers, fields and examples.
  3. run_query with a query built from those fields:
query {
  mediaSpots(first: 3) {
    edges { node { id cost } }
    totalCount
  }
}

Entities come in four families: own (your campaigns, traffic and results), competitive (the market), social and news. The catalog lists only what your account can query.

Tools

All five are read-only.

explore_mcp

Explore MIA

explore_mcp(family="all", search=None)

The map. Who you are, your account and its clients, the credits you have left, the query guide, the input types every query shares, and every entity you can query grouped by family.

ArgumentTypeNotes
family"all" | "own" | "competitive" | "social" | "news" | "nested"Narrows the entity list. nested lists the shared object types rows point to (Brand, Calendar, …).
searchstring | nullWords matched against field names and descriptions. Adds up to 30 field_hits. Agents are told to search first when a term in the question is not obviously an entity name (a metric such as "score" or "FTD").

Returns

{ schema_version, user, account, credits, guide, shared_types, entities, field_hits?, warnings?, next_steps }

describe_entity

Describe entity

describe_entity(name, full=False)

How to query one entity: its single, list and grouped resolvers, the fields worth selecting first, every field of its rows and of its grouped rows on one line each (name, type and the first line of its description), one example query per resolver and related entities in other families. With full it also returns the GraphQL schema slice the entity needs, nested types included, and every other example.

ArgumentTypeNotes
namestringAn entity name from explore_mcp, case-insensitive. An unknown name returns unknown_entity with the 3 closest names.
fullbooleanAdds the descriptions to schema, and more_examples. Default false.

Returns

{ entity, family, scope, resolvers, key_fields, fields: { row, grouped }, examples, full, schema, more_examples?, note?, alternatives, next_steps }

run_query

Run GQL query

run_query(query, variables=None, format="json", export_url=False)

Runs a read-only GraphQL query as you and returns MIA's GraphQL response unchanged. Partial results keep their data next to the errors. Each response reports the credits it spent.

With format="csv" the rows come as CSV text, one per root field, in extensions.csv and there is no data. With export_url=true MIA writes one file per root field and returns its download link in extensions.exports instead of the rows. An answer with errors, or whose file could not be written (an export_failed warning), keeps its rows in data instead. Anyone who has an export link can download the file, and the link stops working at url_expires_on, about 24 hours later.

ArgumentTypeNotes
querystringA GraphQL query document. Mutations and subscriptions are refused.
variablesobject | nullGraphQL variables.
format"json" | "csv"How the rows come back. Default "json".
export_urlbooleanA download link per root field instead of the rows. Default false.

Returns

{ data?, errors?, extensions: { credits: { spent, remaining, cycle_end }, warnings?, csv?: { alias: text }, exports?: [{ alias, url, format, rows, columns: [{ name, type }], url_expires_on }] } }

mcp_status

MCP status

mcp_status()

Whether MIA is reachable, and this cycle's credit usage with a day-by-day series for the last 31 days. Also returns the link where you manage your connections.

Returns

{ reachable, latency_ms, credits: { used, limit, remaining, scope, cycle_end, limiting_factor, limit_reached, daily }, manage_connections_url, next_steps }

give_feedback

Give feedback

give_feedback(intent, tried, stuck, tool_name, expected=None)

Reports a problem you hit with this server so it gets fixed: a tool that failed unexpectedly, returned something confusing or wrong, lacked a capability you needed, forced a workaround, or whose description was misleading. It only records the report: it does not query MIA and spends no credits. Do not include tokens or personal data. Limited to 20 reports per hour.

ArgumentTypeNotes
intentstringWhat you were trying to achieve for the user. At most 2,000 characters.
triedstringThe calls and arguments you used, and what came back. At most 2,000 characters.
stuckstringWhere it went wrong: the error, the confusing output, the missing tool, the misleading description. At most 2,000 characters.
tool_namestringThe tool the report is about; none when no tool covers it. At most 2,000 characters.
expectedstring | nullWhat you expected to happen or to find. At most 2,000 characters.

Returns

{ success, id }  |  { success: false, error, retry_after_seconds }

Prompts

Tools are called by the model; prompts are started by you. Clients show them as slash commands or in the connector menu. In Claude Code, with the server added as mia, usage is /mcp__mia__usage.

usage
This cycle's credit consumption: used, limit, what is left, which ceiling applies, and the daily series.
build_query(question)
Turns a plain-language question into a working query, using the catalog instead of guessed field names.
period_performance(days=7, brand?)
The last N days against the N before, over the metrics your account actually has.
explore_entity(entity)
What one entity holds, which fields can be filtered, and one small query that works.

Errors and warnings

run_query reports problems in the standard GraphQL shape, each with a code in errors[].extensions.code. Connection and limit failures use the same shape.

{ "errors": [{ "message": "…", "path": ["mediaSpots"], "extensions": { "code": "unknown_field" } }] }
unknown_resolver, unknown_field, invalid_filter, orderby_not_selected, invalid_groupby
The query does not match the schema. Call describe_entity, fix it and run again.
invalid_argument
A wrong or missing argument value: currency, id, type or enum.
invalid_query
Syntax error, a mutation or subscription, several operations, or another document error.
limit_exceeded
The query is too long, too deep or uses too many aliases. Narrow it.
credits_exhausted, user_credit_limit_reached
The account's credits, or your own cap, are used up. Call mcp_status.
auth_invalid
The connection is no longer valid. Reconnect and sign in again.
rate_limited
Too many queries in a minute. Carries retry_after_seconds. This is not a credit limit.
backend_unreachable, backend_error
MIA could not be reached or answered unreadably. Retry, or call mcp_status.

Warnings arrive in extensions.warnings as {code, text, path}, next to a successful answer:

own_brands_only
Your own data holds your brands only. The warning names the competitive entity that holds the others.
default_currency_usd
A money field was selected without a currency, so results are in USD.
credits_low
10 credits or fewer remain after the query.

Credits and limits

  • Queries spend credits from your account's pool, shared by every member. An account manager can also set a cap per member. Every run_query response reports what it spent and what is left.
  • Credits renew at the end of each cycle (cycle_end). mcp_status shows the full breakdown.
  • A query is at most 20,000 characters, 10 levels deep, 15 aliases and 2,000 tokens.
  • A short per-minute burst limit may apply; it answers rate_limited with the seconds to wait.

Access and revocation

  • Read-only. The server can run queries and nothing else. It has no way to change, delete or create data.
  • Your permissions. Every query runs as the signed-in user, so it sees exactly what you see in the MIA platform.
  • Your token stays with MIA. The assistant only holds a reference token; your MIA session never leaves the server.
  • Revoke any time in the MIA platform under Settings → MCP connections. It takes effect on the next call.

← MIA MCP overview