fix(module): cloudflare async handlers hang forever#50
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thank you for following the naming conventions! 🙏 |
commit: |
Member
|
@harlan-zw Thank you so much 🙏 Nice PR and really looking forward to seeing the nuxtseo mcp 🔥 |
HugoRCD
approved these changes
Dec 9, 2025
Collaborator
|
Thank you @harlan-zw, you rock 🙌 |
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.
🔗 Linked issue
📚 Description
On Cloudflare any MCP handler will hang indefinitely when there is an async function to run, such as making a $fetch request or content query.
This is due to the code having a tight coupling to the node implementation, which seems to be supported enough not to break Cloudflare, but means the request is never finalised.
We implement the custom package
agentswhich has a compatiblecreateMcpHandler()for future-proof Cloudflare support. See docs here https://developers.cloudflare.com/agents/model-context-protocol/mcp-handler-api/This also allows us to add other handlers in the future if needed.
I couldn't get a test running but I pushed up a live instance here to test: https://mcp-toolkit-test.harlanzw.workers.dev/mcp. I'm also running nuxtseo.com/mcp with a similar module patch.
📝 Checklist