Skip to main content
Glama
mcp-analytics-stub

mcp-analytics-stub

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

resolve_category

resolver

Turns a name fragment into stable category ids.

get_insights

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 layer

In 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 server

To 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 tools
get_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

    B3.4/5.0

    Scored across 2 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    Both tools follow a consistent verb_noun snake_case pattern. The convention is applied uniformly with no mixed styles or casing deviations.

    Tool Count3/5

    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.

    Completeness3/5

    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

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Serves 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.
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables 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
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides read-only, deterministic tools for searching accounts and knowledge and retrieving tickets, ticket details, and product information over a stdio MCP connection.
      MIT