thatch
Enables many Claude Code sessions to connect to a single HTTP MCP server, be addressed by name, and receive pushed messages from anywhere.
README
@brooswit/thatch
A central HTTP MCP server, as an Elysia plugin. Many Claude Code sessions connect to one server by URL; the server addresses them by name and can push messages into a live session.
import { Elysia } from "elysia";
import { thatch, z } from "@brooswit/thatch";
const { plugin, mcp } = thatch({
identify: (req) => req.headers.get("x-connection-name"), // names the connection; null rejects it
tools: {
status: { description: "Fleet status", input: {}, handler: (_a, c) => `hello ${c.name}` },
},
});
const app = new Elysia().use(plugin).listen(3000);
// push a message into a named session — from anywhere
const d = await mcp.send("epic-kan-39", { content: "PR #296 approved", meta: { key: "KAN-39" } });
// d: { claim: "C2" } — a connected session's stream took it
// { claim: "refused", reason: "not-connected" | "no-channel-stream" | "bad-meta" | "closed-mid-send" }
Claude Code connects with:
claude mcp add --transport http fleet http://localhost:3000/mcp --header "x-connection-name: epic-kan-39"
Why the delivery type is not void
Pushing into a session can fail in ways the MCP SDK hides: a connection can be registered while its notification stream isn't attached, in which case the SDK drops the frame silently. thatch refuses that out loud (no-channel-stream) and only claims C2 when a stream is actually there to carry the frame. C3 (entered the transcript) and C4 (the model read it) are not observable, so no API here pretends to them.
API
thatch(options)→{ plugin, mcp }—pluginmounts the endpoint (default/mcp);mcpis the handle.options:identify(req),onDuplicate("replace"default |"reject"),history(default 50),tools,path,serverInfo.mcp.connections:list(),get(name),has(name),count(),waitFor(name, { timeoutMs }).mcp.send(name, frame),mcp.sendMany(names, frame),mcp.sendAll(frame, { where? }).mcp.on("connect" | "disconnect" | "send", handler).- A
Connectioncarriesname,connectedAt,lastSeenAt,meta,channelReady, andhistory. import { FakeConnection } from "@brooswit/thatch/testing"for tests.
Layers
protocol (frame, delivery, method — pure) · registry (named connections + history) · channel (sending, honest claims) · plugin (the Elysia mount, one MCP server per connection) · testing.
Scripts
bun run check # generate load tests + typecheck + unit + load + coverage ≥90%
bun test test/unit
MCP_LIVE=1 bun test test/live # against a real Claude Code session (opt-in)
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.