---
source: https://iinventedlight.com/library/notes/gradio-mcp.md
title: "Launch Gradio apps as MCP servers or clients"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Gradio); Apache-2.0 (gradio-app/gradio (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Gradio, Building an MCP Server with Gradio; gradio-app/gradio (GitHub), Using the Gradio Chatbot as an MCP Client. Apache-2.0; Apache-2.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-19
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-19
as_of: 2026-11-19
confidence: medium
untested: "Not reproduced (2026-11-19). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: agent-operations
topic_area: "agent operations: Gradio MCP servers and clients"
tags: [gradio, mcp, server, client]
client: Librarian
sources:
  - id: S1
    title: "Building an MCP Server with Gradio"
    publisher: Gradio
    url: https://www.gradio.app/guides/building-mcp-server-with-gradio
    accessed: 2026-11-19
    license: "Apache-2.0"
  - id: S2
    title: "Using the Gradio Chatbot as an MCP Client"
    publisher: gradio-app/gradio (GitHub)
    url: https://github.com/gradio-app/gradio/blob/main/guides/10_mcp/03_building-an-mcp-client-with-gradio.md
    accessed: 2026-11-19
    license: "Apache-2.0"
---
# Launch Gradio apps as MCP servers or clients
**Answer:** A Gradio app can launch as an MCP server by installing gradio with the mcp extra and passing mcp_server=True to launch(). A Gradio Chatbot can also be used as an MCP Client and send tool calls to a server.

## Launch a Gradio MCP server

Install Gradio with the MCP extra: pip install "gradio[mcp]". This installs the necessary dependencies, including the mcp package. You also need an LLM application with MCP tool calling, for example Claude Desktop, Cursor, or Cline, known as MCP Clients. An MCP server is a standardized way to expose tools so LLMs can use them. Enable the server with mcp_server=True in launch(). A letter_counter example defines a function with a docstring, then launches the app as a server.

## Use a Gradio chatbot as a client

The client guide walks through a Model Context Protocol (MCP) Client and Server implementation with Gradio. You build a Gradio Chatbot that uses Anthropic's Claude API, and also, as an MCP Client, generates images by connecting to a separate MCP Server. The Model Context Protocol standardizes how applications provide context to LLMs. Setup uses pip install gradio anthropic mcp. The client forwards your prompt to Claude, which may call generate_image on the MCP server before replying.

| mcp_server | launch |
|---|---|
| pip install "gradio[mcp]" | install Gradio plus the mcp extra |
| mcp_server=True | launch the app as an MCP server |
| Gradio Chatbot | can be used as an MCP client |
| generate_image | example tool used in the client guide |

## See also

- [ao-mcp](https://iinventedlight.com/library/notes/ao-mcp/)
- [pydantic-ai-mcp](https://iinventedlight.com/library/notes/pydantic-ai-mcp/)
- [openai-agents-mcp](https://iinventedlight.com/library/notes/openai-agents-mcp/)

## Claims

- id: C1
  claim: Install Gradio with the mcp extra and launch with mcp_server=True.
  source: S1
  evidence: "mcp_server=True in .launch()"

- id: C2
  claim: An MCP server is a standardized way to expose tools for LLMs.
  source: S1
  evidence: "standardized way to expose tools so that they can be used by LLMs"

- id: C3
  claim: A Gradio chatbot can act as an MCP client of a Gradio MCP server.
  source: S2
  evidence: "Using the Gradio Chatbot as an MCP Client"

## Sources

- [S1] Building an MCP Server with Gradio. Gradio. https://www.gradio.app/guides/building-mcp-server-with-gradio . License: Apache-2.0. Accessed 2026-11-19.

- [S2] Using the Gradio Chatbot as an MCP Client. gradio-app/gradio (GitHub). https://github.com/gradio-app/gradio/blob/main/guides/10_mcp/03_building-an-mcp-client-with-gradio.md . License: Apache-2.0. Accessed 2026-11-19.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Gradio, Building an MCP Server with Gradio; gradio-app/gradio (GitHub), Using the Gradio Chatbot as an MCP Client. Apache-2.0; Apache-2.0. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
