Repository navigation
LOU-Z3: expose an agent (and its tools) as an MCP server - #52
Merged
Merged
Conversation
Adds serveMcp() to the ./mcp subpath: serves a createAgent() agent as one
MCP tool ({ message }), optionally exposing defineTool() tools directly,
over stdio or stateless Streamable HTTP (127.0.0.1 by default, optional
bearer auth reusing checkWebhookAuth, warning on unauthenticated
non-loopback binds). MCP request cancellation aborts the agent run; agent
failures and approval pauses return isError. needsApproval tools are not
exposed unless allowApprovalTools is set. Adds `loushy mcp <spec>
[--http --port --host]` plus docs and a README bullet.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
serveMcp({ agent, name, description, tools, transport })(from@loushy/build-ai-agent/mcp) andloushy mcp <agent.yaml|json> [--http --port N --host H].Why
Makes a Loushy agent callable from Claude Code, Cursor and other MCP clients.
How verified
npx tsc --noEmit: cleannpm run lint: 0 errors, no new warningsnpm run build+ create-loushy-agent build: successnpm run test:coverage: 100 files passed, 1314 tests passed, 3 skippednpm run fallow: exit 0npm run docs:verify-snippets: all 34 snippets type-check, 5 run cleanlynode bin/loushy.js mcp s.jsonanswered aninitializeover stdio with only protocol JSON on stdoutNotes for reviewer
isError.createAgent()has no approval store, so such a run actually fails with the executor's "requires approval" error; theawaiting-approvalbranch is tested with a stub agent.checkWebhookAuthfromsrc/triggers/webhookAuth.ts.tsup.config.ts,.fallowrc.json,bin/loushy.js(USAGE + command),docs/configuration.md,README.md.serveMcpis verified manually, not in unit tests.🤖 Generated with Claude Code