Repository navigation
Add a private MCP server and REST API for ad network data - #128
Merged
Merged
Conversation
One core (lib/data-api/ad-networks) answers every question; the MCP route (Streamable HTTP, stateless, SDK 1.32.2) and versioned REST routes under /api/v1 are thin wrappers with the same schemas and output. Eight read-only tools: overview, list, profile, compare, count, find, lookup, movements. Every answer carries its data time, definitions, caveats and a citable stack127 URL, and never returns publisher names or internal check fields. Requests run in read-only transactions with a statement timeout, allow-listed SQL fragments, row caps, durable per-principal rate limits, and no-store headers. The browser connectors use a secret path; header clients use a bearer token. proxy.ts keeps private paths out of cache tags, canonical links and pathname headers, and wrong secrets share the generic 404. A private SQL tool stays locked until it has its own database login. All feature flags default off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RaviTejaKNTS
temporarily deployed
to
production
November 14, 2026 08:11 — with
GitHub Actions
Inactive
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A private MCP server and REST API over stack127's ad network data, in the existing backend on OVH. The owner will connect it to claude.ai and ChatGPT for research and data stories. It is built so it can later become a public, paid product, but everything public stays off.
lib/data-api/ad-networks/answers every question. The MCP route (app/api/mcp/, Streamable HTTP, stateless,@modelcontextprotocol/sdk1.32.2) and REST routes (app/api/v1/ad-networks/...) are thin wrappers with the same schemas and output.ad_networks_overview,list_ad_networks,get_ad_network,compare_ad_networks,count_sites,find_sites,lookup_site,network_movements.no-storeon every response.proxy.tskeeps private paths out ofCache-Tag, canonicalLinkandx-stack127-pathname.run_readonly_sqlexists but stays locked until it has its own restricted database login (STACK127_DATA_SQL_DATABASE_URL).Dockerfileand start scripts are identical tomain.stack127_docs/mcp-and-api.mdcovers the tools, routes, auth, limits, connecting each client, rotation, the off switches, and the Cloudflare rules to add before enabling.Review
Four security-focused review rounds by a separate reviewer. Findings fixed along the way:
A server wrapper added in round 3 was removed in round 4, because it broke graceful shutdown. The final review found no runtime blocker; its two documentation points are fixed.
Checks
npm run quality: TypeScript and 129 tests.npm run test:data-api: 15 tests, including the public header baseline.After merge
/api/mcpand/api/v1and the redirectno-storeresponse rule.🤖 Generated with Claude Code