feat: embed sprout CLI in dev-mcp, add NIP-OA auth tag support#525
Merged
Conversation
Expose sprout-cli as a library crate and embed it in sprout-dev-mcp using the same multi-call binary pattern as rg and tree. When the agent runs `sprout list-channels` through the shell tool, the dev-mcp binary handles it in-process — no external binary needed. Also adds NIP-OA auth tag support to the CLI, bringing it to parity with sprout-mcp: SPROUT_AUTH_TAG is parsed, Schnorr-verified at startup, injected into every signed event via SproutClient::sign_event(), and sent as an x-auth-tag HTTP header on all REST requests. sprout-cli remains independently usable as a standalone binary. The --auth-tag / SPROUT_AUTH_TAG flag is optional and backwards compatible — when absent, behavior is unchanged.
0c082b0 to
a973a7e
Compare
This was referenced May 28, 2026
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
Expose
sprout-clias a library crate and embed it insprout-dev-mcpusing the same multi-call binary pattern asrgandtree. Add NIP-OA auth tag support to the CLI, bringing it to parity withsprout-mcp.CLI as a dev-mcp shim
When an agent runs
sprout list-channelsthrough the shell tool, the dev-mcp binary recognizesargv[0] = "sprout"and handles it in-process — no external binary to install or discover.sprout-cligains a[lib]target exposingpub async fn run_from_args()sprout-dev-mcpaddssproutas a symlink alongsidergandtreein the shim tempdirsproutis on PATHSPROUT_RELAY_URLandSPROUT_PRIVATE_KEYare setThe standalone
sproutbinary continues to work independently —main.rsis a thin wrapper calling the library.NIP-OA auth tag support
The CLI now has full parity with
sprout-mcpfor owner attestation:SproutClientgainssign_event()— injects the NIP-OA auth tag into every signed event before signing, with post-sign count enforcement (same pattern asRelayClient::sign_event()in sprout-mcp)x-auth-tagHTTP header sent on all REST requests (/query,/events,/count,/media/upload) so closed relays accept delegated agents--auth-tag/SPROUT_AUTH_TAGparsed and Schnorr-verified at startupsign_with_keyscall sites across 7 command modules replaced withclient.sign_event()The auth tag is optional and backwards compatible — when absent, behavior is unchanged. The env var is the same one the ACP harness already forwards.
Other fixes
commands/pack.rs: replaced 5process::exit(1)calls withreturn Err(CliError::Usage(...))— these would have killed the host MCP server process when the CLI is embeddedWhy
The sprout MCP server exposes 49 tools with full JSON schemas to the LLM on every conversation turn. For a dev-mcp agent that primarily writes code and occasionally interacts with Sprout, that is a lot of permanent context overhead. Shipping the CLI as a shim means the agent sees one
sproutmention in the shell tool description, runssprout --helpwhen it needs to, and discovers commands on demand.The CLI uses stateless HTTP with NIP-98 auth — simpler and more resilient than the MCP's persistent WebSocket with NIP-42 reconnection logic. Per-request latency is noise against agent think time.
Testing
-D warnings)sproutCLI 11 times through the dev-mcp shell tool (create-channel, send-message, get-messages, list-channels, join-channel, etc.)