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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。