Skip to content

[Protocol] Upgrade to MCP TypeScript SDK v2 and negotiate the 2026-07-28 era - #381

Merged
mohanagy merged 4 commits into
developmentfrom
feat/363-mcp-sdk-v2
Aug 11, 2026
Merged

[Protocol] Upgrade to MCP TypeScript SDK v2 and negotiate the 2026-07-28 era#381
mohanagy merged 4 commits into
developmentfrom
feat/363-mcp-sdk-v2

Conversation

@mohanagy

@mohanagy mohanagy commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Closes #363

Summary

  • Replace the monolithic MCP SDK v1 dependency with the v2 client, core, server, and frozen legacy-server packages.
  • Serve modern 2026-07-28 Streamable HTTP requests statelessly without initialize or session IDs while retaining initialized legacy HTTP sessions and stdio interoperability.
  • Export createMiftahServerFactory for embedding hosts and isolate modern request profile state.
  • Preserve Miftah-owned one-page upstream pagination and malformed stdio frame diagnostics under SDK v2.
  • Update OAuth issuer-bound callback handling, compatibility documentation, and changelog evidence.

Packaging and security

  • Bundle the Node/Hono serving adapter into the CLI with patched @hono/node-server 2.0.10 and Hono 4.12.34 because @modelcontextprotocol/node 2.0.0 still permits the vulnerable 1.x adapter in consumer installs.
  • Include exact upstream license files in the package artifact.
  • A fresh normal tarball install reports zero vulnerabilities and no installed @modelcontextprotocol/node, @hono/node-server, or hono runtime tree.

Local validation

  • npm test: 155 files, 1908 passed, 34 skipped
  • npm run test:coverage: 96.00% lines overall; all configured thresholds pass
  • npm run typecheck
  • npm run lint
  • npm run build
  • npm run smoke:cli
  • npm run check:pack: 55 files verified
  • npm run check:test-fixture
  • npm audit --omit=dev: zero vulnerabilities
  • npm audit: zero vulnerabilities
  • git diff --check

The full Linux, macOS, and Windows packaged-artifact matrix remains required before merge.

Summary by CodeRabbit

  • New Features

    • Added support for modern and legacy MCP protocol versions over STDIO and HTTP.
    • Added createMiftahServerFactory for trusted integrations.
    • Added stateless request handling with improved isolation and cancellation.
    • OAuth flows now preserve issuer information for safer authorization and token handling.
  • Bug Fixes

    • Improved shutdown, error reporting, and oversized-message handling.
    • Added clearer diagnostics for unsupported protocol revisions and serving failures.
  • Documentation

    • Updated serving, compatibility, authentication context, diagnostics, and integration guidance.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 11 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 033db4b9-eb2c-4a66-b733-784940a2fdd4

📥 Commits

Reviewing files that changed from the base of the PR and between 89d5564 and 4c20344.

📒 Files selected for processing (10)
  • CHANGELOG.md
  • docs/library-api.md
  • scripts/build-test-fixture.mjs
  • src/approvals/approval-continuation-store.ts
  • src/mcp/server/miftah-server.ts
  • src/mcp/server/operation-pipeline.ts
  • src/runtime/create-miftah-runtime.ts
  • tests/approval-continuation-store.test.ts
  • tests/mcp-v2-serving.test.ts
  • tests/mcp-wrapper.test.ts
📝 Walkthrough

Walkthrough

Miftah migrates to MCP v2 packages, supports modern and legacy protocol serving, adds server factories, updates OAuth issuer handling, and adjusts packaging, documentation, and interoperability tests.

Changes

MCP v2 serving and runtime

Layer / File(s) Summary
Server context and lifecycle
src/mcp/server/..., src/runtime/..., src/index.ts
MiftahServer uses MCP v2 contexts and lifecycle methods. The package exports createMiftahServerFactory.
Dual-era STDIO and HTTP serving
src/http/..., src/cli/main.ts, src/upstream/contained-stdio-transport.ts
Modern request-scoped handling is added while legacy sessions remain supported. Cancellation, concurrency limits, cleanup, and diagnostics are covered.
Upstream MCP client migration
src/upstream/..., tests/fixtures/..., tests/helpers/...
Upstream clients, transports, handlers, and error mapping use split MCP v2 packages.
OAuth issuer-bound authorization
src/oauth/..., src/upstream/upstream-process-manager.ts
Authorization results, stored client data, tokens, and completion flows now include issuer context and validate issuer bindings.
Packaging and release contracts
package.json, tsup.config.ts, scripts/..., tests/package-contract.test.ts
Dependencies, bundled licenses, package paths, security checks, and public export checks now reflect the new package layout.
Documentation and interoperability validation
CHANGELOG.md, docs/library-api.md, tests/mcp-v2-serving.test.ts, tests/*
Documentation describes protocol compatibility and embedding boundaries. Tests cover modern and legacy STDIO/HTTP serving, cancellation, unsupported revisions, OAuth behavior, and migrated client APIs.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MCPClient
  participant MiftahHttpServer
  participant McpServerFactory
  participant MiftahServer
  participant UpstreamSession
  MCPClient->>MiftahHttpServer: Send modern or legacy MCP request
  MiftahHttpServer->>McpServerFactory: Create serving server
  McpServerFactory->>MiftahServer: Prepare request-scoped server
  MiftahServer->>UpstreamSession: Route tool, resource, or prompt request
  UpstreamSession-->>MiftahServer: Return upstream result or cancellation
  MiftahServer-->>MiftahHttpServer: Return MCP response
  MiftahHttpServer-->>MCPClient: Send protocol response
Loading

Possibly related issues

  • #362 — The issue covers the same MCP 2026-07-28 dual-era serving, stateless isolation, OAuth, and factory objectives.

Possibly related PRs

  • mohanagy/miftah#378 — Defines the profile-context follow-up boundary that this PR enables through trusted server factories.
  • mohanagy/miftah#379 — Directly overlaps in modern stateless serving and authenticated request-context handling.
  • mohanagy/miftah#380 — Directly overlaps in MiftahServer and runtime factory changes.

Suggested labels: area:mcp, documentation

Poem

I’m a rabbit with packets to send,
Through modern and legacy paths they wend.
Issuers hop safely, servers bloom,
Tests guard each protocol room.
MCP carrots now grow in the build—
Clean, bundled, and properly sealed.


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Docstring Coverage ❌ Error Docstring coverage is 34.38% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the MCP SDK v2 upgrade and 2026-07-28 protocol-era negotiation, which are the main changes.
Description check ✅ Passed The description includes the required summary, security impact, validation results, and remaining release-gate status.
Linked Issues check ✅ Passed The changes satisfy the coding objectives in [#363], including SDK v2 migration, modern and legacy serving, cancellation, diagnostics, and documentation.
Out of Scope Changes check ✅ Passed The packaging, licensing, fixture, test, OAuth, and documentation changes support the migration and its security and compatibility requirements.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/363-mcp-sdk-v2

Comment @coderabbitai help to get the list of available commands.

@mohanagy

Copy link
Copy Markdown
Owner Author

CI install failure root cause and fix: the original lockfile inherited a workstation-level legacy-peer-deps=true setting, so default CI resolvers expected an Express optional-peer tree that was absent. Commit dee2c87 regenerates the lock with legacy peer resolution explicitly disabled and moves @modelcontextprotocol/server-legacy to dev-only because it is used only by interoperability fixtures. Verified from a clean archive with the exact Node 24.18.0/npm 11.16.0 runner pair: npm ci, typecheck, build, and check:pack all pass with zero audit findings.

coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/oauth/remote-oauth-client-provider.ts (1)

263-280: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Set the issuer on credential-backed client information.

tokens() rebuilds savedClient without issuer. clientInformation() then returns this value without the issuer that lines 224-227 include for other registrations. A dynamic registration restored from persisted credentials can therefore lose its issuer binding during a later authorization flow.

Add issuer: this.options.binding.issuer when assigning savedClient. Add a regression test that restores a dynamic credential and verifies clientInformation() includes the issuer.

Proposed fix
     if (credential.clientId !== undefined) {
       this.savedClient = {
         client_id: credential.clientId,
+        issuer: this.options.binding.issuer,
         ...(credential.clientSecret === undefined ? {} : { client_secret: credential.clientSecret })
       };
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/oauth/remote-oauth-client-provider.ts` around lines 263 - 280, Update the
savedClient assignment in tokens() to include issuer:
this.options.binding.issuer alongside the persisted client_id and client_secret.
Add a regression test covering restoration of a dynamic credential and assert
that clientInformation() returns the configured issuer.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/build-test-fixture.mjs`:
- Around line 22-24: Update the fixture normalization around bundledSource to
use parser-aware processing that removes unsafe blank-line whitespace without
modifying template-literal runtime contents. Preserve whitespace inside template
literals, and add a regression test covering an indented blank line within a
template literal.

In `@src/cli/main.ts`:
- Around line 75-80: Update the serveStdio invocation in the shutdown flow to
provide an onerror callback that writes the shutdown error and sets
process.exitCode to 1. Keep the existing shutdown behavior in the shutdown
function and ensure failures from server.close are reported rather than
discarded.

In `@src/runtime/create-miftah-runtime.ts`:
- Around line 100-105: Update createHttpRequestMiftahServerFactory and the
shared configuredMiftahServerFactory options to disable resource-subscription
probing and capability registration for per-request HTTP servers. Preserve
resource subscriptions for STDIO and legacy session runtimes by leaving their
existing configuration enabled.

In `@tests/mcp-v2-migration-contract.test.ts`:
- Around line 14-21: Extend the dependency assertions in the migration contract
test to verify that dependencies does not contain
`@modelcontextprotocol/server-legacy`, alongside the existing absence check for
`@modelcontextprotocol/sdk`. Keep the current production dependency expectations
unchanged.

---

Outside diff comments:
In `@src/oauth/remote-oauth-client-provider.ts`:
- Around line 263-280: Update the savedClient assignment in tokens() to include
issuer: this.options.binding.issuer alongside the persisted client_id and
client_secret. Add a regression test covering restoration of a dynamic
credential and assert that clientInformation() returns the configured issuer.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 357cb1d1-f5ac-434b-89e7-c8374d248b6c

📥 Commits

Reviewing files that changed from the base of the PR and between 5c6a650 and dee2c87.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (66)
  • CHANGELOG.md
  • docs/library-api.md
  • package.json
  • scripts/build-test-fixture.mjs
  • scripts/pack-verifier.mjs
  • src/cli/doctor.ts
  • src/cli/init.ts
  • src/cli/main.ts
  • src/cli/setup-native-oauth.ts
  • src/config/diagnostics.ts
  • src/config/schema.ts
  • src/config/validate-config.ts
  • src/console/console-application-service.ts
  • src/console/console-dashboard-application-service.ts
  • src/http/miftah-http-server.ts
  • src/identity/identity-manager.ts
  • src/index.ts
  • src/mcp/server/management-tools.ts
  • src/mcp/server/miftah-server.ts
  • src/mcp/server/resource-prompt-registry.ts
  • src/mcp/server/tool-registry.ts
  • src/oauth/loopback-authorization-handoff.ts
  • src/oauth/oauth-metadata-fetch-guard.ts
  • src/oauth/remote-oauth-client-provider.ts
  • src/oauth/remote-oauth-credential-refresher.ts
  • src/oauth/remote-oauth-discovery.ts
  • src/oauth/remote-oauth-runtime.ts
  • src/runtime/create-miftah-runtime.ts
  • src/setup/native-oauth-onboarding.ts
  • src/setup/profile-readiness.ts
  • src/upstream/contained-stdio-transport.ts
  • src/upstream/multi-upstream-process-manager.ts
  • src/upstream/progress-preserving-transport.ts
  • src/upstream/remote-error.ts
  • src/upstream/upstream-process-manager.ts
  • src/upstream/upstream-session.ts
  • tests/approval-fallback.test.ts
  • tests/audit-outcomes.test.ts
  • tests/authenticated-request-context-docs-contract.test.ts
  • tests/fixtures/fake-upstream-bundled.mjs
  • tests/fixtures/fake-upstream-runtime.mjs
  • tests/helpers/fake-remote-upstream.ts
  • tests/http-server.test.ts
  • tests/mcp-v2-migration-contract.test.ts
  • tests/mcp-v2-serving.test.ts
  • tests/mcp-wrapper.test.ts
  • tests/multi-upstream.test.ts
  • tests/oauth-loopback-handoff.test.ts
  • tests/operation-pipeline.test.ts
  • tests/package-contract.test.ts
  • tests/plugin-routing-server.test.ts
  • tests/profile-context-handle-docs-contract.test.ts
  • tests/profile-lease-pipeline.test.ts
  • tests/profile-lock-mcp.test.ts
  • tests/profile-transition-audit-barrier.test.ts
  • tests/progress-preserving-transport.test.ts
  • tests/public-api.test.ts
  • tests/release-config.test.ts
  • tests/remote-oauth-client-provider.test.ts
  • tests/remote-oauth-compatibility.test.ts
  • tests/remote-oauth-runtime.test.ts
  • tests/remote-oauth-transport.test.ts
  • tests/remote-transport.test.ts
  • tests/stateless-profile-context-runtime.test.ts
  • tests/tool-registry.test.ts
  • tsup.config.ts

Comment thread scripts/build-test-fixture.mjs Outdated
Comment thread src/cli/main.ts Outdated
Comment thread src/runtime/create-miftah-runtime.ts
Comment thread tests/mcp-v2-migration-contract.test.ts
@mohanagy

mohanagy commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

Review follow-up in 89d5564: restored dynamic OAuth client information retains its issuer binding; modern request-scoped HTTP no longer probes or advertises connection-bound resource subscriptions; STDIO serving failures are reported safely; fixture normalization is parser-aware; and the production dependency contract excludes the legacy fixture package. Exact-head local gates: 155 of 155 test files, 1,910 passing tests and 34 skips; 96.00 percent line coverage; typecheck; lint; build; CLI smoke; 55-file package contract; fixture freshness; git diff --check; and zero vulnerabilities in production and full audits. The linked-issue matrix warning was stale because the prior complete Linux, macOS, and Windows by Node 20, 22, and 24 matrix passed; that matrix is rerunning for 89d5564. The repository has no 80 percent docstring gate, so no unrelated mass-docstring rewrite was added.

@coderabbitai coderabbitai Bot added area:mcp MCP protocol server and proxy behavior documentation Improvements or additions to documentation labels Aug 11, 2026
coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
src/mcp/server/miftah-server.ts (2)

501-503: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Report shutdown failures from the onclose path.

closeInternal() preserves the first cleanup failure, but this callback discards it. A transport close does not provide a caller that awaits close(). An upstream or subscription cleanup failure can therefore remain silent and leave resources running.

Report the sanitized error through the warning or runtime error path.

Proposed fix
 this.server.onclose = () => {
-  void this.close().catch(() => undefined);
+  void this.close().catch((error: unknown) => {
+    process.emitWarning(this.toSafeError(error).message, {
+      code: "MIFTAH_SHUTDOWN_FAILED"
+    });
+  });
 };

This preserves the failure-reporting guarantee of the idempotent shutdown path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/mcp/server/miftah-server.ts` around lines 501 - 503, Update the server
onclose callback to report sanitized failures from the awaited this.close() call
instead of swallowing them with catch(() => undefined). Use the existing warning
or runtime error reporting path, while preserving the idempotent shutdown
behavior implemented by closeInternal().

1059-1074: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Return inputRequired(...) for modern approvals.

requireApproval() calls this.server.elicitInput(), which fails for 2026-07-28 requests. Form-capable modern clients then receive an isError result. Return inputRequired(...), process inputResponses on retry, and carry approval state in requestState. Use the SDK legacy shim to retain legacy behavior. The modern HTTP factory creates a fresh MiftahServer per request, so the in-memory ApprovalStore cannot retain pending state across retries.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/mcp/server/miftah-server.ts` around lines 1059 - 1074, Update the
tools/call handler and approval flow around requireApproval so modern 2026-07-28
requests return inputRequired(...) instead of invoking the legacy elicitInput
path. Process inputResponses on retries and persist pending approval state
through requestState, since each modern HTTP request creates a fresh
MiftahServer and ApprovalStore. Route legacy clients through the SDK legacy shim
to preserve existing behavior.
tests/mcp-v2-serving.test.ts (1)

126-151: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Run the modern stdio case in a child process.

InMemoryTransport.createLinkedPair() connects 2025-era instances only. It cannot exercise modern serveStdio behavior. Keep linked-pair coverage for the legacy case and spawn serveStdio for modern stdio coverage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/mcp-v2-serving.test.ts` around lines 126 - 151, Update the
parameterized stdio test around serveStdio and
InMemoryTransport.createLinkedPair so the legacy case retains linked-pair
coverage while the modern case runs serveStdio in a child process. Preserve the
existing era assertion and whoami tool check for both paths, and keep cleanup of
the client and spawned server handle.
src/runtime/create-miftah-runtime.ts (1)

71-82: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Make configuredMiftahServerFactory era-aware.

serveStdio passes era to the factory. When era === "legacy", omit modernProfileContext. When era === "modern", set resourceSubscriptionsEnabled to false. Otherwise, legacy stdio instances use modern _meta and authentication handling, while modern instances advertise the legacy resources.subscribe capability instead of using subscriptions/listen.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/runtime/create-miftah-runtime.ts` around lines 71 - 82, Update
configuredMiftahServerFactory to accept and apply the era passed by serveStdio
when constructing the configured server: omit modernProfileContext for legacy
instances, and set resourceSubscriptionsEnabled to false for modern instances.
Preserve the existing prepareForServing and cleanup behavior while ensuring each
era advertises and handles only its corresponding protocol capabilities.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/build-test-fixture.mjs`:
- Around line 31-45: Update the whitespace normalization logic around the
replacement scan to inspect each template token for individual whitespace-only
physical line spans rather than testing the complete token value. Add
replacements only for those spans, preserving template delimiters and all
non-whitespace raw content, while retaining the existing tagged-template safety
check.

---

Outside diff comments:
In `@src/mcp/server/miftah-server.ts`:
- Around line 501-503: Update the server onclose callback to report sanitized
failures from the awaited this.close() call instead of swallowing them with
catch(() => undefined). Use the existing warning or runtime error reporting
path, while preserving the idempotent shutdown behavior implemented by
closeInternal().
- Around line 1059-1074: Update the tools/call handler and approval flow around
requireApproval so modern 2026-07-28 requests return inputRequired(...) instead
of invoking the legacy elicitInput path. Process inputResponses on retries and
persist pending approval state through requestState, since each modern HTTP
request creates a fresh MiftahServer and ApprovalStore. Route legacy clients
through the SDK legacy shim to preserve existing behavior.

In `@src/runtime/create-miftah-runtime.ts`:
- Around line 71-82: Update configuredMiftahServerFactory to accept and apply
the era passed by serveStdio when constructing the configured server: omit
modernProfileContext for legacy instances, and set resourceSubscriptionsEnabled
to false for modern instances. Preserve the existing prepareForServing and
cleanup behavior while ensuring each era advertises and handles only its
corresponding protocol capabilities.

In `@tests/mcp-v2-serving.test.ts`:
- Around line 126-151: Update the parameterized stdio test around serveStdio and
InMemoryTransport.createLinkedPair so the legacy case retains linked-pair
coverage while the modern case runs serveStdio in a child process. Preserve the
existing era assertion and whoami tool check for both paths, and keep cleanup of
the client and spawned server handle.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 99e86134-4853-43f0-a3f4-2616c5836044

📥 Commits

Reviewing files that changed from the base of the PR and between dee2c87 and 89d5564.

📒 Files selected for processing (10)
  • scripts/build-test-fixture.mjs
  • src/cli/main.ts
  • src/mcp/server/miftah-server.ts
  • src/oauth/remote-oauth-client-provider.ts
  • src/runtime/create-miftah-runtime.ts
  • tests/fixtures/fake-upstream-bundled.mjs
  • tests/mcp-v2-migration-contract.test.ts
  • tests/mcp-v2-serving.test.ts
  • tests/remote-oauth-client-provider.test.ts
  • tests/test-harness-resource-contract.test.ts

Comment thread scripts/build-test-fixture.mjs Outdated
@mohanagy

Copy link
Copy Markdown
Owner Author

Second review follow-up is in 4c20344:

  • Transport-close shutdown failures are sanitized and reported as MIFTAH_SHUTDOWN_FAILED.
  • Confirmation-required tools, resources, prompts, and profile transitions now use the 2026-07-28 input_required/inputResponses/requestState flow. The factory shares a bounded HMAC-integrity-bound one-time continuation store across fresh modern HTTP instances; raw operation arguments are not placed in requestState. The SDK legacy shim preserves form elicitation.
  • The configured factory is era-aware: modern instances disable connection-bound resources.subscribe, while legacy instances omit modern profile context and retain subscriptions.
  • Template normalization now edits only individual whitespace-only physical line spans.

The child-process suggestion for the modern stdio test was not applied because the SDK v2 serveStdio API explicitly accepts a custom transport, and the current linked transport is passed through that public seam. The test observes the factory context as modern, asserts modern does not advertise legacy resources.subscribe, and completes a real tool call; the legacy case observes legacy and asserts the inverse. Replacing that test with process plumbing would not exercise a different protocol-era branch.

Exact 4c20344 local validation: 156/156 test files; 1,920 passed and 34 skipped; 96.00% line and 92.19% branch coverage; typecheck; lint; build; CLI smoke; fixture freshness; 55-file package contract; git diff --check; and zero vulnerabilities in production and full audits.

@mohanagy
mohanagy dismissed stale reviews from coderabbitai[bot] and coderabbitai[bot] August 11, 2026 15:16

Dismissed as stale: all actionable findings were resolved in later commits through 4c20344, exact-head CI is green, and the latest CodeRabbit status is successful but its new review was rate-limited.

@mohanagy
mohanagy merged commit d081e33 into development Aug 11, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:mcp MCP protocol server and proxy behavior documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Protocol] Upgrade to MCP TypeScript SDK v2 and negotiate the 2026-07-28 era

1 participant