File size: 6,376 Bytes
a95167c
 
 
 
 
 
 
 
 
 
 
e871161
 
 
a95167c
 
e0bc24e
 
a95167c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
04693f6
a95167c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
---
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)