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.
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:
-
Clone the repository (replace with the actual URL): git clone https://github.com/yourusername/mcp-gradio-client.git cd mcp-gradio-client
-
Create and activate a virtual environment:
- Unix/macOS: python -m venv venv source venv/bin/activate
- Windows: python -m venv .venv ..venv\Scripts\activate
-
Install dependencies: pip install -r requirements.txt
-
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
-
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
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP