Repository navigation
Add the Mojito CLI spawn adapter - #1090
Open
ehoogerbeets wants to merge 1 commit into
Open
ehoogerbeets wants to merge 1 commit into
ehoogerbeets wants to merge 1 commit into
Conversation
2 tasks
ehoogerbeets
added this pull request to stack #1102
September 24, 2026 23:04
Pin env parsing, captured stdio, timeouts, and spawn failures before any REST mapping is introduced. Co-authored-by: Cursor <cursoragent@cursor.com>
ehoogerbeets
force-pushed
the
mcp-03-cli-adapter
branch
from
October 5, 2026 22:23
8c5e55a to
0a46e75
Compare
This branch has not been deployed
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 this adds
The spawn layer every later MCP tool sits on. This PR does not yet expose any Mojito APIs to an agent; it is the plumbing that lets the MCP server talk to Mojito through the operator's existing CLI instead of inventing its own auth or HTTP client.
Why spawn the CLI
Mojito already has a CLI (
mojito-prod/mojito-dev) whoseapisubcommand is authenticated against the right host. Reusing that CLI means:MOJITO_CLIWhat it does
On each tool call the server will spawn
{MOJITO_CLI} <argv>, capture stdout/stderr (never inherit them onto MCP stdio — that would corrupt the JSON-RPC transport), and apply a hard timeout (default 10 minutes). If the child hangs, it gets SIGTERM then SIGKILL two seconds later. Failures become aMojitoCliErrorthat carries exit code, both streams, and a timeout flag so the agent can tell "CLI not installed" apart from "Mojito returned HTTP 400".Config is two env vars:
MOJITO_CLI(wrapper name or path; blank/whitespace falls back tomojito-prod) andMOJITO_CLI_TIMEOUT_MS(positive whole milliseconds only; anything else, including0or"Infinity", falls back to the default so a typo cannot disable the timer).Stack
Depends on the scaffold PR. Next: the first real tools — repository list/view and pollable-task get.
Test plan
cd mojito-mcp && pnpm testMade with Cursor
Made with Cursor