Repository navigation
Cherry-pick: perf: load less at startup (#934, #935, #937) - #941
Merged
Merged
Conversation
…he loaded protocol module (#934) createInMemoryServer(), the direct client's notification and elicitation handlers, and runWebStandardMcp() took their classes and schemas from `await import('@frontmcp/protocol')`. In a CommonJS process that import resolves the package's `import` condition, so connect(), create() clients and createFetchHandler() loaded a second, ESM copy of @frontmcp/protocol and, through it, of the MCP SDK, on top of the CommonJS copy the SDK had already required. They now use the statically imported @frontmcp/protocol, as runStdio() does since #923. In an ESM process the import resolves the same ESM module as before. (cherry picked from commit 5b54191)
…under require() (#935) A server loaded js-yaml (25 files), semver (23) and the @frontmcp/uipack root at startup, for code most servers never run: SKILL.md and YAML config parsing, the ESM loader's version ranges, and the auth-UI pages. They now come through three subpath imports, #js-yaml, #semver and #uipack-render, whose `require` variant reads each function from its package the first time it is used, like @frontmcp/protocol's #client. The CommonJS build keeps them external and ships both variants; the ESM and browser builds resolve them at build time to the static variant, so those bundles import the packages as before. (cherry picked from commit b7ee831)
A stdio server initializes the scope's TransportService, and with it TransportSSEAdapter, which defined RecreateableSSEServerTransport at startup. Its base class reads POST bodies with raw-body and content-type, so a stdio server loaded raw-body, content-type, iconv-lite, http-errors and their dependencies (16 files) that it never uses. TransportSSEAdapter now imports the transport as a type and loads it with loadSseTransport(), which TransportService awaits where it creates the LocalTransporter of an SSE session, as it does for the Streamable HTTP transport since #924. (cherry picked from commit f13b8af)
This was referenced Oct 21, 2026
Contributor
Contributor
Performance Test ResultsStatus: ✅ All tests passed Summary
Total: 101 tests across 21 projects 📊 View full report in workflow run Generated at: 2026-10-21T16:29:52.677Z |
alexmercerpo
approved these changes
Oct 21, 2026
This was referenced Nov 2, 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.
Cherry-pick to main
This PR brings #934, #935 and #937, merged to
release/1.10.x, tomainas one PR. Each squash commit is picked in order withgit cherry-pick -x, so every commit names its source. It replaces the per-PR cherry-picks the workflow opened (#938, #939 and #940), which I'm closing in favor of this one.release/1.10.x5b541910ecreateInMemoryServer, the direct client andrunWebStandardMcpuse the@frontmcp/protocolmodule already loaded, instead of loading a second ESM copy of it and the MCP SDK (the #923 fix for the remaining three places).b7ee8319djs-yaml,semverand the@frontmcp/uipackroot load on first use underrequire(), through#js-yaml,#semverand#uipack-rendersubpath imports. Worker and browser builds keep static imports.f13b8af46raw-body,content-type,iconv-lite,http-errorsand others, 16 files) loads with the first SSE session.All three applied without conflicts. The 26 files they change are identical to
release/1.10.x, where each PR passed CI.Results
From the release PRs, measured with the benchmark's harness:
connect(), time to connected (#934)createFetchHandler(), firsttools/callafter the SDK loads (#934)Throughput is unchanged within the run-to-run spread.
Tests
Each release PR passed On Push, Package E2E, Performance and CodeQL, with no review comments left open. This branch has the same files, and CI runs here on
main.Summary by CodeRabbit
New Features
Performance
Bug Fixes
Tests