proomt

Search

Search posts, papers, and topics

All posts

SitePoint16 min readtutorialintermediate

Building Composite Model Context Protocol (MCP) Gateways in TypeScript

Summary

Step‑by‑step tutorial showing how to build a stateless composite Model Context Protocol (MCP) gateway in TypeScript using Hono, Zod, and the MCP SDK. It covers config‑driven upstream registration, namespaced tool discovery, JSON‑RPC routing, per‑tool auth middleware, and a token‑bucket rate limiter, with concrete code snippets and design trade‑offs.

  • Aggregate multiple MCP servers behind a single endpoint to avoid tool‑name collisions and duplicated client credentials.
  • Namespace tools with `<namespace>__<tool>` and resolve collisions at registration time.
  • Implement per‑tool authorization via bearer‑token → wildcard pattern mapping.
  • Use a token‑bucket algorithm for per‑token rate limiting without penalising idle periods.

Production LLM‑backed services often need to stitch together several specialized MCP servers (e.g., RAG, web‑search). Without a gateway each client must manage multiple auth flows and risk invoking the wrong tool due to name clashes. A composite gateway centralises auth, enforces policies, and simp…

6/10

Related reading

  1. Build a Typed Context Compaction Gate for AI Agents

    A step‑by‑step tutorial showing how to build a typed context‑compaction gate for AI agents in TypeScript using LangChain and Zod. It defines a discriminated‑union schema for keep/summarize/discard actions, implements a fast gpt‑4o‑mini classifier, validates decisions at runtime, and wires the gate as middleware in an agent loop, with testing and production‑grade tuning advice.

    SitePointsitepoint.com16 min
  2. Building Deterministic Multi-Agent State Machines in TypeScript

    The article shows how to build a deterministic, checkpoint‑backed finite state machine engine in TypeScript for orchestrating multi‑agent AI workflows. It uses Zod for schema validation, better‑sqlite3 for atomic persistence, and a pure transition function to make workflows traceable and recoverable in serverless environments.

    SitePointsitepoint.com18 min
  3. Presentation: Context Engineering at LinkedIn: How We Built an Organizational Context Layer for AI Agents with MCP

    LinkedIn built a “Contextual Agent Playbooks and Tools” layer that wraps internal services (code search, docs, feature flags, etc.) behind the open‑source Model Context Protocol (MCP). By feeding LLM‑powered coding agents the exact internal artifacts they need, the agents can diagnose incidents, generate PRs, and update incident tickets in minutes, delivering a reported 20 % productivity gain wit…

    InfoQinfoq.com28 mintalk
  4. Replica-aware routing public beta

    Replica‑aware routing (public beta) lets ClickHouse Cloud users pin a query stream to a specific replica by sending a custom header (HTTP) or overriding the TLS SNI (native). The proxy (Envoy) hashes the tag and consistently forwards all requests with the same tag to that replica, giving read‑after‑write consistency for temporary tables, session objects, and warm replica caches. Stickiness is bes…

    ClickHouseclickhouse.com6 min