Repository navigation
Closed
Labels
enhancementNew feature or request
Description
What problem does this solve?
tole's tools are currently reachable via three hosts (CLI, tole mcp stdio, tole serve REST) — but all require the client to be on the same machine. MCP Streamable HTTP would make tole reachable from any MCP client on the network, and the multi-session routing design (one MCP connection → N tole sessions) is the flexible model: the agent opens/closes/switches sessions without reconnecting.
Proposed solution
A tole serve --transport mcp mode (or tole mcp-http) that serves the session host as MCP tools over Streamable HTTP (rmcp transport-streamable-http-server):
MCP tools exposed
| Tool | Params | What it does |
|---|---|---|
tole_session_new |
{cwd} |
Open a durable tole session, return session_id |
tole_session_prompt |
{session_id, text} |
Run one tole turn; returns stop_reason + final_text |
tole_session_status |
{session_id} |
entries count, busy flag |
tole_session_list |
— | all active session ids |
| (plus the registry tools: read_file, write_file, git, etc. — routed to the session's workspace) |
Design decisions
- Multi-session routing by session_id in tool arguments (approved 2026-09-28): one MCP connection authenticates once (bearer token), then the agent addresses sessions explicitly — no hidden per-connection state
- Sessions are durable server-side (JSONL in the session's workspace jail)
- The tool registry is cached per session (jail = session's workspace)
- Auth: static bearer token (same as D3 v1); TLS documented as reverse-proxy concern
- Busy session → 409-equivalent MCP error (turn serialized per session)
Implementation
- rmcp
transport-streamable-http-serverfeature (pulls axum/hyper — accepted dependency decision) - Reuse
RegistryServerhandler (from D1 feat: tole acp — Agent Client Protocol host (D2, issue #95) #130) +session_hostmachinery (from feat: tole serve — token-authenticated HTTP daemon (D3 v1, issue #96) #131) - Auth middleware: bearer token check in axum layer
Acceptance criteria
- MCP client connects over HTTP with bearer token, lists tools, calls
tole_session_new+tole_session_prompt - Multiple sessions concurrently from one client
- Durable sessions survive server restart (JSONL on disk)
- Token auth enforced on all MCP endpoints
- Integration test: MCP client over HTTP → full round-trip
Estimate
~1 day (rmcp server-side HTTP is well-supported; the session_host machinery is already tested).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
feat: multi-session MCP over Streamable HTTP (D3-lanjutan, #137) (#138)