Skip to content

fix(module): cloudflare async handlers hang forever#50

Merged
HugoRCD merged 2 commits intomainfrom
fix/cloudflare-support
Dec 9, 2025
Merged

fix(module): cloudflare async handlers hang forever#50
HugoRCD merged 2 commits intomainfrom
fix/cloudflare-support

Conversation

@harlan-zw
Copy link
Contributor

@harlan-zw harlan-zw commented Dec 9, 2025

🔗 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 agents which 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

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel
Copy link
Contributor

vercel bot commented Dec 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
nuxt-mcp-toolkit-docs Ready Ready Preview Comment Dec 9, 2025 5:04am

@github-actions github-actions bot added the bug Something isn't working label Dec 9, 2025
@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Thank you for following the naming conventions! 🙏

@harlan-zw harlan-zw changed the title fix(cloudflare): async handlers hang forever fix(module): cloudflare async handlers hang forever Dec 9, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 9, 2025

npm i https://pkg.pr.new/@nuxtjs/mcp-toolkit@50

commit: 18f8d3f

@HugoRCD
Copy link
Member

HugoRCD commented Dec 9, 2025

@harlan-zw Thank you so much 🙏 Nice PR and really looking forward to seeing the nuxtseo mcp 🔥

@HugoRCD HugoRCD merged commit c8524d4 into main Dec 9, 2025
15 of 16 checks passed
@HugoRCD HugoRCD deleted the fix/cloudflare-support branch December 9, 2025 09:05
@atinux
Copy link
Collaborator

atinux commented Dec 9, 2025

Thank you @harlan-zw, you rock 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants