Gradio's Journey to 1 Million Monthly Users!

Read More
  1. Other Tutorials
  2. Using Docs Mcp

Using the Gradio Docs MCP Server

In this guide, we will describe how to use the official Gradio Docs MCP Server.

Prerequisites

You will need an LLM application that supports tool calling using the MCP protocol, such as Claude Desktop, Cursor, or Cline (these are known as "MCP Clients").

Why an MCP Server?

If you're using LLMs in your workflow, adding this server will augment them with just the right context on gradio - which makes your experience a lot faster and smoother.

The server is running on Spaces and was launched entirely using Gradio, you can see all the code here. For more on building an mcp server with gradio, see the previous guide.

Installing in the Clients

For clients that support SSE (e.g. Cursor, Windsurf, Cline), simply add the following configuration to your MCP config:

{
  "mcpServers": {
    "gradio": {
      "url": "https://gradio-docs-mcp.hf.space/gradio_api/mcp/sse"
    }
  }
}

We've included step-by-step instructions for Cursor below, but you can consult the docs for Windsurf here, and Cline here which are similar to set up.

Cursor

  1. Make sure you're using the latest version of Cursor, and go to Cursor > Settings > Cursor Settings > MCP
  2. Click on '+ Add new global MCP server'
  3. Copy paste this json into the file that opens and then save it.
{
  "mcpServers": {
    "gradio": {
      "url": "https://gradio-docs-mcp.hf.space/gradio_api/mcp/sse"
    }
  }
}
  1. That's it! You should see the tools load and the status go green in the settings page. You may have to click the refresh icon or wait a few seconds.

Claude Desktop

  1. Since Claude Desktop only supports stdio, you will need to install Node.js to get this to work.
  2. Make sure you're using the latest version of Claude Desktop, and go to Claude > Settings > Developer > Edit Config
  3. Open the file with your favorite editor and copy paste this json, then save the file.
{
  "mcpServers": {
    "gradio": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://gradio-docs-mcp.hf.space/gradio_api/mcp/sse",
        "--transport",
        "sse-only"
      ]
    }
  }
}
  1. Quit and re-open Claude Desktop, and you should be good to go. You should see it loaded in the Search and Tools icon or on the developer settings page.

Tools

There are currently only two tools in the server: gradio_docs_mcp_load_gradio_docs and gradio_docs_mcp_search_gradio_docs.

  1. gradio_docs_mcp_load_gradio_docs: This tool takes no arguments and will load an /llms.txt style summary of Gradio's latest, full documentation. Very useful context the LLM can parse before answering questions or generating code.

  2. gradio_docs_mcp_search_gradio_docs: This tool takes a query as an argument and will run embedding search on Gradio's docs, guides, and demos to return the most useful context for the LLM to parse.