Repository navigation
mcp-slim: Zero-dependency MCP stdio proxy for Langflow MCP Tools (-50% to -98% schema tokens & SecretGuard) #16369
Replies: 2 comments
|
decent work on the token compaction angle, the $ref inlining is probably the more practically impactful feature for people running local models since they choke on unresolved refs constantly. one thing worth noting: the SecretGuard feature you mention is doing pattern matching on content passing through the proxy, which is a useful safety net but won't catch secrets that are passed as structured tool arguments rather than string content. for anyone doing this in prod, keeping actual secret values out of the model context entirely is a harder problem than filtering on the way out. (i work on 1Claw, which takes a different approach by keeping secrets in a vault and giving the model only a path reference, so the raw value never enters context in the first place. different tradeoff, more setup overhead.) |
|
@redbotster Good callout on both structured We just shipped two updates in
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
When connecting large MCP servers (like GitHub, Playwright, Notion, or Postgres) to Langflow's
MCP Toolscomponent,tools/listcan inject 15,000 to 45,000+ schema tokens on every agent run, and deeply nested JSON Schema$ref/$defspointers often cause smaller or local tool-calling models to produce invalid arguments.We built mcp-slim (
pip install git+https://github.com/SalyyS1/mcp-slim.git), an open-source, zero-dependency Python stdio proxy and CLI profiler that wraps any MCP server command in Langflow:What it adds to Langflow MCP stdio pipelines
tools/list&tools/call): Strips verbose markdown prose, redundanttitle/examples/defaultfields, and compacts homogeneous JSON object arrays in tool responses into tabular TOON format (--toon).$ref/$defsInlining (--flatten-schemas): Resolves recursive JSON Schema pointers in-place so local and open-weight models in Langflow never fail on unresolved$refdefinitions.--dynamic-toolsets): Replaces 50+ tool definitions with two lightweight meta-tools (search_toolsandcall_tool) ranked by BM25 + CamelCase/snake_case subword tokenization.SecretGuard& Call-Level Tool Firewall (--redact-secrets,--allow-tools,--deny-tools): Redacts leaked API keys (ghp_*,sk-*,AKIA*, JWTs, PEM keys, andhttps://user:pass@hostURLs) across both tool inputs and outputs before they enter Langflow traces or LLM context.Quick usage in Langflow MCP Tools (Stdio command)
Repository and benchmarks: https://github.com/SalyyS1/mcp-slim
Feedback and feature requests from the Langflow community are very welcome!
All reactions