Skip to content

feat: tole mcp — expose tole's tools as an MCP server (Phase D1) #94

Closed

Description

@ajianaz

What problem does this solve?

Today tole only consumes MCP (client, #74) — the ecosystem mesh is one-directional. cora-code serves 18 tools over MCP, uteke serves uteke-mcp; tole's hardened tools (jailed file ops, argv-validated git, detached jobs, memory loop) are locked inside the CLI process. Any other agent (ZCode, Claude, GLM-based clients) that wants tole's capabilities has no way in.

Proposed solution

A tole mcp subcommand: tole runs as an MCP server over stdio (rmcp ServerHandler — the same crate already used for the MCP client).

  • tools/list ← ToolRegistry::specs() (the JSON shape is already MCP-compatible).
  • tools/call ← Tool::execute — the real jailed/hardened implementations.
  • Approval policy in server context: no stdin human exists, so the interactive approver is replaced by explicit pre-authorization — ReadOnly tools always callable; Write tools require --allow <glob> (the existing flag); Destructive tools are structurally absent (registration requires an interactive approver — the three-layer invariant holds unchanged).
  • Scope (phase D1 only): registry tools only. mcp_* client tools are excluded from the listing (no nesting). Agent-level session tools (session_run etc.) are intentionally deferred to D3 (tole-serve).

Acceptance criteria

  • tole mcp serves initialize/tools/list/tools/call over stdio (verifiable with an MCP inspector or in-process rmcp client).
  • Default server (no flags): only ReadOnly tools listed. --allow patterns expose Write tools. Destructive never listed.
  • Unit tests: registry→tools/list mapping, tools/call routing, Destructive exclusion.
  • Docs: README ecosystem section + CONTRIBUTING note; CHANGELOG entry.

Alternatives considered

  • HTTP transport now — deferred to D3 (tole-serve); stdio first matches how editors/agents spawn MCP servers.
  • Hand-rolled JSON-RPC — rmcp already in the dependency tree as a client; reusing its server side avoids a second implementation.

Notes

  • Tracks the approved D1 of the integration-surfaces plan (proposal in PR discussion, 2026-09-18). D2 (ACP host) and D3 (tole-serve) follow.
  • Estimate: S–M.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions