Skip to content

MCP Server Part 8: MCP server routes#3750

Open
KoolADE85 wants to merge 10 commits intofeature/mcp-get-dash-component-toolfrom
feature/mcp-server-integration
Open

MCP Server Part 8: MCP server routes#3750
KoolADE85 wants to merge 10 commits intofeature/mcp-get-dash-component-toolfrom
feature/mcp-server-integration

Conversation

@KoolADE85
Copy link
Copy Markdown
Contributor

@KoolADE85 KoolADE85 commented Apr 16, 2026

Summary

This PR pulls together everything from the previous PRs into a working MCP server you can connect to from any MCP-compatible LLM agent. Example:

claude mcp add dash-app --transport http http://localhost:8050/_mcp
  • Routes are added per MCP spec
  • Dash integration: control the feature with enable_mcp and mcp_path constructor params, (or DASH_MCP_ENABLED / DASH_MCP_PATH env vars)
  • E2E test suite: all the previous PRs have E2E coverage via the actual MCP server endpoints.
  • A number of one-liner type fixes since the mypy tests are now running in this PR.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 16, 2026

Thank you for your contribution to Dash! 🎉

This PR is exempt from requiring a linked issue due to its labels.

@KoolADE85 KoolADE85 force-pushed the feature/mcp-server-integration branch from 876285b to 43c15b2 Compare April 17, 2026 00:32
@chgiesse
Copy link
Copy Markdown

Hi Plotly team!

First of all, thanks for integrating MCP into Dash - this looks really exciting!
But I would like to address/discuss some concerns:

  • this PR looks like its not compatible with the new bring your own Backend architecture by directly importing components like Response from Flask and not the response adapter - thus the mcp doesn't work with FastApi or Quart
  • the same seems to apply for the SSE streaming. Which I think should be integrated into the server adapter classes and be provided for the other backends too
  • and regarding the SSE implementation - I think the this version has some serious security implications - for synchronous Flask. With the current endless loop, session wise handling and Gunicorns default synchronous workers, the life time per session per sse stream blocks a complete worker! For example, google Chrome doesn't really provide a tab limit, so I could open a 1000 tabs and block a 1000 workers in your application. Although I think there is not a direct solutions to this (besides not providing endless stream capabilities to a synchronous backend) - a way to handle this would be to provide a DashQueueAdapter where a user can use a Gevent Queue instead of the default one. With this, the problem can be smoothed out in production. I also created a blog post ones - comparing server performance with SSE streams between Flask and Quart. https://community.plotly.com/t/flash-1-2-0-streaming-ui-updates-via-server-sent-events/93890/2

Let me know what you think - if you see it the same way or if I overlooked something! Would also love to contribute these changes :)

Best regards,
Christian

@KoolADE85 KoolADE85 force-pushed the feature/mcp-get-dash-component-tool branch from 8c1f392 to f9b05da Compare April 21, 2026 17:28
@KoolADE85 KoolADE85 force-pushed the feature/mcp-server-integration branch from 43c15b2 to f03c72f Compare April 21, 2026 17:50
@KoolADE85
Copy link
Copy Markdown
Contributor Author

Hey @chgiesse

Thanks for the comments, and happy to see the excitement around the feature!

  • I'll be adjusting this to be compatible with the "bring your own backend" initiative. As you can see, the two projects have been happening independently so I'll make the appropriate code adjustments here.

  • As for SSE streaming, I'm thinking to remove that for the initial release. Early on, I thought it would be useful to have some server-driven messaging, and this would represent the start of that. But since the core functionality is all achieved with basic, well-described tools/resources, it's probably wise to remove SSE until we think through the security and performance considerations.

And absolutely, I'd welcome any contributions you have towards this effort - there's tons of potential to make Dash apps even more LLM friendly!

Adrian

@KoolADE85 KoolADE85 force-pushed the feature/mcp-get-dash-component-tool branch from f9b05da to bc340e6 Compare April 22, 2026 21:37
@KoolADE85 KoolADE85 force-pushed the feature/mcp-server-integration branch 2 times, most recently from d3e1e19 to 976e0df Compare April 23, 2026 15:29
@KoolADE85 KoolADE85 force-pushed the feature/mcp-get-dash-component-tool branch from bc340e6 to b3d4015 Compare April 23, 2026 20:24
@KoolADE85 KoolADE85 force-pushed the feature/mcp-server-integration branch from 20d3ee7 to bb25991 Compare April 23, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants