Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
865c09c to
6ec5008
Compare
557f498 to
d758d10
Compare
d758d10 to
ec9adb7
Compare
ec9adb7 to
45e93d7
Compare
45e93d7 to
d62160b
Compare
d62160b to
04992b4
Compare
Configure one remote read engine for resources and explicitly approved tools. Keep protocol evidence separate from source authorization and publication, and qualify transport limits, revocation and cancellation with synthetic SDK servers. Signed-off-by: zlareb1 <[email protected]>
A cancelled response waiter leaves the SDK HTTP task alive. Give each open client a lifecycle owner, join its shutdown before returning cancellation, and retain the session deadline through idle time. Verify stream cleanup, repeated cancellation and isolation from other clients. Signed-off-by: zlareb1 <[email protected]>
Join the SDK lifecycle owner after every operation failure, including request deadlines and cancellation after a background refusal. Preserve the first caller cancellation while draining stream finalizers and the HTTP pool. Signed-off-by: zlareb1 <[email protected]>
Reject schema keywords outside their declared type and validate with an explicit registry that cannot retrieve external resources. Retain response cleanup through authority checks and join its finalizer outside the work deadline when handoff fails or is cancelled. Signed-off-by: zlareb1 <[email protected]>
Check session state and total expiry around authority callbacks and publication so background HTTP failures cannot yield successful read evidence. Scope issued cursors by operation and query and accept an absent optional final-page cursor. Signed-off-by: zlareb1 <[email protected]>
Record HTTP status and media failures before the SDK can consume background errors. Preserve optional GET and DELETE responses with status 405. Distinguish omitted mapped cursors from present invalid values during page normalization. Signed-off-by: zlareb1 <[email protected]>
Use the HTTP client normalization for audience and endpoint checks and refuse pin helpers that change the authorized Host or TLS name. Signed-off-by: zlareb1 <[email protected]>
Keep foreground closed-session calls terminal while joining pending SDK notification work. Cover discovery-only resource and action-only servers without extra RPCs. Signed-off-by: zlareb1 <[email protected]>
04992b4 to
655ac4f
Compare
A session deadline can start closing the SDK and HTTP pool before a caller exits or tries another read. Joining the existing teardown keeps that caller from cancelling the pool finalizer and losing the timeout. Signed-off-by: zlareb1 <[email protected]>
|
The pool cleanup fix is at The previous hosted run concluded with failed unit shard 4 and Postgres 18 storage jobs. Those results remain failures tied to the previous head. Fresh whole-source review and required hosted checks are pending for this commit. |
A live event stream can hold the connection needed for session termination. The owner joins SDK dispatch before DELETE and keeps private response-finalizer failures behind fixed error codes. Merge current main and regenerate the dependency lock to restore hosted checks. Signed-off-by: zlareb1 <[email protected]>
|
At The preceding head conflicted with |
|
Independent source review of
This review is tied to the superseded commit. The cases are being checked against the current commit before the next fix. An independent review of the current commit and the required CI run are separate; its |
The SDK types the negotiated version as a string or integer. Session termination sends that value in an HTTP header, which accepts text. Signed-off-by: zlareb1 <[email protected]>
A catalog change invalidates discovery, and a rejected read keeps its original failure through session cleanup. Validate tool mappings before opening a session so the read receipt can identify the approved configuration. Signed-off-by: zlareb1 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 30593c8. Configure here.
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
|
Independent agent review approved |
…rces Signed-off-by: zlareb1 <[email protected]>
|
Refreshed this PR on the current main. The client, tests and dependency lock are unchanged. The documentation index matches its generator on the new base. The focused client, cancellation, protocol and network tests passed, along with Ruff, the function length gate, strict type checking and offline lock verification. Fresh independent review and hosted checks are running on this head. |
|
Fresh independent review approved |
|
The integration shard on Job: https://github.com/ClickHouse/loom/actions/runs/45873973784/job/140096349424 #1495 scopes the separate Postgres batching test to the query log. The SCIM fixture needs the same targeted flush and a passing hosted run. Its physical-work assertions should stay intact. |

Related: #1189
Related: #1190
Related: #1068
Changelog category (leave one):
Changelog entry
Add the internal read client for configured remote MCP document sources. Resource reads and explicitly mapped read tools share bounded transport, schema checks and normalized evidence.
Why
A shared outbound client lets source integration configure a protocol endpoint and approved reads rather than add another API connector. Protocol compatibility does not establish permission, complete enumeration or synchronization support.
This PR covers the internal outbound client. Loom continues to expose document, source, memory and code operations through one existing inbound MCP endpoint and operation registry. The companion worker integration owns outbound requests and credentials. This PR does not add another inbound server, register document operations, or wire core to upstream services.
Scope and risk
The official maintained protocol SDK supplies remote Streamable HTTP. Configuration pins an HTTPS endpoint, credential origin/audience, approved tool names and schemas, fixed scope arguments and selected resource identities. Listing/search produce candidates; discovery snippets cannot substitute for a successful selected read. Descriptions and read-only hints grant no authority.
The transport reuses vetted DNS, preserves the approved Host/TLS identity, refuses redirects and environment proxies, bounds requests/results/pages/bytes/time, and rechecks current caller authority. A read receipt identifies the requested resource and hashes the returned text and validated client configuration. The caller authorizes the connection separately. Citation links are never fetched. Errors expose bounded codes under existing private-work handling. The integrating source layer remains responsible for owner/tenant binding, protected publication, accounting and storage.
Discovery-only sessions close without treating a queued initialization notification as a foreground request. Closing transport background dispatch is cancelled only for the normal closed-state condition. Foreground closed-session calls and observed authorization/protocol failures remain terminal. No extra flush RPC, sleep or private SDK patch is used.
Supported content is text resources and explicitly mapped structured tool output under the documented schema subset. Binary resources, unstructured-only tools, interactive authorization/refresh, local commands and legacy transports are unsupported. Synthetic servers establish no external-service qualification. Partial pages, errors and notifications prove neither deletion nor ACL completeness. Live work imports nothing.
The maintenance SDK line avoids automatic upstream-error telemetry without a public per-client suppression facility. There is one SDK path, with no tracer patch or version fallback. The architecture page records these boundaries.
Compatibility, rollout and rollback
ignored_argschange.The replacement still requires an old-build refusal and owner-led reconfiguration contract. A source kind alone is not rolling-upgrade proof. No existing credential is sent to an inferred endpoint.
Tests
The four focused client, cancellation, protocol, and network test files pass 299 cases with MCP SDK 1.30.0. The tests cover catalog changes during pagination, boolean and numeric schema pins, missing tool capabilities, and invalid read selectors. They also cover receipt size validation before connection, preservation of a denial through cancellation, deadline failure during pool cleanup, and rejection of HTTP 202 for a read request. Additional regressions cover exact native URI spelling, refusal of URI credentials, valid hostless resources, a required search selector, a catalog change during final authorization, refusal before dispatch when the tool catalog changes during transport authorization, and refusal of HTTP 200 or a nonempty HTTP 202 for notifications. Ruff, strict mypy for the client, and the repository function-length gate pass.
Hosted CI and fresh review on the candidate commit are pending. These tests use synthetic sources.
AI assistance in the code
AI-generated: Codex wrote most of the diff. Independent source review and exact-head hosted results are reported before merge.
I can explain the change and its integration boundaries.
Checklist
Note
Medium Risk
New outbound HTTP path with credential handling and strict validation reduces blast radius, but mistakes in future source wiring could still leak upstream data or bypass publication rules if access checks are omitted.
Overview
Introduces an internal outbound MCP source client (
server/clients/mcp_source.py) so future document-source work can read from a single pinned HTTPS Streamable HTTP endpoint with normalized evidence, without yet changing registration, workers, or stored source kinds.The client enforces a fail-closed boundary: DNS pinning via existing
pinned_target, no redirects or inbound header forwarding, optional bearer tokens tied to endpoint audience, caller-suppliedvalidate_accessaround I/O, bounded limits (pages, bytes, timeouts), and fixed error codes that hide upstream secrets. Reads are limited to approved resource IDs and explicitly mapped tools with a restricted JSON Schema subset; discovery checks schema drift and tool-catalog changes before dispatch. Successful reads return receipts (content and config hashes); listing and search do not grant read authority.Dependencies add
mcp,jsonschema, andreferencing; architecture is documented indocs/architecture/mcp-source-client.md. Large unit and TLS network test suites cover cancellation draining, cursor rules, and protocol edge cases. No wire, migration, or dashboard integration in this PR.Reviewed by Cursor Bugbot for commit e7f6b7e. Bugbot is set up for automated code reviews on this repo. Configure here.