mcp-analytics-stub
This MCP server lets an AI/agent resolve synthetic category name fragments to stable IDs and fetch insight rows for those IDs using schema-validated tools.
Use
resolve_categoryto find categories whose name contains a non-empty query fragment and get stable category IDs.Use
get_insightswith acategory_idfromresolve_categoryto retrieve top insight rows; optionallimitis 1–10 with default 3, and unknown IDs return an error.Rely on structured, validated inputs and tool results rather than guessing; malformed calls fail loudly.
Run it locally over stdio as a small reference MCP server using in-memory synthetic data only, not a real analytics API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-analytics-stub Show insights for the 'home decor' category"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-analytics-stub
This repository is a small synthetic reference implementation. For a larger example using MCP tools to answer and evaluate analytics questions, see Analytics Assistant.
In plain English
This is a small example of how an AI tool can call reliable functions and receive structured answers instead of guessing. MCP is the connection standard; the example data is entirely synthetic.
Status: Public starter project for learning and demonstration.
A minimal Model Context Protocol server in TypeScript. It exposes two tools over stdio and returns synthetic data only. It exists to show the shape of an MCP server that wraps an analytics API, without wrapping a real one.
Related MCP server: voice-agent-mcp
Tools
Tool | Kind | What it does |
| resolver | Turns a name fragment into stable category ids. |
| context | Given an id, returns a few insight rows. Unknown ids return an error result. |
Shape
MCP client (IDE agent)
│ JSON-RPC over stdio
▼
MCP server ── zod validation ──▶ resolver / context handlers ──▶ data layerIn a real server the data layer would be an HTTPS client, with credentials read from environment variables. Here it is an in-memory list.
Why these two tool kinds
Resolvers map human names to ids, so the agent never has to guess an identifier.
Context tools take an id and return structured data, so answers come from a call rather than from pasted text.
Inputs are schema-validated, so a malformed call fails loudly.
Tool descriptions matter: they are what an agent reads when choosing a tool.
Run it
npm install
npm test
npm run dev # stdio serverTo use it from an MCP-capable editor, point it at npx tsx src/server.ts (or node dist/server.js after npm run build) as a stdio server.
From local to shared
The same handlers can sit behind a stateless HTTP transport in a container for team use. This stub keeps stdio only, to stay small.
License
MIT. All data is invented.
Available Tools
2 toolsget_insightsC
Return top insights for a category id from resolve_category.
Inputs: category_id (required), limit.
resolve_categoryA
Find categories whose name contains the query. Returns ids to use with other tools.
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
resolve_category and get_insights target clearly different stages of the workflow (discovery vs. retrieval), and the descriptions explicitly explain the handoff via category ids. There is no overlap that could cause misselection.
Both tools follow a consistent verb_noun snake_case pattern. The convention is applied uniformly with no mixed styles or casing deviations.
Two tools is thin but the stub scope (resolve a category, fetch its insights) is plausibly minimal. It sits at the borderline where an agent may need more surface for real work.
Coverage is a narrow two-step path: discovery requires a query string with no way to list all categories, and there is no pagination, time range, or drill-down beyond 'top insights'. Core workflow works but obvious gaps remain.
Related MCP Connectors
Analytics for MCP servers. Query your tool calls, first-call success, retries and schema cost.
Read and edit GA4, Search Console and Google Tag Manager from any MCP client. 29 tools.
Query SEC EDGAR filings, XBRL financials, and company data via MCP. STDIO or Streamable HTTP.
Read-only Google Search Console MCP server for AI assistants.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to discover and execute operational tools such as database mutations and system diagnostics over stdio, with deterministic structured outputs and Langfuse observability.ISC
- AlicenseNot gradedqualityBmaintenanceServes a single set of typed, validated tool definitions to MCP clients over stdio, letting them perform real actions through one controlled executor. The same definitions power a speech-driven OpenAI tool-calling agent, so voice and MCP clients share identical, validated capabilities.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to run eight data tools over stdio for product search, ad transparency, company intent, job/ATS lookup, keyword volume, domain SEO, and YouTube transcripts, returning JSON envelopes with item limits, truncation metadata, and structured errors.MIT
- AlicenseNot gradedqualityBmaintenanceProvides read-only, deterministic tools for searching accounts and knowledge and retrieving tickets, ticket details, and product information over a stdio MCP connection.MIT