Skip to content

feat: add MCP server capability - #3

Open
automixer wants to merge 1 commit into
johunsang:mainfrom
automixer:mcp-server
Open

automixer wants to merge 1 commit into
johunsang:mainfrom
automixer:mcp-server

Conversation

@automixer

Copy link
Copy Markdown

Add an MCP server mode ( semble_rs serve ) so coding agents discover and call semble as native, self-describing tools instead of relying on prompt nudging and shell invocations. This removes the two friction points that hold back adoption
today: models hesitate to invoke unfamiliar CLI binaries, and bash tool calls require quoting patterns like "fn $name($$$)" through a shell. MCP makes the tools appear in the agent's tool list with typed JSON schemas and lets hosts
auto-approve read-only calls.

The server runs over stdio JSON-RPC 2.0 with zero new dependencies, exposing search, tree, deps, impact, find_pattern, find_related, and plan — the full read-only query surface.
digest and savings stay CLI-only (digest is a pipe; the log would already be in context before an MCP tool could compress it). Statelessness is preserved: every call reindexes the target path, just like the CLI. The embedding model warms up at startup in a background thread, so the first tool call doesn't hit a host timeout.

CLI usage is unchanged — the printers were extracted into shared render functions that are reused by both front-ends.

Add `semble_rs serve`, a stdio MCP (Model Context Protocol) server that
exposes search, tree, deps, impact, find_pattern, find_related, and plan
as self-describing tools for coding agents. Stateless like the CLI:
every tool call re-indexes the target path fresh.

- src/mcp.rs: JSON-RPC 2.0 protocol layer with version negotiation,
  background model warm-up, per-call panic isolation, typed argument
  validation, and protocol-level tests
- src/render.rs: extract shared string renderers from main.rs so the
  CLI and MCP server reuse the same output formats (stdout is reserved
  for protocol messages in stdio transport)
- src/plan.rs: add format_plan returning a String
- README: document MCP setup for Claude Code and JSON-config hosts
- .gitignore: add .idea/ and .DS_Store

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant