omniroute-mcp-bridge
Enables DSH to expose only allow-listed tools from a remote HTTP MCP server through a local stdio interface, automatically re-initializing stale upstream sessions.
README
omniroute-mcp-bridge
A stdio MCP bridge that DSH spawns as a child process (via the dsh-mcp-client
plugin, transport: stdio). It proxies tools/list / tools/call to the
omniroute streamable-http MCP server at
https://llm.claassen.family/api/mcp/stream and exposes only the
allow-listed tools to the model.
Why
- The upstream streamable-http session dies when idle ("Unknown Mcp-Session-Id" 404). The bridge detects that exact failure, tears down the stale client, re-runs the MCP initialize handshake (fresh session id) and retries — so a dead upstream session no longer breaks a tool call.
- The
dsh-mcp-clientplugin has no tool-filtering config. This bridge filterstools/listserver-side, so onlyomniroute_web_searchis exposed instead of ~70 tools (saves model context; stableserverName: omnirouteis kept, so the public name staysmcp__omniroute__omniroute_web_search). - The upstream auth header is passed via child env, not argv — the secret
never appears in the process list. It lives only in the 0600
cordis.patch.ymlof the web profile.
Files
| file | purpose |
|---|---|
bridge.mjs |
stdio MCP server entrypoint (spawned by DSH) |
upstream.mjs |
injectable upstream accessor with dead-session re-init logic |
test-bridge.mjs |
standalone live test: full MCP handshake + real search call |
test-reinit.mjs |
deterministic fake-upstream test of the re-init loop |
probe.mjs |
dumps raw upstream tool names |
probe-ttl2.mjs |
measures upstream session idle TTL |
SDK resolution
package.json pins @modelcontextprotocol/sdk to the exact version the
bridge was developed against. Two ways to get it:
-
Standalone:
npm installin this directory. -
Inside the DSH host (this deployment):
node_modulesis a symlink to/usr/lib/node_modules/@deepseek-ai/dsh/node_modules, so the bridge always uses the same SDK build DSH's own mcp-client plugin uses. The symlink is gitignored — recreate it after cloning in that environment:ln -sfn /usr/lib/node_modules/@deepseek-ai/dsh/node_modules node_modules
Config (env, set in ~/.dsh/profiles/web/cordis.patch.yml)
| var | meaning |
|---|---|
MCP_BRIDGE_UPSTREAM_URL |
streamable-http URL (required) |
MCP_BRIDGE_UPSTREAM_HEADERS |
JSON object of request headers |
MCP_BRIDGE_ALLOWED_TOOLS |
comma-separated raw tool names (omit = all) |
MCP_BRIDGE_LOG |
1 = verbose logging on the child's stderr |
Tests
Credentials are not committed. Export them first (values from your patch file):
export MCP_BRIDGE_UPSTREAM_URL='https://llm.claassen.family/api/mcp/stream'
export MCP_BRIDGE_UPSTREAM_HEADERS='{"Authorization":"Bearer …","X-Forwarded-For":"127.0.0.1"}'
Then:
node test-reinit.mjs # deterministic: dead session -> re-init -> success (no network needed)
node test-bridge.mjs # live: handshake + filtered list + real search
node probe.mjs # dump the upstream's raw tool names
node probe-ttl2.mjs # measure upstream session idle TTL
Change the allow-list
Edit MCP_BRIDGE_ALLOWED_TOOLS in the patch file (comma-separated raw names
from node probe.mjs). The include-plugin HMR re-applies the patch on file
change; the mcp-client plugin respawns the bridge child.
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.
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.
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.
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.