# MCP-Maker

### ⚒️ Auto-generate MCP servers from any data source. Zero code required.

> Point MCP-Maker at a database, API, or file directory and get a fully functional [MCP](https://modelcontextprotocol.io/) server in seconds — ready for Claude, ChatGPT, Cursor, and any MCP-compatible AI.

---

## 🚀 Quick Start

```bash
pip install mcp-maker

# From a SQLite database
mcp-maker init sqlite:///my_database.db
mcp-maker serve

# From CSV/JSON files
mcp-maker init ./data/
mcp-maker serve

# That's it! Your AI can now query your data.
```

## Why MCP-Maker?

| | FastMCP | MCP-Maker |
|---|---------|----------|
| **Approach** | You write Python tools | It generates everything |
| **Setup time** | Minutes–hours | Seconds |
| **Code required** | Yes | No |
| **Best for** | Custom logic | Data access |

MCP-Maker uses FastMCP under the hood — it's not competing, it's building on top.

---

## 📋 Commands

| Command | Description |
|---------|-------------|
| `mcp-maker init <source>` | Generate an MCP server from a data source |
| `mcp-maker inspect <source>` | Preview what would be generated (dry run) |
| `mcp-maker serve` | Run the generated MCP server |
| `mcp-maker list-connectors` | Show available connectors |

## 🔌 Connectors

### Built-in

| Connector | URI Format | Status |
|-----------|-----------|--------|
| **SQLite** | `sqlite:///path/to/db.sqlite` | ✅ Ready |
| **Files** (CSV, JSON, txt) | `./path/to/directory/` | ✅ Ready |
| **PostgreSQL** | `postgres://user:pass@host/db` | 🔜 Coming |
| **MySQL** | `mysql://user:pass@host/db` | 🔜 Coming |
| **Airtable** | `airtable://appXXXX` | 🔜 Coming |

### Want to add a connector?

Every connector is a single Python file — PRs welcome! See [Contributing](#contributing).

---

## 🛠️ What Gets Generated

For each table in your data source, MCP-Maker generates:

| Tool | Description |
|------|-------------|
| `list_{table}(limit, offset)` | Paginated listing |
| `get_{table}_by_{pk}(id)` | Get by primary key |
| `search_{table}(query)` | Full-text search |
| `count_{table}()` | Row count |
| `schema_{table}()` | Column names and types |

For text files, it generates `read_{name}()` resources.

---

## 💡 Example: SQLite Database

```bash
$ mcp-maker init sqlite:///chinook.db

⚒️  MCP-Maker v0.1.0

✅ Connected to sqlite source

┌──────────────────────────────────┐
│ 📊 Discovered Tables (11)       │
├──────────┬──────────┬────────────┤
│ Table    │ Columns  │ Rows       │
├──────────┼──────────┼────────────┤
│ albums   │ id, ...  │ 347        │
│ artists  │ id, ...  │ 275        │
│ tracks   │ id, ...  │ 3503       │
└──────────┴──────────┴────────────┘

🎉 Generated: mcp_server.py

$ mcp-maker serve
🚀 MCP-Maker Server running...
```

Now in Claude Desktop, add the server and ask: *"What are the top 5 artists with the most albums?"*

---

## 🤝 Contributing

MCP-Maker is designed for community contributions — each new **connector** is a self-contained PR:

1. Create `src/mcp_maker/connectors/your_connector.py`
2. Subclass `BaseConnector`
3. Implement `validate()` and `inspect()`
4. Register with `register_connector("scheme", YourConnector)`
5. Add tests

See `connectors/sqlite.py` as a reference implementation.

---

## 📦 Installation

```bash
# Core (SQLite + Files)
pip install mcp-maker

# With PostgreSQL support
pip install mcp-maker[postgres]

# With all connectors
pip install mcp-maker[all]

# Development
pip install mcp-maker[dev]
```

## License

MIT
