Mcp pool http proxy for subprocess sdks
Skill kjuhwa/skills-hub/skills/mcp-integration/mcp-pool-http-proxy-for-subprocess-sdks
Expose a pool of MCP sources (Linear, GitHub, Notion, ...) to Codex/Copilot SDK subprocesses through a single Streamable-HTTP MCP endpoint, instead of having each subprocess open independent connections.From its SKILL.md
npx -y skills add kjuhwa/skills-hub --skill mcp-pool-http-proxy-for-subprocess-sdksAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.4 KB, 689 tokens by cl100k_base, as published. Nobody here has run it
MCP pool HTTP proxy for subprocess SDKs
When to use
- Host process already manages MCP connections to many sources (Linear, GitHub, Notion, ...).
- You spawn LLM SDK subprocesses (Codex, Copilot) that themselves consume MCP tools.
- You do NOT want each subprocess re-establishing stateful stdio/SSE connections to every source.
- Want stateless HTTP so multiple subprocesses can share the pool with no session tracking.
How it works
- In the host (e.g. Electron main), keep an
McpClientPoolofPoolClientinstances — one per source, each holding the real@modelcontextprotocol/sdkclient. - Stand up a local HTTP server on
127.0.0.1:0(random port). - Wrap it with
StreamableHTTPServerTransport({ sessionIdGenerator: undefined })— stateless mode, no session affinity. - Connect an
@modelcontextprotocol/sdk/serverServerto the transport; registerListToolsRequestSchema(fan-out to the pool, namespaced tool names) andCallToolRequestSchema(dispatch back). - Route every incoming request at
/mcptotransport.handleRequest(req, res)regardless of HTTP method. - Return the URL
http://127.0.0.1:<port>/mcpto each spawned SDK subprocess as its MCP endpoint. - Subprocess uses
StreamableHTTPClientTransport(new URL(url))to talk to the pool.
Example
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
this.transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
this.mcpServer = new Server({ name: 'pool', version: '1.0.0' }, { capabilities: { tools: {} } });
this.mcpServer.setRequestHandler(ListToolsRequestSchema, async () => {
const tools = [];
for (const [slug, client] of this.pool.entries()) {
const list = await client.listTools();
tools.push(...list.map(t => ({ ...t, name: `mcp__${slug}__${t.name}` })));
}
return { tools };
});
this.mcpServer.setRequestHandler(CallToolRequestSchema, async (req) => {
const [, slug, tool] = req.params.name.split('__');
return this.pool.get(slug).callTool(tool, req.params.arguments);
});
await this.mcpServer.connect(this.transport);
http.createServer((req, res) => this.transport.handleRequest(req, res)).listen(0, '127.0.0.1');
Gotchas
- Stateless mode means DO NOT use
session/notificationsor resource subscriptions - they all need a session ID. - Bind to
127.0.0.1only - the SDK subprocess shares your localhost so no need to open a port publicly. - Namespace tool names aggressively (
mcp__<source>__<tool>) so collisions between sources don't silently shadow each other. transport.handleRequestcovers POST, GET, DELETE - route them all to it; don't try to branch on method.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most mcp tooling skills give in 689 tokens
Counted across 638 of the 750 authors here whose files we hold, read 2026-08-07
- Create ten complex or independent read-only evaluation questionsin 69 of 638, across 15 files
- Test servers using MCP Inspectorin 61 of 638, across 19 files
- Provide actionable error messages with specific next stepsin 54 of 638, across 12 files
- Prioritize comprehensive API coverage over specific workflows or workflow toolsin 54 of 638, across 12 files
- Use TypeScript and Streamable HTTP for remote servers or clientsin 54 of 638, across 8 files
- Define structured output schemas where possiblein 50 of 638, across 8 files
- Use Zod or Pydantic for input schemasin 47 of 638, across 5 files
- Fetch MCP specification pages with markdown suffixin 46 of 638, across 4 files
- Load framework documentation using WebFetchin 45 of 638, across 3 files
- Verify each evaluation answer independentlyin 45 of 638, across 3 files
- Implement API client with authentication and paginationin 45 of 638, across 3 files
- Define input schemas with validationin 27 of 638, across 9 files
Said here and by no other author read
- use stateless mode for the transport
- namespace tool names with the source slug
- route all HTTP methods to transport.handleRequest
- return the local MCP endpoint URL to subprocesses
- keep one pool client instance per source
- register list and call tool request handlers
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.