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

Four stateless tools, read in order: Explore → Describe → Run, with mcp_status on demand. The server remembers nothing between calls, so an agent may start at any tool. Every answer except run_query carries 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, schema and examples.
  3. run_query with a query built from that schema:
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 four 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.

Returns

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

describe_entity

Describe entity

describe_entity(name)

How to query one entity: its single, list and grouped resolvers, the fields worth selecting first, the GraphQL schema slice it needs, example queries and related entities in other families.

ArgumentTypeNotes
namestringAn entity name from explore_mcp, case-insensitive. An unknown name returns unknown_entity with the 3 closest names.

Returns

{ entity, family, scope, resolvers, key_fields, schema, examples, alternatives, next_steps }

run_query

Run GQL query

run_query(query, variables=None)

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.

ArgumentTypeNotes
querystringA GraphQL query document. Mutations and subscriptions are refused.
variablesobject | nullGraphQL variables.

Returns

{ data, errors?, extensions: { credits: { spent, remaining, cycle_end }, warnings? } }

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 }

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