MCP Server Not Starting Despite GRADIO_MCP_SERVER=True in Gradio 5.27.1+

I’m trying to expose my Gradio interface as an MCP server using the latest gradio[mcp] package (version 5.27.1). I’ve followed all the instructions in the MCP course and docs, including setting the environment variable before execution:

$env:GRADIO_MCP_SERVER="True"
py app.py

However, the server only outputs:

Running on local URL: http://127.0.0.1:7860

and I never see the expected line:

MCP server available at: http://127.0.0.1:7860/gradio_api/mcp/sse

I confirmed:

  • gradio==5.27.1 is installed
  • gradio-mcp is also installed
  • I’m not using mcp_server=True in .launch() (since it’s removed in v5)
  • Tried both py and python after setting the environment variable
  • Tested on a fresh virtual environment

Still, the MCP server routes /gradio_api/mcp/sse and /schema never activate.

Could someone from the Gradio or MCP team help confirm if this is a bug or if something changed in v5 that isn’t reflected in the documentation?

Reference: Building the Gradio MCP Server - Hugging Face MCP Course

1 Like

Hmm… Perhaps this case?

abidlabs
on May 20, 2025
Ok I’ve figured out the issue, it’s due to a breaking change introduced by the mcp package going from mcp==1.8.1 to mcp==1.9.0. We’re going to be investigating further to figure out if this breaking change in mcp is intentional or a mistake, but in the meantime, I recommend pinning mcp==1.8.1 as in this Space: mcp_tools - a Hugging Face Space by abidlabs

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.