USA Web Analytics MCP
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., "@USA Web Analytics MCP Show me last month's top pages for agency.gov"
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.
USA Web Analytics MCP
An MCP server developed by the National Library of Medicine (NLM) for the GSA 2026 MCP Server Hackathon. It provides read-only access to United States government website analytics through tools backed by the GSA Digital Analytics Program (DAP).
The server uses FastMCP and uv. It can run locally over stdio or remotely over streamable HTTP.
Features
Retrieve analytics reports across all participating US government agencies.
Filter analytics reports by agency or US government web domain.
Retrieve the most recent 30 minutes of top pages for a selected agency.
Use inclusive
YYYY-MM-DDdate filters and paginated report requests.Read agency, report, and parameter information through MCP resources.
Start report analysis through a reusable MCP prompt.
Related MCP server: AgentKit
Available tools
Tool | Description |
| Retrieve an analytics report across all agencies. |
| Retrieve a report filtered by agency. |
| Retrieve a report filtered by a US government web domain. |
| Retrieve the latest 30 minutes of top pages for an agency. |
All tools are read-only and return structured data.
Prerequisites
Python 3.11 or newer
Install and run locally
cp .env.example .env
uv sync
uv run analytics-serverThe default transport is stdio, so the server communicates through standard input and output as a local MCP client subprocess.
To run the HTTP transport locally:
$env:MCP_TRANSPORT = "streamable-http"
uv run analytics-serverThe HTTP server listens on 0.0.0.0:8000 by default. Its MCP endpoint is /mcp, and it provides /health and /version status routes.
Example client configuration:
{
"mcpServers": {
"analytics-mcp": {
"command": "uv",
"args": ["run", "analytics-server"],
"cwd": "/absolute/path/to/mcp-hackathon-template"
}
}
}Configuration
Configuration is loaded from environment variables or a local .env file.
Variable | Default | Purpose |
|
| Use |
|
| HTTP bind address. |
|
| HTTP port. |
|
| API key sent to the GSA Analytics API. |
| GSA DAP API v2 URL | Override the upstream API origin. |
Do not commit .env or API credentials. Use an environment secret store for deployed instances.
Project structure
src/analytics_server/
├── app.py # FastMCP setup and transport selection
├── config.py # Environment-based settings
├── models.py # Pydantic inputs and shared types
├── utils.py # Outbound HTTP, validation, and pagination
├── routes.py # /health and /version routes
├── tools/ # One MCP tool per module
├── prompts/ # Reusable report-analysis prompt
└── resources/ # Analytics and parameter resources
tests/ # Import, registration, and security tests
deploy/ # Platform deployment examples
eval/ # Evaluation guidanceVerification
uv sync --group dev
uv run pytest tests/ -v
uv run ruff check .The test suite includes MCP registration checks and outbound HTTP security coverage, including validation of relative paths and sanitization of upstream failures.
Security
The MCP endpoint is unauthenticated by default. This is appropriate for the public-data hackathon posture but is not sufficient for a production deployment. Databricks Apps and other platforms may add authentication at the platform layer, but per-tool authorization and agency-specific ATO controls should be reviewed before production use.
The outbound HTTP helper:
Uses an operator-controlled GSA API origin.
Rejects absolute URLs, traversal paths, queries, fragments, and encoded escapes.
Disables redirects and environment proxy inheritance.
Applies a 30-second timeout and a five-megabyte response limit.
Sanitizes upstream errors so response bodies and sensitive values are not returned or logged.
Treat tool arguments, upstream content, and MCP messages as untrusted. Keep credentials out of source control and structured logs. See SECURITY.md for vulnerability reporting and additional guidance.
Deployment status
Deployment examples are included for cloud.gov, IBM watsonx Orchestrate/Code Engine, and Databricks Apps:
IBM and Databricks deployments have not been tested for this project. Use the supplied kits as deployment templates and validate authentication, networking, secrets, health checks, and tool behavior in your target environment before use.
Evaluation
This repository does not yet include a complete evaluation harness. See eval/README.md for the evaluation approach and setup guidance.
License
MIT. The project is subject to the GSA vulnerability disclosure policy described in SECURITY.md.
Available Tools
1 toolexample_search_datasetsSearch Datasets (example)BRead-onlyIdempotent
Search federal datasets matching a query string. (STUB — replace me.)
This stub shows the shape of a real tool without calling a live API.
Swap the body for an actual request using fetch_json(...); a worked
pattern is included below in a comment.
Inputs: query (required), pagination, response_format. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only a single tool there is nothing to confuse it with, and its stated purpose (searching federal datasets by query string) is clear. The 'example_' prefix and stub labelling make it slightly unclear whether this is the real tool or a placeholder, keeping it below a 5.
The lone name example_search_datasets follows a readable snake_case verb_noun pattern with no competing conventions to clash with. The 'example_' prefix signals scaffolding rather than a production-facing name, which is a minor deviation.
A single stub tool cannot represent a whole web analytics surface; the server is drastically under-scoped. One tool is the strongest signal of a thin or unfinished surface.
The tool is explicitly marked as a STUB to be replaced, and there are no analytics operations at all (no metrics, reports, sites, or time-series queries). The stated purpose is essentially unserved, so agents would hit dead ends immediately.
Maintenance
Related MCP Connectors
Hosted MCP server for marketing agencies: connect Google Ads, GA4, Search Console, Meta, LinkedIn and more to Claude or ChatGPT. Pull reports and make changes via OAuth login, no setup.
Analytics your AI agent can actually use. Track, experiment, and optimize via MCP.
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Connect your ads, shop, analytics, social, CRM and finance platforms once, then let Claude, ChatGPT, Cursor or any MCP client read, join and explain your numbers. Public statistics from the World Bank, IMF, Eurostat, OECD, WHO and SEC filings come as context, searchable and chartable from the same tools. Read-only by design, every number carries its source.
Related MCP Servers
- AlicenseAqualityBmaintenanceThe most comprehensive keyless federal-data MCP server. 36 tools for SAM.gov + USAspending + Federal Register + eCFR + Grants.gov. No API key, no registration, no signup. Works in Claude Desktop, Claude Code, Codex CLI, Cursor, Continue, Gemini CLI, and any MCP-aware host.153238 npm19MIT
- AlicenseAqualityAmaintenanceProduction Model Context Protocol (MCP) server for business — replaces stale generic descriptions with concrete 2026 technical intelligence and data agents. Exposes dynamic KPI analytics, forecasting, anomaly detection, and schema resources across 10 enterprise domains via FastMCP over stdio and SSE transports.9AGPL 3.0
- FlicenseNot gradedqualityDmaintenanceEnables natural-language Q&A, human-approved actions, and dashboard generation over a data ontology via MCP.-
- AlicenseAqualityDmaintenanceFirst-party web analytics MCP server for AI agents, providing 42 tools to query traffic, events, funnels, conversions, sources, and performance data.40283 npmMIT