Skip to content

feat: share runtime with MCP clients - #193

Closed
parvahuja wants to merge 11 commits into
parv/httpx-instrumentation-v0.15from
parv/runtime-mcp-v0.16
Closed

feat: share runtime with MCP clients#193
parvahuja wants to merge 11 commits into
parv/httpx-instrumentation-v0.15from
parv/runtime-mcp-v0.16

Conversation

@parvahuja

@parvahuja parvahuja commented Jul 28, 2026

Copy link
Copy Markdown
Member

Stack 8 of 8 · depends on #192 · top of stack

Summary

Let explicit MCP clients share a PaymentRuntime, including origin policy, shared events, committed-retry close protection, repeated-challenge protection, and fail-closed handling for uncertain payment outcomes.

MCP session calls stay on the caller loop; credential and event work use the runtime-owned loop. Sync close is guarded inside a running caller event loop, while await client.aclose() is the safe async lifecycle path.

Scope

This is explicit MCP client integration only. It intentionally excludes global MCP instrumentation, speculative successful-response refetch hooks, and receipt extensions.

Validation

  • 948 passed, 41 skipped
  • 49 MCP tests pass against the minimum supported MCP SDK 1.19.0
  • all 36 HTTPX adapter/instrumentation cases pass on HTTPX 0.27.0–0.28.1
  • built-wheel public smoke covers sync/async HTTP, adapters, global instrumentation, MCP payment retry, loop ownership, and clean shutdown
  • Ruff, formatting, Pyright, diff checks, and Python 3.11–3.14 CI pass

Managed as a stacked change with GitHub Stacks.

@parvahuja
parvahuja force-pushed the parv/httpx-instrumentation-v0.15 branch from a59c50b to 89283ac Compare July 28, 2026 18:26
@parvahuja
parvahuja force-pushed the parv/runtime-mcp-v0.16 branch from d26a6d0 to f6be64c Compare July 28, 2026 18:28
@parvahuja
parvahuja force-pushed the parv/httpx-instrumentation-v0.15 branch from 89283ac to e2ff779 Compare July 28, 2026 23:29
@parvahuja
parvahuja force-pushed the parv/runtime-mcp-v0.16 branch from f6be64c to 7ca8634 Compare July 28, 2026 23:34
@parvahuja
parvahuja force-pushed the parv/httpx-instrumentation-v0.15 branch from e2ff779 to d6fe846 Compare July 29, 2026 00:44
@parvahuja
parvahuja force-pushed the parv/runtime-mcp-v0.16 branch from 7ca8634 to 911d312 Compare July 29, 2026 00:44
@parvahuja
parvahuja force-pushed the parv/httpx-instrumentation-v0.15 branch from d6fe846 to 8767e4f Compare July 29, 2026 01:02
@parvahuja
parvahuja force-pushed the parv/runtime-mcp-v0.16 branch from 911d312 to 66958a3 Compare July 29, 2026 01:02
@parvahuja
parvahuja force-pushed the parv/httpx-instrumentation-v0.15 branch from 8767e4f to bcd4a11 Compare July 29, 2026 03:33
@parvahuja parvahuja closed this Jul 29, 2026
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.

1 participant