|
|
--- |
|
|
title: MCP Generator |
|
|
emoji: π» |
|
|
colorFrom: blue |
|
|
colorTo: purple |
|
|
sdk: gradio |
|
|
app_file: app.py |
|
|
pinned: false |
|
|
license: other |
|
|
tags: |
|
|
- mcp |
|
|
- mcp-in-action-track-enterprise |
|
|
- mcp-in-action-track-research |
|
|
- mcp-in-action-track-consumer |
|
|
--- |
|
|
|
|
|
Link to my social media post and video submission: https://www.linkedin.com/posts/activity-7400263165877604352-I8vp |
|
|
|
|
|
# π€ MCP Generator |
|
|
|
|
|
**Turn Any API into an MCP Server in Seconds!** |
|
|
|
|
|
Built for the **MCP 1st Birthday Hackathon** - Track 2: MCP in Action π |
|
|
|
|
|
## π― What is This? |
|
|
|
|
|
A **meta-MCP** that generates MCP servers from any API! This is: |
|
|
- β
An **MCP server itself** (uses MCP Fetch Server) |
|
|
- β
A **code generator** (powered by LangGraph agents) |
|
|
- β
A **one-click deployment tool** (instant MCP hosting) |
|
|
- β
**Non-technical friendly** (no terminal commands needed!) |
|
|
|
|
|
## β¨ Features |
|
|
|
|
|
- **π Automatic API Analysis** - Just provide a URL, we analyze the API structure |
|
|
- **π€ AI-Powered Code Generation** - Claude generates complete, working MCP servers |
|
|
- **π¦ Complete Package** - Get server code, README, and config files |
|
|
- **π Instant Hosting** - Your MCP runs immediately in a deployed space using your HF Token |
|
|
- **π₯ Download Option** - Self-host later if you want |
|
|
- **π¨ Beautiful UI** - Built with Gradio for ease of use |
|
|
|
|
|
## ποΈ Architecture |
|
|
|
|
|
``` |
|
|
βββββββββββββββββββββββββββββββ |
|
|
β Gradio Frontend β |
|
|
ββββββββββββ¬βββββββββββββββββββ |
|
|
β |
|
|
ββββββββββββΌβββββββββββββββββββ |
|
|
β LangGraph Agent Factory β |
|
|
β ββββββββββββββββββββββββββ β |
|
|
β β API Analyzer Agent β β β Uses Fetch MCP |
|
|
β ββββββββββββββββββββββββββ β |
|
|
β ββββββββββββββββββββββββββ β |
|
|
β β Code Generator Agent β β β Uses Claude API |
|
|
β ββββββββββββββββββββββββββ β |
|
|
ββββββββββββ¬βββββββββββββββββββ |
|
|
β |
|
|
ββββββββββββΌβββββββββββββββββββ |
|
|
β Generated MCP Server β |
|
|
β β’ stdio transport β |
|
|
β β’ Complete documentation β |
|
|
β β’ Ready to deploy β |
|
|
βββββββββββββββββββββββββββββββ |
|
|
``` |
|
|
|
|
|
## π Quick Start |
|
|
|
|
|
### Try it on HuggingFace Spaces |
|
|
|
|
|
π **[Launch MCP Generator](https://huggingface.co/spaces/MCP-1st-Birthday/mcp-generator)** π |
|
|
|
|
|
### Run Locally |
|
|
|
|
|
```bash |
|
|
# Clone the repo |
|
|
git clone https://github.com/visprogithub/MCP_Generator_Agent.git |
|
|
cd MCP_Generator_Agent |
|
|
|
|
|
# Install dependencies |
|
|
npm install -g npx # For MCP Fetch Server |
|
|
pip install -r requirements.txt |
|
|
|
|
|
# Set up API key |
|
|
echo "ANTHROPIC_API_KEY=your_key_here" > .env |
|
|
|
|
|
# Run the app |
|
|
python app.py |
|
|
``` |
|
|
|
|
|
Then open http://localhost:7860 in your browser! |
|
|
|
|
|
## π How to Use |
|
|
|
|
|
1. **Enter an API URL** (e.g., `https://api.github.com`) |
|
|
2. **Click "Generate & Host MCP Server"** |
|
|
3. **Download the ZIP** or copy the connection config |
|
|
4. **Use in Claude Desktop!** |
|
|
|
|
|
That's it! β¨ |
|
|
|
|
|
## π Example APIs to Try |
|
|
|
|
|
- `https://api.github.com` - GitHub API |
|
|
- `https://api.stripe.com` - Stripe Payment API |
|
|
- `https://api.openweathermap.org` - Weather Data |
|
|
- `https://jsonplaceholder.typicode.com` - Fake REST API (for testing) |
|
|
|
|
|
## π οΈ Technology Stack |
|
|
|
|
|
- **Frontend:** [Gradio 4](https://gradio.app) - Beautiful web UI |
|
|
- **Agents:** [LangGraph](https://github.com/langchain-ai/langgraph) - Agent orchestration |
|
|
- **LLM:** [Anthropic Claude](https://anthropic.com) - Code generation |
|
|
- **MCP Client:** [@modelcontextprotocol/server-fetch](https://github.com/modelcontextprotocol/servers) - Fetch API docs |
|
|
- **MCP Server:** [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk) - Generated servers |
|
|
|
|
|
## π― MCP 1st Birthday Hackathon |
|
|
|
|
|
This project demonstrates: |
|
|
|
|
|
β
**Using MCP** - Integrates Fetch MCP for API analysis |
|
|
β
**Providing MCP** - Generates working MCP servers |
|
|
β
**Real-world Impact** - Makes MCP development accessible to everyone |
|
|
β
**Creativity** - Meta-MCP that builds MCPs using MCPs! |
|
|
β
**Polish** - Beautiful UI, complete docs, one-click experience |
|
|
|
|
|
### Track 2: MCP in Action |
|
|
|
|
|
Category: **Productivity** |
|
|
|
|
|
This tool makes developers and non-technical users 10x more productive by eliminating the manual work of creating MCP servers. |
|
|
|
|
|
## π Project Structure |
|
|
|
|
|
``` |
|
|
MCP_Generator_Agent/ |
|
|
βββ app.py # Main Gradio application |
|
|
βββ src/ |
|
|
β βββ agents/ # LangGraph agents |
|
|
β β βββ factory.py # Agent orchestration |
|
|
β β βββ api_analyzer.py |
|
|
β β βββ code_generator.py |
|
|
β βββ mcp_clients/ # MCP client wrappers |
|
|
β β βββ fetch_client.py |
|
|
β βββ templates/ # Code templates |
|
|
β β βββ mcp_server_template.py.jinja |
|
|
β β βββ readme_template.md.jinja |
|
|
β βββ hosted_mcps/ # Generated MCPs |
|
|
β βββ mcp_host.py # MCP hosting manager |
|
|
β βββ config.py # Configuration |
|
|
βββ requirements.txt |
|
|
βββ README.md |
|
|
``` |
|
|
|
|
|
## π€ Contributing |
|
|
|
|
|
This is a hackathon project, but contributions are welcome! Feel free to: |
|
|
|
|
|
- Report bugs |
|
|
- Suggest features |
|
|
- Submit pull requests |
|
|
- Share your generated MCPs! |
|
|
|
|
|
## π License |
|
|
|
|
|
Copyright Β© 2025. All Rights Reserved. |
|
|
|
|
|
This software is proprietary and confidential. Unauthorized copying, distribution, modification, or use of this software, via any medium, is strictly prohibited without express written permission from the copyright holder. |
|
|
|
|
|
## π Acknowledgments |
|
|
|
|
|
- [Anthropic](https://anthropic.com) for Claude and MCP |
|
|
- [Gradio](https://gradio.app) for the amazing UI framework |
|
|
- [LangGraph](https://github.com/langchain-ai/langgraph) for agent orchestration |
|
|
- The entire MCP community! π |
|
|
|
|
|
--- |
|
|
|
|
|
**Made with β€οΈ for the MCP 1st Birthday Hackathon** |
|
|
|
|
|
π [HuggingFace Space](https://huggingface.co/spaces/MCP-1st-Birthday/mcp-generator) | π [GitHub](https://github.com/visprogithub/MCP_Generator_Agent) |