Build MCP servers from natural language prompts — local-first, privacy-focused
Project description
Generate production-ready MCP servers from natural language prompts.
8 templates · 11 APIs · TypeScript & Python · Docker · Web Dashboard · Claude Desktop integration
MCP Factory
MCP Factory is a CLI + web tool that takes a plain English description and generates a fully working Model Context Protocol server — with tools, types, error handling, validation, code review, and best practices baked in.
pip install "prompt2mcp[web]"
mcpfactory create "a server that reads CSV files and runs SQL queries on them"
No boilerplate. No manual wiring. Just describe what you want.
Table of Contents
- Prerequisites
- Installation
- Quick Start
- Web Dashboard
- Features
- Claude Desktop Integration
- CLI Reference
- Architecture
- Development
- Contributing
- License
Prerequisites
| Requirement | Minimum Version | Why | Check |
|---|---|---|---|
| Python | 3.10+ | Runs MCP Factory itself | python --version |
| pip | latest | Installs MCP Factory | pip --version |
| Node.js | 18+ | Needed to build/run TypeScript servers | node --version |
| npm | 9+ | Installs TypeScript server dependencies | npm --version |
Note: Node.js and npm are only required if you generate TypeScript servers (the default). Python-only servers don't need them.
After installing, run
mcpfactory doctorto verify everything is set up correctly.
Installation
From PyPI (recommended):
# Core CLI only
pip install prompt2mcp
# With web dashboard
pip install "prompt2mcp[web]"
From source:
git clone https://github.com/JatinTaori1904/mcp-factory.git
cd mcp-factory
pip install -e ".[dev,web]"
Quick Start
1. Create your first server
mcpfactory create "github repo manager with issues and PRs"
This generates a complete MCP server in ./output/github-repo-manager/ with:
github-repo-manager/
├── src/
│ └── index.ts # Full MCP server with tools
├── package.json # Dependencies configured
├── tsconfig.json # TypeScript config
├── .env.example # Environment variables needed
├── Dockerfile # Container-ready deployment
├── .dockerignore # Docker build exclusions
└── README.md # Usage instructions
2. Run the generated server
cd output/github-repo-manager
npm install
npm start
2b. Or run with Docker
cd output/github-repo-manager
docker build -t github-repo-manager .
docker run -i --env-file .env github-repo-manager
3. Connect to Claude Desktop
mcpfactory config-add github-repo-manager
# → Automatically adds the server to Claude Desktop's config
That's it — your server is now available as tools in Claude.
More Examples
# Python server for Slack
mcpfactory create "slack bot that posts messages and manages channels" --lang python
# Use OpenAI for smarter analysis
mcpfactory create "stripe payment processor with refunds" --provider openai --model gpt-4
# Interactive mode — MCP Factory asks follow-up questions
mcpfactory create "something for files" --interactive
# Custom name and output directory
mcpfactory create "notion wiki manager" --name my-wiki --output ./servers
# Browse all available templates
mcpfactory templates
# See supported APIs with auth details
mcpfactory supported-apis
Web Dashboard
MCP Factory includes a built-in web dashboard for managing your servers visually.
mcpfactory web
# → Opens at http://localhost:8000
Dashboard features:
| Page | What it does |
|---|---|
| Home | Overview with stats — servers created, templates, APIs, total tools |
| Create | Generate servers from the browser with real-time feedback |
| API Registry | Browse all 11 supported APIs with auth info and free tier status |
| Config | Manage Claude Desktop integration — add/remove servers, export config |
The dashboard uses a modern glassmorphism UI with dark theme, gradient accents, and smooth animations.
# Custom host/port
mcpfactory web --host 0.0.0.0 --port 3000
Features
🧠 Smart Prompt Analysis
A 5-tier LLM pipeline ensures your prompt is always understood:
| Tier | Provider | When |
|---|---|---|
| 1 | Ollama (local) | Default — private, free, offline |
| 2 | OpenAI | --provider openai |
| 3 | Claude | --provider claude |
| 4 | Keyword fallback | Auto if all LLMs unavailable |
| 5 | Default template | Ultimate safety net |
📦 8 Built-in Templates
| Template | Use Case | Tools Generated |
|---|---|---|
file-reader |
Read, search, and watch files | file_read, file_search, file_watch |
database-connector |
Query PostgreSQL, MySQL, SQLite | db_query, db_list_tables, db_describe |
api-wrapper |
Wrap any REST API | api_get, api_post, api_list |
web-scraper |
Scrape and parse web content | scrape_url, extract_links, parse_html |
document-processor |
Parse PDFs, DOCX, Markdown | doc_parse, doc_convert, doc_extract |
auth-server |
OAuth2 / JWT authentication | auth_login, auth_verify, auth_refresh |
data-pipeline |
ETL: extract, transform, load | pipeline_extract, pipeline_transform, pipeline_load |
notification-hub |
Send via email, Slack, webhooks | notify_send, notify_broadcast, notify_schedule |
🔌 11 APIs with Auto-Setup
When your prompt mentions a supported API, MCP Factory auto-generates pre-built, production-ready tools — not generic wrappers.
| API | Auth | Env Variable | Free Tier | Pre-built Tools |
|---|---|---|---|---|
| GitHub | Token | GITHUB_TOKEN |
✅ | gh_list_repos, gh_create_issue, gh_get_pr |
| Slack | Bot Token | SLACK_BOT_TOKEN |
✅ | slack_post, slack_list_channels, slack_reply |
| OpenAI | API Key | OPENAI_API_KEY |
❌ | openai_complete, openai_embed |
| Stripe | Secret Key | STRIPE_SECRET_KEY |
✅ Test | stripe_create_charge, stripe_list_customers |
| Notion | Integration | NOTION_API_KEY |
✅ | notion_query_db, notion_create_page |
| Spotify | OAuth2 | SPOTIFY_CLIENT_ID |
✅ | — |
| API Key | GOOGLE_API_KEY |
✅ Ltd | — | |
| Bearer | TWITTER_BEARER_TOKEN |
✅ Ltd | — | |
| Discord | Bot Token | DISCORD_BOT_TOKEN |
✅ | discord_send, discord_list_channels |
| Linear | API Key | LINEAR_API_KEY |
✅ | — |
| Jira | API Token | JIRA_API_TOKEN |
✅ | — |
💬 Interactive Mode
For vague prompts, MCP Factory asks targeted follow-up questions:
mcpfactory create "build something for files" --interactive
# MCP Factory asks:
# 1. What file types? (code, documents, data files, all)
# 2. What operations? (read, write, search, all)
# → Generates a refined, specific server
✅ MCP Best Practices
Every generated server follows the official MCP best practices:
- Tool annotations —
readOnlyHint,destructiveHint,idempotentHint,openWorldHint - Prefixed naming — Consistent tool prefixes (
gh_,slack_,stripe_) - Schema descriptions — Zod
.describe()/ PydanticField(description=...)on every parameter - Actionable errors — Errors include what went wrong + what to do next
- Pagination — List operations support
cursor/maxResults - Secrets via env vars — Never hardcoded, always from
.env
🔍 LLM Code Review
After generation, an LLM reviews the code for:
- Security issues (hardcoded secrets, injection risks)
- MCP compliance (missing annotations, naming violations)
- Code quality (error handling, edge cases)
- Performance (unnecessary loops, missing pagination)
🌍 TypeScript & Python
mcpfactory create "..." --lang typescript # default
mcpfactory create "..." --lang python
Both languages get the same quality: proper types, error handling, and MCP compliance.
🔒 Privacy First
- All code stays on your local filesystem
- Metadata in local SQLite (
~/.mcpfactory/servers.db) - No telemetry, no cloud, no tracking
- Use Ollama for 100% offline, private generation
Claude Desktop Integration
MCP Factory can automatically configure your servers for Claude Desktop:
# Add a server to Claude Desktop
mcpfactory config-add my-server
# Remove a server
mcpfactory config-remove my-server
# Show current Claude config
mcpfactory config-show
# Export full configuration
mcpfactory config-export
The config-add command:
- Locates your Claude Desktop config file
- Adds the server entry with the correct command and args
- Your server immediately appears in Claude's tool list
CLI Reference
COMMAND DESCRIPTION
─────────────────────────────────────────────────────────────
mcpfactory create <prompt> Generate a new MCP server
-n, --name Server name (auto-generated if omitted)
-l, --lang typescript | python (default: typescript)
-o, --output Output directory (default: ./output)
-p, --provider LLM: ollama | openai | claude (default: ollama)
-m, --model Model name (e.g., llama3, gpt-4)
--interactive / --no-interactive Follow-up questions for vague prompts
mcpfactory list-servers List all generated servers
mcpfactory templates Show available templates
mcpfactory supported-apis Browse APIs with auth details
mcpfactory info <name> Show details for a specific server
mcpfactory delete <name> Delete a server
mcpfactory config-add <name> Add server to Claude Desktop
mcpfactory config-remove <name> Remove server from Claude Desktop
mcpfactory config-show Show Claude Desktop config
mcpfactory config-export Export full configuration
mcpfactory web Launch web dashboard
--host Bind address (default: 127.0.0.1)
--port Port number (default: 8000)
Architecture
┌─────────────────────────────────────────────────┐
│ User Input │
│ (CLI prompt or Web Dashboard) │
└──────────────────────┬──────────────────────────┘
│
┌────────────▼────────────┐
│ Interactive Refinement │ ← Follow-up questions
└────────────┬────────────┘
│
┌────────────▼────────────┐
│ LLM Prompt Analyzer │ ← Ollama / OpenAI / Claude
│ (Keyword Fallback) │ ← Offline safety net
└────────────┬────────────┘
│
┌──────────────┼──────────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────────┐
│ API │ │ Template │ │ LLM Tool │
│ Detector │ │ Matcher │ │ Generator │
│ (11 APIs)│ │(8 templ) │ │ │
└────┬─────┘ └────┬─────┘ └──────┬───────┘
│ │ │
└──────────────┼───────────────┘
▼
┌───────────────────────┐
│ Code Generator │
│ ├─ Pre-built API tools│
│ ├─ LLM-generated tools│
│ └─ Template code │
└───────────┬───────────┘
│
┌───────────▼───────────┐
│ Validator + Linter │ ← Syntax + structure checks
└───────────┬───────────┘
│
┌───────────▼───────────┐
│ LLM Code Reviewer │ ← Security, quality, MCP
└───────────┬───────────┘
│
┌─────────────┼─────────────┐
▼ ▼ ▼
┌──────────┐ ┌───────────┐ ┌──────────┐
│ File │ │ SQLite │ │ Claude │
│ System │ │ Storage │ │ Config │
└──────────┘ └───────────┘ └──────────┘
Development
# Clone and install
git clone https://github.com/JatinTaori1904/mcp-factory.git
cd mcp-factory
pip install -e ".[dev,web]"
# Run all tests (142 tests)
pytest
# Run with verbose output
pytest -v
# Lint
ruff check .
Project Structure
mcp-factory/
├── mcp_factory/
│ ├── cli/ # Typer CLI commands
│ ├── generator/ # Core engine (prompt analysis, code gen, review)
│ ├── storage/ # SQLite database layer
│ └── config/ # Claude Desktop config management
├── web/
│ ├── app.py # FastAPI application
│ ├── templates/ # Jinja2 HTML templates
│ └── static/ # CSS with glassmorphism theme
├── tests/
│ └── test_generator.py # 142 tests across 21 test classes
├── pyproject.toml # Build config (Hatchling)
└── README.md
Contributing
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Install dev dependencies:
pip install -e ".[dev,web]" - Make your changes and add tests
- Run the test suite:
pytest - Submit a pull request
License
MIT — Built by Jatin Taori
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prompt2mcp-0.5.0.tar.gz.
File metadata
- Download URL: prompt2mcp-0.5.0.tar.gz
- Upload date:
- Size: 107.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9621fb77ba5624dab27aaf2e550b13ae7503280015903456939cf1d267669420
|
|
| MD5 |
1b2da5cf75306ad79f029b4f5237ca50
|
|
| BLAKE2b-256 |
a6a87872479e9404e5b2bbce2ec39499714541c51cca08823b51f39e2107bdb6
|
File details
Details for the file prompt2mcp-0.5.0-py3-none-any.whl.
File metadata
- Download URL: prompt2mcp-0.5.0-py3-none-any.whl
- Upload date:
- Size: 103.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30a95a021fa5bbf81ef0780c389865b251061c8a879dcd29ed223e59f04757c8
|
|
| MD5 |
189f786ce247be84924300a6c0dc7c4d
|
|
| BLAKE2b-256 |
eb94aaec7bd33eaa1577e2e14fe44929caf87a1803331f47678425170da681bf
|