fix(xmcp): align prompt and resource loader startup behavior - #538
Merged
0xKoller merged 4 commits intoApr 9, 2026
Conversation
Contributor
|
PR author is not in the allowed authors list. |
Contributor
|
@FiammaMuscari is attempting to deploy a commit to the xmcp Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
valebearzotti
approved these changes
Apr 8, 2026
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
This PR is the follow-up requested during the review of #528.
It extends the same graceful loader startup behavior already implemented for tools to prompts and resources, while keeping the scope intentionally small and limited to the runtime and compiler pieces required for that behavior to work in the real bundled app.
What changed
Why
The tool-loader behavior added in #528 handled empty files and missing default exports gracefully. This follow-up applies the same behavior to prompts and resources and closes the remaining gap in the bundled HTTP example, where empty prompt/resource files can arrive at runtime as an interop-shaped module with
default: {}.Scope
This PR intentionally avoids expanding scope.
It does not add docs, tests, demo files, screenshots, or unrelated refactors. It only includes the production changes required to make prompt/resource startup behavior consistent with the existing tool-loader behavior.
Files changed
packages/xmcp/src/compiler/index.tspackages/xmcp/src/runtime/adapters/nextjs/handler/server-lifecycle.tspackages/xmcp/src/runtime/utils/prompt-loader.tspackages/xmcp/src/runtime/utils/resource-loader.tspackages/xmcp/src/runtime/utils/server.tspackages/xmcp/src/runtime/utils/tool-loader.tsValidation
Manual validation was performed with
examples/template-config:Follow-up context
Requested in the review of #528:
#528