gateway-dev

gateway-dev is a skill for Claude Code, Codex from datatorag/mcp-gateway. It costs 50 tokens per session (3,724 once invoked), scanned A, original, MIT.

A development guide for adding or changing gateway features in datatorag-mcp. A gateway is the part of a system that receives requests and connects them to backend services.

In plain words
What is it for?
Use it when adding API routes, dashboard pages, gateway capabilities, usage or billing events, or database changes in datatorag-mcp. It also describes the project’s required shipping checks.
Why use it?
It helps developers follow the project’s existing request flow, authentication, rate limits, error handling, database, and testing conventions.

Skill for Claude CodeCodex

Part of the datatorag plugin — 16 skills, 4 agents, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/datatorag/mcp-gateway/gateway-dev
Any agent
npx skills add datatorag/mcp-gateway --skill gateway-dev
Clone the repo
git clone --depth 1 https://github.com/datatorag/mcp-gateway

Made for: Claude Code, Codex.

Or install datatorag, the plugin that ships this one along with the rest of its 16 skills, 4 agents, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gateway-dev

README.md
[![agentmods](https://agentmods.dev/badge/skills/datatorag/mcp-gateway/gateway-dev.svg)](https://agentmods.dev/skills/datatorag/mcp-gateway/gateway-dev)
Your own site
<a href="https://agentmods.dev/skills/datatorag/mcp-gateway/gateway-dev"><img src="https://agentmods.dev/badge/skills/datatorag/mcp-gateway/gateway-dev.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,724 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00050 $0.03724
Opus 5 $0.00025 $0.01862
Sonnet 5 $0.00010 $0.00745
Haiku 4.5 $0.00005 $0.00372

Measured 3d ago against content hash cb02832776cc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gateway-dev scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/gateway-dev/SKILL.md · 108 lines

How it starts

The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Gateway Dev

Before you start

Load the codebase-map skill first — this skill assumes you already know the request flow, the two plugin-manager.ts files, and the invariants list. It doesn't repeat any of that; it's recipes only.

Recipes

Add an API route (dashboard-authenticated)

Dashboard endpoints live under apps/gateway/src/app/api/**/route.ts and reuse the shared wrapper rather than hand-rolling auth:

  1. Create route.ts, export dynamic = "force-dynamic" if the response must never be statically cached (every existing usage route does this).
  2. Wrap the handler in withRoute (apps/gateway/src/lib/with-route.ts, replaced with-rate-limit.ts in the DRY-1 refactor) — it resolves the session via getSessionUserId (apps/gateway/src/lib/session.ts), 401s {error:"Unauthorized"} if absent, checks dashboardApiLimiter (apps/gateway/src/gateway/usage/rate-limit.ts) → 429, and maps any unhandled throw to a generic 500 via logAndGenericError (apps/gateway/src/lib/errors.ts) so a raw Error.message never reaches a client. Handler shape is (userId, req, ctx) => Promise<Response>; for [slug] routes pass the ctx type: withRoute<{ params: Promise<{slug: string}> }>(...). Every session-gated JSON route uses it — the only exceptions are the two OAuth connect/callback redirect flows (bespoke CSRF-cookie handling).
  3. Query through db (apps/gateway/src/lib/db.ts), not a fresh createDb() call.
  4. Return NextResponse.json(...). See apps/gateway/src/app/api/usage/summary/route.ts for the full shape (session → rate limit → drizzle aggregate query → JSON):
export const dynamic = "force-dynamic";

export const GET = withRoute(async (userId) => {
  const rows = await db.select({ /* ... */ }).from(usageEvents)
    .where(eq(usageEvents.userId, userId));
  return NextResponse.json({ /* ... */ });
});

Add an API route (public, unauthenticated)

For public-facing endpoints (lead capture, webhooks) follow apps/gateway/src/app/api/leads/route.ts instead: its own dedicated limiters (leadsMinuteLimiter/leadsHourLimiter in apps/gateway/src/gateway/leads/limiter.ts, same createRateLimiter primitive as dashboardApiLimiter), a zod bodySchema with a honeypot field, and IP hashing (createHash("sha256") salted with LEADS_IP_SALT from getEnv()) instead of storing raw IPs. Client IP comes from CF-Connecting-IP first (prod is behind Cloudflare with the origin firewalled to CF ranges); the leftmost X-Forwarded-For entry is client-spoofable and only a dev fallback — any new public endpoint must use the same order.

Read the full file on GitHub · 108 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 108 lines · 50 tokens per session scan A cb02832776cc

Subscribe to this mod's changes

gateway-dev is a skill published in the GitHub repository datatorag/mcp-gateway (3 stars, last pushed 3d ago), licensed MIT. It adds 50 tokens to every session and 3,724 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens