Skip to content

fix(test): migrate e2e MCP tests from wrapper to FastMCP Client#4421

Merged
jonpspri merged 1 commit intomainfrom
jps-test-mcp-fixes
Apr 23, 2026
Merged

fix(test): migrate e2e MCP tests from wrapper to FastMCP Client#4421
jonpspri merged 1 commit intomainfrom
jps-test-mcp-fixes

Conversation

@jonpspri
Copy link
Copy Markdown
Collaborator

Summary

Why

The mcpgateway.wrapper sends each JSON-RPC message as an independent HTTP POST without tracking mcp-session-id. After transport hardening (#3344), the gateway strictly requires session IDs for post-initialize requests, breaking all wrapper-based tests.

Approach

The FastMCP Client handles MCP session lifecycle internally. Since the RBAC tests use Playwright sync fixtures (which own the event loop), async FastMCP calls are bridged via concurrent.futures.ThreadPoolExecutor + asyncio.run.

Related Issues

The mcpgateway.wrapper lacks MCP session management (#4419), causing all
post-initialize requests to fail with HTTP 400. Migrate RBAC transport
tests to use FastMCP Client which handles sessions properly.

- Replace wrapper subprocess helpers with sync wrappers around async
  FastMCP Client (thread pool bridge for Playwright event loop compat)
- Update tool call assertions for check_any_team=True behavior (#3687)
- Handle ambiguous resource URIs in protocol e2e test (#4418)
- Add E402 to ruff per-file-ignores for tests (pytest.importorskip)

Closes #4419

Signed-off-by: Jonathan Springer <jps@s390x.com>
@jonpspri jonpspri force-pushed the jps-test-mcp-fixes branch from 5d40c07 to 3c13bd1 Compare April 23, 2026 21:47
@jonpspri jonpspri merged commit de1d17b into main Apr 23, 2026
32 checks passed
@jonpspri jonpspri deleted the jps-test-mcp-fixes branch April 23, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: mcpgateway.wrapper lacks MCP session management — all post-initialize requests fail with HTTP 400

1 participant