Repository navigation
Add McpTest in-memory client for McpServer registrations - #9657
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 9d948d7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
Adds the McpTest.makeClient signature and Client interface for an in-memory MCP client over registrations, plus three focused tests that fail against the unimplemented stub. Implementation and stdio harness migration follow.
effect-bot
force-pushed
the
agent/nelson/bbf7978d0011
branch
from
October 21, 2026 08:16
4122181 to
9d948d7
Compare
Merged
tim-smart
added a commit
that referenced
this pull request
Oct 21, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 21, 2026
effect-bot
pushed a commit
to lloydrichards/open_effect
that referenced
this pull request
Oct 21, 2026
effect-bot
pushed a commit
to lloydrichards/open_effect
that referenced
this pull request
Oct 21, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 21, 2026
tim-smart
added a commit
that referenced
this pull request
Oct 21, 2026
tim-smart
added a commit
that referenced
this pull request
Oct 21, 2026
tim-smart
added a commit
that referenced
this pull request
Oct 21, 2026
tim-smart
added a commit
that referenced
this pull request
Oct 21, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 21, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 21, 2026
effect-bot
pushed a commit
to lloydrichards/open_effect
that referenced
this pull request
Oct 21, 2026
effect-bot
pushed a commit
to lloydrichards/open_effect
that referenced
this pull request
Oct 21, 2026
effect-bot
pushed a commit
to lloydrichards/open_effect
that referenced
this pull request
Oct 21, 2026
effect-bot
pushed a commit
to lloydrichards/open_effect
that referenced
this pull request
Oct 21, 2026
effect-bot
pushed a commit
to lloydrichards/open_effect
that referenced
this pull request
Oct 21, 2026
effect-bot
pushed a commit
to lloydrichards/open_effect
that referenced
this pull request
Oct 21, 2026
effect-bot
pushed a commit
to lloydrichards/open_effect
that referenced
this pull request
Oct 21, 2026
tim-smart
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
tim-smart
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 23, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 23, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 23, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 23, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 23, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 23, 2026
tim-smart
added a commit
that referenced
this pull request
Oct 24, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 24, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 25, 2026
effect-bot
pushed a commit
that referenced
this pull request
Oct 25, 2026
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.
Adds
effect/ai/McpTest, an in-memory client for testingMcpServerregistrations without opening a transport.makeClientbuildsMcpServer.layerover an in-memoryRpcServer.Protocol. Both directions go throughRpcSerialization.jsonRpc(), so requests, results and MCP errors take the same JSON-RPC encoding as stdio and HTTP. For stateful protocols the client sendsinitializeandnotifications/initializedbefore it returns. Forv2026_07_28it attaches the request metadata to every request instead.Transport built-ins are discharged the same way as
layerStdio.McpRequestContextis always provided, andMcpServerClientonly when every configured adapter is stateful. Other request markers still have to come from MCP middleware.The client has typed
listTools/callTool/readResource/getPrompt/complete(plus the rest ofClientRequestRpcsexceptinitialize). It also exposes anotificationsqueue in wire encoding and the runningMcpServerservice. Interrupting a call sendsnotifications/cancelled. Server-to-client requests such as elicitation or sampling are answered with method-not-found, so a handler that sends one doesn't hang.Behaviour worth knowing:
initialize. Each session records the server's list-change revision when it initializes, and delivery skips older revisions. This applies to stdio, HTTP (keyed byMcp-Session-Id) and custom transports. Before, a registration-timelist_changedcould race the handshake and reach the client.resources/updatedis only delivered to clients subscribed to that URI, as on the real transports.Tests
McpTest.test.tscovers a negotiated tool call through middleware, a middleware MCP error, subscribed notifications, startup ordering with McpServer's dispatcher held until after the handshake, and a capability-enabled reverse request getting method-not-found.McpServer.test.tsadds HTTP regressions for the initialize boundary: post-initialize changes reach every session, and pre-initialize changes don't.Programmatic registration tests now use
McpTestinstead of hand-building a client:makeToolkitTestClient(16registerToolkittests) drops its HTTP harness,RpcClientand manualinitialize.registerToolkiteffect-form tests for non-strict parameter errors, declaredErrorfailures and failure origins no longer provideMcpServerClientby hand.RequestDependencies.test.tsdrops its hand-builtMcpServerClient.notifyElicitationCompletereturn tests no longer use the stdio harness.These stay on their existing setup on purpose:
direct servicetests and the remainingMcpServer.maketests, since they test theMcpServerservice API itself, including identity of typed failures and stringstructuredContent, which a wire round-trip can't keep.subscriptions/listentests, sinceMcpTest.Clientdoesn't support either.Closes EFF-2137