feat(mcp): Zero-Schema-Tax MCP Client Bridge & Hierarchical JIT --help Discovery
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with the architecture blog post linked in the issue, then inspect the existing toolbox index, command dispatch, and ACT_TOOL_SCHEMA entry points to see how MCP discovery would fit. The issue names tether/mcp.py for the client; check the project’s dependency setup and tests before choosing the transport details. Done means the acceptance criteria pass, including one toolbox line per server, hierarchical help for large tool sets, and only ACT_TOOL_SCHEMA exposed to the model.
Written by the indexing model from the issue text.
Description
Summary & Motivation
As described in the Tether architecture blog post ("What Tether is still missing: 1. MCP support, without the schema tax"):
"A lot of useful integrations already ship as MCP servers, and I want them. But the usual way of plugging MCP into a harness is exactly the thing that started this project: every server dumps its full tool list and JSON schemas into the prompt up front. The version I want keeps the
act(cmd, stdin)rule. An MCP server would show up as one line in the toolbox index (github : Issues and pull requests), and its tools would be discovered just in time, withgithub --helpandgithub issue create --help, like any other command. The protocol stays on the outside of the envelope and the model never sees a schema it did not ask for. The hard part is the discovery step: a server with 80 tools needs a good--helphierarchy, or I have rebuilt the problem one level down."
Literature & State-of-the-Art Grounding
- Performance Degradation from Tool Schema Bloat:
- Qin et al. (ICLR 2024), "ToolLLM: Facilitating Large Language Models to Master 16000+ Real-World APIs" (arXiv:2307.16789): Shows that dumping >10–20 API schemas directly into an LLM context window causes severe attention dilution and argument hallucination; hierarchical retrieval/routing is required.
- Patil et al. (NeurIPS 2024), "Gorilla: Large Language Model Connected with Massive APIs" (arXiv:2305.15334): Demonstrates that separating API discovery from API invocation prevents syntax hallucinations on smaller models.
- Hierarchical CLI Progressive Disclosure (ACI):
- Yang et al. (NeurIPS 2024), "SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering" (arXiv:2405.15793) & Wang et al. (ICML 2024), "CodeAct" (arXiv:2402.01030): Unifying tool execution behind a single POSIX-like command channel with concise, progressive
--helpfeedback preserves small-model reasoning capacity.
- Yang et al. (NeurIPS 2024), "SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering" (arXiv:2405.15793) & Wang et al. (ICML 2024), "CodeAct" (arXiv:2402.01030): Unifying tool execution behind a single POSIX-like command channel with concise, progressive
State-of-the-Art Fix & Architecture Design
1. Zero-Dependency JSON-RPC 2.0 MCP Client (tether/mcp.py)
In accordance with Rule 7 (Zero Framework Bloat), implement a thin, stdlib/httpx JSON-RPC 2.0 client supporting:
- Stdio transport:
asyncio.create_subprocess_execcommunicating over newline-delimited JSON-RPC (initialize,tools/list,tools/call). - HTTP/SSE transport:
httpx.AsyncClientfor remote MCP endpoints. - Security Envelope (Rule 6): Scrub secret environment variables from stdio MCP subprocesses unless explicitly whitelisted in the server config.
2. Two-Level Hierarchical --help Compiler for Large MCP Servers (Solving the 80-Tool Problem)
When an MCP server exposes $N$ tools (e.g., github_create_issue, github_list_issues, github_merge_pr, ...):
- Level 0 (System Prompt Toolbox Index — $\le 12$ tokens):
The entire MCP server appears as one single line intoolbox_index():github : GitHub MCP server (issues, pulls, repos, search) - Level 1 (
act("github --help")— Prefix Grouping / Sub-Namespace Tree, $\le 60$ tokens):- If the server has $\le 8$ tools, list
<subcmd> : <1-line summary>directly. - If the server has $> 8$ tools (e.g., 80 tools), automatically split tool names on
_/-common prefixes (issue,pull,repo,search) or supportgithub --help <filter_keyword>sogithub --helpnever dumps 80 lines at once:Usage: github <group|tool> [args...] | github --help [group|keyword] Groups: issue (12), pull (9), repo (15), actions (8), search (5)
- If the server has $\le 8$ tools, list
- Level 2 (
act("github issue create --help")— JIT JSON-Schema-to-CLI Compiler, $\le 60$ tokens):- Deterministically compiles the MCP tool's
inputSchema(JSON Schema properties, types, required flags) into Tether's compact POSIX flag signature:Usage: github issue create --repo <str> --title <str> [--labels <list>] [stdin: body] - Automatically maps large string/markdown properties (
body,content,patch,code) tostdin(Rule 2) while also accepting--bodyflags.
- Deterministically compiles the MCP tool's
3. Acceptance Criteria
- Static system prompt increases by at most 1 line ($\le 12$ tokens) per enabled MCP server, regardless of whether the server has 5 or 100 tools (Rule 1 & Rule 4).
-
ACT_TOOL_SCHEMAremains the only JSON tool schema sent to the LLM provider (Rule 2). - Zero heavy SDK dependencies added (
mcpSDK not required; pureasynciostdio +httpxJSON-RPC 2.0).
- Dominant language
- Python
- Stars
- 3
- Forks
- 1
- Avg merge
- 52m
- Merged PRs (30d)
- 166
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from igormcsouza/tether
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
igormcsouza/tether#278 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
igormcsouza/tether#269 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
igormcsouza/tether#280 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 49/100
igormcsouza/tether#279 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
igormcsouza/tether#273 ·
Maintainers usually reply within 1 day
All issues in igormcsouza/tether
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
aws-samples/sample-per-model-bedrock#803 ·
Maintainers usually reply within 1 day
-
documentation p1
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
huggingface/accelerate#4511 ·
Maintainers usually reply within 1 day
-
follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
lesson-submission pending-review
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Ikalus1988/MisakaNet#4585 ·
Maintainers usually reply within 1 day