Repository navigation
mcp: accept sse / streamable-http / stdio hub transports (was HTTP-only) - #219
Merged
Merged
Conversation
…nly)
`pasclaw mcp catalog` printed
(showing built-in 5 entries)
(10 hub entry/entries skipped -- non-HTTP transports not supported yet)
because PasClaw.MCP.Hub.ProjectHubEntryToCatalog rejected every entry
whose transport field wasn't literally "http". In practice the
pasclaw.dev registry publishes nine entries with transport: "sse"
(remote HTTP endpoints that stream responses as text/event-stream) and
one with transport: "stdio" -- all ten were dropped.
The interesting nuance: TMCPHttpClient already speaks the MCP
Streamable HTTP transport (2025-03-26 spec) and Accepts both
application/json and text/event-stream response bodies. So those nine
SSE rows would have CONNECTED if we'd let the install path through. The
strict "transport != http -> skip" check was just stale spelling
discipline, not a real protocol gap.
This PR:
- Accepts http / sse / streamable-http / stream as remote-HTTP-class
transports; they project to the same TMCPCatalogEntry shape (URL +
EnvVar + AuthFmt) and route through TMCPHttpClient. The hub's
literal transport string is preserved on Entry.Transport so the
catalog display can flag SSE rows -- helpful when an older-spec
server doesn't quite cooperate, the operator wants to know.
- Accepts stdio: maps hub fields { command, args[] } into new
TMCPCatalogEntry.Cmd + CmdArgs slots. JoinHubArgs flattens the args
array into space-separated form (the same convention
`pasclaw mcp add` already uses), and DoInstall persists them into
Cfg.MCPServers as Cmd + Args -- TMCPStdioClient picks them up via
the existing ://-vs-not heuristic in PasClaw.MCP.Bridge.
- DoInstall now branches on CatalogEntryIsStdio: stdio entries skip
the Authorization-header handling (the binary reads env vars
itself) but DO surface a warning when the hub-flagged required env
var isn't set in the spawning shell.
- `pasclaw mcp catalog` shows a new transport column. Bundled
KnownMCPServers rows default to "http" so the column never looks
blank.
- Truly unknown transports (e.g. websocket) still reject with a
clearer "transport X not supported" message; the count surfaces
in the existing skip line.
New unit: 11-case mcp_hub_projection_tests.pas pins the contract for
each transport branch (including missing-slug / missing-endpointUrl /
missing-command rejections) so a future tightening doesn't silently
re-drop SSE entries.
https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e3ed83e5a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Self-audit while waiting on Codex review: JoinHubArgs was joining the hub's argv slots with a bare space. The other side of the trip is PasClaw.MCP.StdioClient.SplitArgs, which splits on unquoted whitespace and honors paired single + double quotes -- so a hub arg of "--prompt say hello" would JOIN as `--mode --prompt say hello` and re-SPLIT into four tokens, and the spawned MCP server would see a broken flag. Fix: QuoteForSplitArgs wraps args containing whitespace in double quotes (or single quotes if the arg already contains a double quote, and falls through to the worse-of-two double-quote wrap when the arg contains both). The MCP servers we route through here ship short flag-shaped argv, so the both-quote-kind case never appears in practice. New test (TestStdioArgsWithWhitespaceRoundTripSafely) pins the contract with an arg that previously would have re-split incorrectly. https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon
2 of 4 tasks
FMXExpress
pushed a commit
that referenced
this pull request
Jun 13, 2026
Both changelog files were stuck at the 2026-06-10 TUI / background- subagent / session_search / tool-RPC entries. ~7 weeks of merged PRs (#214 through #244) had landed without a corresponding entry in either file -- the git log was the only record of features like the knowledgebase, inbound MCP server mode, checkpoints + /undo, heartbeat daemon, shell backends (local | docker), send_message, promptware defense, Windows shell-output encoding fixes, fs_grep ripgrep optimisations, OpenTelemetry traces, and `pasclaw agent --quiet`. Added (newest first): 2026-06-13 #244 agent --quiet log-level clamp 2026-06-12 #243 dcc64 search path + agent --quiet / -q #242 OpenTelemetry traces (OTLP/HTTP+JSON) #241 fs_grep tier 5+6 (byte walker + Boyer-Moore-Horspool) #240 fs_grep tier 1-4 (deferred hash + skip-dirs + binary sniff + size cap) 2026-06-11 #239 Windows shell output: auto-detect UTF-8 vs OEM #238 Hashline fs_read header mojibake fix (¶ vs ¶) #237 Windows shell output: OEM codepage decode 2026-06-10 #233 Shell backends (local | docker via IShellBackend) #232 Heartbeat daemon + reversible condensation (CCR) #230 send_message tool + condenser families + promptware defense + task-aware MEMORY.md slicing 2026-06-09 #223 /goal Ralph loop + judge model + JSON-aware condenser #222 /undo wired into agent + sample dprojs #221 Checkpoints (auto-snapshot + TUI /undo) #220 mcp catalog: lenient hub projector #219 mcp: SSE / Streamable HTTP / stdio hub transports #218 Inbound MCP server mode #217 onboard: offer to index docs into the knowledgebase #214 Knowledgebase (RAG over operator-curated docs) Skipped from this changelog (build-system / Delphi-fix / FPC-fix PRs visible in the git log but not user-facing features): #215, #216, #224, #225, #226, #227, #228, #229, #231, #234, #236. Both files (README.md and docs/changelog.md) updated with the same entries -- intentional mirror so a reader on either surface sees the same history. Same prose in both; same footnote refs at the bottom. Validated: every [#N] reference in both files has a matching [#N]: URL footnote (no broken links).
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.
Why the 10 entries were skipped
pasclaw mcp catalogprinted(10 hub entry/entries skipped -- non-HTTP transports not supported yet)and fell back to the bundled 5 becauseProjectHubEntryToCatalogstrictly requiredtransport: "http". In practice the pasclaw.dev hub publishes:transport: "sse"— remote HTTP endpoints that stream responses viatext/event-stream.transport: "stdio"— a binary you spawn locally.TMCPHttpClientalready speaks the MCP Streamable HTTP transport (2025-03-26 spec) andAccepts bothapplication/jsonandtext/event-streamresponse bodies. So those 9 SSE rows would have connected if we'd let install through. The strict check was stale spelling discipline, not a real protocol gap.What this PR does
http/sse/streamable-http/streamas remote-HTTP-class transports; they project to the sameTMCPCatalogEntryshape (URL + EnvVar + AuthFmt) and route throughTMCPHttpClient. The hub's literal transport string is preserved onEntry.Transportso the catalog display can still flag SSE rows.stdio: maps hub{ command, args[] }into newTMCPCatalogEntry.Cmd+CmdArgsslots.JoinHubArgsflattens the args array into space-separated form (same conventionpasclaw mcp addalready uses), andDoInstallpersists them intoCfg.MCPServersasCmd+Args—TMCPStdioClientpicks them up via the existing://-vs-not heuristic inPasClaw.MCP.Bridge.DoInstallbranches onCatalogEntryIsStdio: stdio entries skip the Authorization-header dance (the binary handles auth itself) but DO surface a warning when the hub-flagged required env var isn't set in the spawning shell.pasclaw mcp catalogshows a newtransportcolumn. BundledKnownMCPServersrows default tohttpso the column never looks blank.websocket) still reject with a clearer"transport X not supported"message; the count surfaces in the existing skip line.Files
src/pkg/mcp/PasClaw.MCP.Catalog.pas—Transport/Cmd/CmdArgsfields onTMCPCatalogEntry; newCatalogEntryIsStdiopredicate.src/pkg/mcp/PasClaw.MCP.Hub.pas—ProjectHubEntryToCatalogrewritten + exposed at interface scope so tests can pin it;JoinHubArgshelper forargs[]flattening.src/cmd/PasClaw.Cmd.MCP.pas—DoInstallroutes by transport;DoCatalogshows transport column; newTransportLabelhelper.src/tests/mcp_hub_projection_tests.pas— 11 cases covering each transport branch and every reject path (missing slug / endpointUrl / command, unknown transport).Makefile— newtest-mcp-hub-projectiontarget wired into the umbrellatest.Test plan
make test— full suite green incl. newtest-mcp-hub-projection(11/11)make test-mcp-serverstill green (no surface area collision with the new fields)pasclaw mcp catalogsmoke (live, in this sandbox: hub unreachable due to no libssl — falls back to the bundled 5 in the new column format)pasclaw mcp catalogagainst the real hub on a box with OpenSSL: should now show the 9 SSE + 1 stdio rows + bundled 5https://claude.ai/code/session_01TBcLtmpj7dqA5tyFbGnQon
Generated by Claude Code