Repository navigation
feat: every MCP tool from the shell with slm tool, and an slm-cli skill - #336
Merged
Merged
Conversation
…kill for agents without MCP `slm tool list | describe <name> | <name> [--json | --args-file | - | --key value]` hosts the same tools, schemas and permission checks as the MCP server (one shared registration), prints the tool's JSON result, and exits 0/1/2. Decisions made this way are recorded on the cli channel; arguments the tool does not take are refused. The generated slm-cli skill teaches the session protocol by command and lists every tool, and ships to every host plugin. Also: set_mode no longer loads the stdio MCP server into the calling process, and an MCP server always reports the mcp channel even when started from a CLI process. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…us callers as that agent Co-Authored-By: Claude Opus 5.5 <[email protected]>
…usage error is JSON on stdout Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rary folder Co-Authored-By: Claude Opus 5.5 <[email protected]>
… later tests see a clean environment Co-Authored-By: Claude Opus 5.5 <[email protected]>
varun369
force-pushed
the
feat/slm-tool-cli
branch
from
November 20, 2026 15:30
60df9f8 to
69e9c26
Compare
…g assert is split Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t a fixed count Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
slm tool— every MCP tool from a shell, for an agent that can run commands but does not have the SuperLocalMemory MCP server.Plus a generated
slm-cliskill, shipped to every host plugin, that teaches the session protocol by command (start, recall before answering or searching, cue check before editing, remember decisions, pictures and PDFs, close) and lists every tool with its CLI form.Why
About 30 tools had no CLI form at all (pictures and PDFs, mesh messaging, the code graph, learning signals, assertions, retention, Brain evidence and more). When the MCP server is not available to the agent, those were unreachable, and the agent had no single description of how to run a session from the shell.
How
register_*calls moved frommcp/server.pyintomcp/tool_registry.register_tools, and the tool-set rules (essential set, mesh/image additions, precedence) intomcp/tool_surface. The MCP server andslm toolboth use them, so names, descriptions, input schemas and admission gates cannot drift. The server's tool lists are byte-identical tomainforwhole, the default,core,code,full,power,mesh, an alias and anSLM_MCP_TOOLSallowlist (checked by dumping both before and after).slm toolbuilds the sameSLMFastMCPhostslm mcpbuilds (without its stdio watchdog, stdin monitor and warm-up threads) and callscall_tool, so every tool reaches the daemon exactly as it does over MCP, behind the same@admits/ default read gate.clidoor:SLM_CLIENT_CHANNELis set toclibefore any daemon request, so a shell that exportsmcpcannot relabel its decisions. The agent isSLM_AGENT_ID, read the way the stdio server reads it; anagent_idargument stays a claim.channel,agent_id_source, typos). Exit 0 success, 1 the tool answered with an error or refusal, 2 the call could not be made (unknown_tool,invalid_argumentswith one line per problem,not_in_tool_set,unknown_tool_set). Output is the tool's JSON on stdout only.--tool-set core|code|full|power|mesh|wholeapplies the server's own filter;--tool-set mcpis exactly what an MCP connection on this computer sees now.scripts/build_cli_skill.pyrendersplugin-src/skills/slm-cli/SKILL.mdfrom the registry (--checkfor CI); the existing plugin builders ship it to Claude Code, Codex, Copilot, Cursor, Antigravity, Hermes, Muse and VS Code. A test fails when the committed skill drifts from the registry.docs/cli-reference.mdgains aslm toolsection and the session protocol without MCP;docs/mcp-tools.mdpoints to it.Defects found and fixed on the way (CRIT)
set_modeloaded the stdio server into the calling process. It importedmcp.server.reset_engine, which in a command-line process started the stdio watchdog and stdin monitor and turned the process channel intomcp. The host that registered the tools now hands its own reset (get_engine.reset); the stdio server keeps its old path. Proven by revert: the e2e test seesstdio_server_imported: True, channel: mcpwithout the fix.slm toolwould mislabel MCP decisions ascli. The daemon inherits the caller's environment and the embedded MCP server only defaulted the channel. It now setsmcp(the MCP server is always the MCP door). Proven by revert.slm toolbinds a session:--session, elseSLM_SESSION_ID(or the host's session id), else one stable id per agent and folder.mesh_waitblocks for up to its 20 s bound and returns; the broker keeps a command-line peer for 30 minutes after its last call, which the docs and skill say, withproject:/broadcastfor longer waits.Tests
tests/test_cli/test_slm_tool.py(23): registry (112 tools reachable), reserved option names, tool-set filter, channel claim, argument merge/coercion/refusal, result conversion (structured, plain-text refusal, images to files), mesh session binding, CLI form, the skill matches the registry and ships to every host.tests/test_cli/test_slm_tool_parity.py(22): in fresh processes,slm toollists exactly whatmcp/server.pylists (title, description, input schema) forcore,code,full,power,mesh,whole, the default, and--tool-set mcpunder three connection settings; both register the same 112 tools; the entry point's JSON, exit codes and help; the MCP server saysmcpeven when started fromslm tool.tests/test_integration/test_slm_tool_real_daemon.py(10): one real isolated daemon (private port and data root) with anslm mcpstdio child beside it. Memory, pictures (tiny PNG), mesh send + inbox + wait between two agent ids, code graph on a tiny repo, and a learning signal give the same result shape through both doors;media_upload_linkstays refused (not_for_local) through both; every daemon request fromslm toolcarriesX-SLM-Channel: cliwithSLM_CLIENT_CHANNEL=mcpin its environment while the MCP child (control) carriesmcp; achannelargument is refused before any request; anagent_idargument is recorded asclaimed_agent_idwith the connection's agent kept;set_modenever loads the stdio server.set_modereset hook; the forcedmcpchannel.tests/mcp,tests/test_mcp,tests/cli,tests/test_cli, CLI subparsers, plugin, plugin-src, hooks (codex assets), installers, CI guards, governance, docs-vs-implementation. Updated for the new skill and command: skill lists and counts in the codex/muse/vscode/hermes tests, the Hermes command inventory (toolis marked high-impact there), and the npm entry-count ceiling (300 -> 400: each plugin tree carries one more skill).node scripts/build-all-plugins.mjs --checkandpython scripts/build_cli_skill.py --checkare in sync.main):tests/mcp/test_loop_receipt_races.py::test_postexecution_job_refusal_never_publishes[expired], the native hook deadline tests,test_doctor_health_verdicts::test_deadline_text_mode_names_check_and_exits_one.Not in this PR
mcp(the tool layer's gates say so), while the decision channel iscli. That never grants more than MCP allows; giving the gates a per-host transport is a separate change incore/admission.🤖 Generated with Claude Code