Get the FREE Ultimate OpenClaw Setup Guide →

mcp_gradio_client

This is a proof of concept repo on how to create a gradio UI using the Model Context Protocol Client Python SDK.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport http justjoehere-mcp_gradio_client http://127.0.0.1:3001/sse

How to use

This MCP Gradio Client Proof of Concept provides a Gradio-based interface to interact with MCP servers over STDIO and SSE. The client automatically discovers tools exposed by configured MCP servers and presents them in the Gradio UI, allowing a language model to call tools through a standardized MCP protocol. You can run STDIO servers (launched automatically by the client as needed) and/or SSE servers (which must be started separately) and then load their tools into the interface for real-time usage. The UI supports dynamic tool loading, debugging mode, and a straightforward chat-style interaction with the model while invoking tools when appropriate.

How to install

Prerequisites:

  • Python 3.12 or higher
  • Node.js (for any optional Node-based tooling)
  • uvicorn and/or uvx (depending on your STDIO server setup)
  • OpenAI API Key for language model interaction (if using OpenAI models)

Steps:

  1. Clone the repository (replace with the actual URL): git clone https://github.com/yourusername/mcp-gradio-client.git cd mcp-gradio-client

  2. Create and activate a virtual environment:

    • Unix/macOS: python -m venv venv source venv/bin/activate
    • Windows: python -m venv .venv ..venv\Scripts\activate
  3. Install dependencies: pip install -r requirements.txt

  4. Set up environment variables (example): Create a .env file in the project root and add your API key references, e.g.: OPENAI_API_KEY=your_openai_api_key

  5. Run the Gradio UI: python gradio_ui.py

Notes:

  • STDIO servers defined in config.json are instantiated automatically by the Gradio client as needed.
  • SSE servers must be started manually before launching the Gradio UI.
  • If your setup uses different server command names (e.g., npx on Windows), adjust config.json accordingly.

Additional notes

Tips and notes:

  • Ensure your config.json is present in the project root and follows the mcpServers structure shown in the README.
  • For SSE servers, start the server prior to running the Gradio app and verify the URL (and any required headers) in your config.
  • The Gradio UI provides a debug toggle; enable it to capture detailed logs for troubleshooting.
  • If you encounter tool-loading delays, verify network connectivity to the SSE endpoint and that STDIO servers can be started with the configured commands.
  • The client is designed to dynamically load tools from MCP servers; if a server exposes new tools, refresh or reload the interface to see them.

Related MCP Servers

Sponsor this space

Reach thousands of developers