Repository navigation
mcp-slim: Inlining JSON Schema $ref/$defs and compacting MCP tool schemas by 50%-98% for structured tool calling #2101
SalyyS1
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 Outlines community,
When pairing Outlines structured generation / tool-calling workflows with external Model Context Protocol (MCP) servers (especially FastMCP / Pydantic v2 servers), upstream
tools/listschemas often emit nested$defs/$refpointers, verboseanyOfnullable wrappers, and 15,000 to 45,000+ tokens of schema metadata.We built mcp-slim, an open-source, zero-dependency Python MCP stdio proxy that sits between any MCP client and stdio server:
What it does
$ref/$defs& Nullable Unions (--flatten-schemas): Inlines JSON Schema references and normalizesanyOf: [{"type": "string"}, {"type": "null"}]into clean, flat schemas.tools/list&tools/callTokens by 50% to 98.7%: Strips verbose prose, exposes BM25 lazy tool discovery (--dynamic-toolsets), and converts homogeneous JSON arrays into compact TOON tables (--toon).--coerce-args,--redact-secrets): Automatically casts stringified numbers/booleans and scrubs leaked API keys (ghp_*,sk-*,AKIA*, JWTs, PEM keys) in real time.Repository: https://github.com/SalyyS1/mcp-slim
All reactions