Maya MCP Server — Developer Documentation
How to integrate Maya with Claude, ChatGPT, or any MCP-compatible client. OAuth flow, tool catalog, resources, and error semantics.
Overview
The Maya MCP server lets LLM clients (Claude.ai, ChatGPT, Claude Desktop, Cursor, any MCP-compatible tool) query a Maya workspace using the Model Context Protocol. It exposes 24 tools, 3 resources, and 4 slash-command templates behind OAuth 2.1 with scoped access.
- Endpoint:
POST https://withmaya.ai/api/mcp/v1/mcp - Transport: MCP Streamable HTTP (stateless, per-request server instance)
- Server info:
name=maya,version=1.0.0 - Auth: OAuth 2.1 with PKCE (preferred) or legacy API key
- Install UI:
/app/settings/mcp
Quick install
Paste https://withmaya.ai/api/mcp/v1/mcp into your MCP client's custom-connector form. OAuth handles the rest — your first request triggers a browser sign-in and a consent screen where you approve the scopes.
For step-by-step guides (Claude.ai web, ChatGPT, Claude Desktop), visit /app/settings/mcp.
Authentication
OAuth 2.1 flow (preferred)
- Client GETs
/.well-known/oauth-authorization-server→ Authorization Server Metadata (RFC 8414). - Client POSTs
/api/oauth/register(Dynamic Client Registration, RFC 7591) to receive aclient_id. Rate-limited to 20 registrations per IP per hour. - Client redirects the user to
/api/oauth/authorizewithresponse_type=code,code_challenge_method=S256, a PKCE challenge,scope, andstate. - User signs in to withmaya.ai (if not already), lands on the consent page at
/app/oauth/consent, and approves the scopes. - Server issues a one-shot authorization code (10-minute TTL) and redirects the browser back.
- Client POSTs
/api/oauth/tokenwithgrant_type=authorization_code,code,code_verifier,redirect_uri. Response:access_token(1 hour TTL),refresh_token(30-day TTL). - Client uses the access token as
Authorization: Bearer maya_oat_…on every MCP call. - Refresh tokens rotate on every use; replay of an already-rotated refresh token revokes the entire chain for that (user, client) pair.
Legacy API keys
Still supported for backward compatibility. Prefix maya_live_…. Hashed with SHA-256 on storage; only the first 14 characters are ever displayed.
Scopes
| Scope | Grants |
|---|---|
read:visibility | Visibility score, share-of-voice, competitor comparisons, crawler activity, citations, action items, status/briefing narrative tools |
read:prompts | List and inspect tracked prompts plus their latest per-provider runs |
write:prompts | Add new prompts, re-run prompts, hide/unhide competitors, request GPT-4o-generated suggestions |
Tool catalog
Status & narrative (5)
| Tool | Scope | Purpose |
|---|---|---|
get_status | read:visibility | One-call health check: headline, green/yellow/red, summary, top 3 wins / risks / recommended actions. |
get_daily_brief | read:visibility | 60-second recap: what changed in the last 24-48h, probable cause, one urgent action. |
get_priority_actions | read:visibility | Top N action items ranked by urgency, each with impact + effort tags. |
get_wins_and_losses | read:visibility | Period recap (7d/30d) with magnitudes so the LLM can sort a bulleted list. Filter by category (visibility/sov/mentions/provider/data) or only (wins/losses). |
explain_score_change | read:visibility | Why visibility moved. Returns delta, ranked likely causes, provider clues, recommended next step. |
Visibility & competitors (7)
| Tool | Scope | Purpose |
|---|---|---|
get_visibility_score | read:visibility | Visibility score + sentiment + share-of-voice over 7d / 30d / 90d. |
get_share_of_voice | read:visibility | Share-of-voice vs. competitors with daily breakdown. format: compact drops the daily series. |
get_sentiment | read:visibility | How positively AI models talk about the brand (0–100) + trend + daily series, over 7d/30d/90d. |
compare_competitors | read:visibility | Own brand vs. rivals by mention count + SoV. Filter by competitors / minMentions; sort by mentions / mentionRate / sov. |
get_citations | read:visibility | Top domains AI models cite when answering about the brand. Filter by domain / sourceType / model / minMentions; paginated. |
get_citation_examples | read:visibility | The raw answer snippets where the brand was cited (the evidence behind get_citations), with context, source, model + prompt. |
get_crawler_visibility | read:visibility | GPTBot / ClaudeBot / PerplexityBot traffic, top pages, unresolved 404s. |
Prompts (5)
| Tool | Scope | Purpose |
|---|---|---|
list_projects | any | Every project reachable by the token. |
list_prompts | read:prompts | Tracked prompts for a project. Filter by status / intent / market / language / search; sort with sortBy + order; paginated with a stable total. |
get_prompt_result | read:prompts | Latest run for one prompt, per-provider breakdown. |
track_prompt | write:prompts | Start tracking a new prompt. Idempotent on normalized text. |
retry_prompt | write:prompts | Re-run a prompt immediately. Guarded by the per-prompt lock. |
suggest_prompts | write:prompts | GPT-4o generates candidate prompts based on brand facts + optional seed keyword. |
Competitor management (2)
| Tool | Scope | Purpose |
|---|---|---|
hide_competitor | write:prompts | Exclude a competitor name from every report. |
unhide_competitor | write:prompts | Restore a previously-hidden competitor. |
Onboarding & self-awareness (8)
| Tool | Scope | Purpose |
|---|---|---|
get_started | none | State-aware onboarding: detects whether the user has a project, prompts, runs, etc., and returns the right next steps. |
help | none | Capability menu by category with example questions. |
list_example_questions | none | 30+ sample prompts users can ask, grouped by category. |
explain_metric | none | Definitions + formulas + good/bad ranges for visibility, SoV, sentiment, citations, etc. |
who_am_i | none | Workspace context bound to the current token: user, plan, projects, granted scopes. |
get_quota | none | Plan limits vs. current usage (prompts, runs, audits, projects). |
get_data_freshness | read:visibility | Per-signal and per-provider last-updated ages with fresh/recent/stale tags. |
list_setup_gaps | read:visibility | Configuration gaps (no active prompts, Cloudflare missing, no competitors in brand facts, etc.). |
get_action_items | read:visibility | Unified to-do list merging action plans, fresh mentions, citation gaps, crawler errors, visibility drops. |
Filtering & result conventions
The core query tools (list_prompts, get_citations, get_citation_examples, get_wins_and_losses, get_share_of_voice, compare_competitors) share a consistent set of controls:
- Filters — tool-specific predicates (e.g.
domain,sourceType,model,market,language,search,category). The active filter set is echoed back underfilterso the caller can confirm what was applied. format—"full"(default) returns the rich payload;"compact"returns only the core fields (drops per-model breakdowns, daily series, surrounding context) for a smaller, faster response.- Pagination — list-shaped tools take
limit+offsetand return apageblock with a stabletotalandhasMore, so you can page deterministically. - Sorting — where supported,
sortBy+order(asc/desc). - Caching — read results are cached server-side for ~2 minutes per (tool, project, filter set). Repeated calls in a session are instant; mutations (
track_prompt,hide_competitor,unhide_competitor) bust the project's cache so changes surface on the next read.
Resources
MCP resources are pulled by the client at connect time and keep the LLM grounded without explicit tool calls.
| URI | Content |
|---|---|
maya://context | Accessible projects, default project, granted scopes. |
maya://daily-digest | 7-day visibility snapshot for the default project. |
maya://alerts | Open action items for the default project. |
Slash-command templates
Available under Claude.ai's "/" menu:
/maya weekly-report— full 7-day report with tool sequence spelled out./maya briefing— 60-second daily glance, reads resources first./maya competitor-deep-dive— focused drill on a single rival./maya find-seo-gaps— blind-spot discovery across tracked prompts.
Rate limits
- Per token: 300 requests/minute.
- Per workspace: 2 000 requests/minute (sum of all tokens).
- DCR: 20 registrations per IP per hour.
Exceeding any limit returns a tool result with error: "rate_limited", the limit scope, and retryAfterSeconds. Redis outages fail open to keep the product available.
Error envelope
Tool errors come back as MCP CallToolResult with isError: true and a JSON body:
{
"error": "prompt_already_tracked",
"message": "This prompt is already being tracked (id: abc, text: \"best CRM for SMB\").",
"nextAction": "Call get_prompt_result with the existing promptId to see its latest runs, or skip — no action needed."
}Every error includes a nextAction hint whenever there is one. The LLM is expected to follow the hint before asking the user what to do next.
Versioning
Breaking changes to the protocol or route shape bump the URL path: /api/mcp/v2/…. The previous version stays online for a 90-day deprecation window. Individual tool contracts carry a schemaVersion in the audit log so we can watch adoption before retiring an older shape.
Today we are on:
- MCP server:
name=maya,version=1.0.0 - URL path:
/api/mcp/v1/mcp
Audit log
Every tool invocation writes one row to mcp_tool_calls with:
- token id (hashed), user id, project id
- tool name, status (
ok | error | unauthorized | rate_limited | validation_error) - latency, input hash, response size, error code
args_schema_version
Users can query their own activity via Maya's dashboard.
Feedback
Bugs, feature requests, or connector-directory partnerships: [email protected]. Security reports: [email protected].