An MCP server that creates, manages, and tests other MCP servers. Built to work with both Claude Desktop and Claude Code agent teams.
MCP Factory is itself an MCP server. When invoked by Claude, it spawns a Claude agent (via @anthropic-ai/claude-agent-sdk) that writes, builds, tests, and installs a new MCP server — all from a natural language description.
Each generated server uses stdio transport, so multiple agent team members can use the same server simultaneously (each spawns its own process).
| Tool | Description |
|---|---|
create_mcp |
Create a new MCP server from a description. Spawns an agent to write, build, test, and install it. |
list_mcps |
List all factory-created servers with installation status for both Claude Desktop and Claude Code. |
remove_mcp |
Remove a server from both configs and delete its directory. |
test_mcp |
Run the MCP JSON-RPC protocol handshake against an existing server. |
Add to your Claude Code settings (~/.claude/settings.json):
{
"mcpServers": {
"mcp-factory": {
"command": "node",
"args": ["/path/to/mcpfactory/dist/index.js"]
}
}
}Or to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"mcp-factory": {
"command": "node",
"args": ["/path/to/mcpfactory/dist/index.js"]
}
}
}npm install
npm run buildAsk Claude to create an MCP server:
"Create an MCP server called weather-lookup that fetches current weather for a city using the OpenWeatherMap API"
The factory will:
- Scaffold the project in
~/mcpfactory/servers/<name>/ - Spawn a Claude agent to write the implementation
- Run
npm installandnpx tscto verify compilation - Test the server via JSON-RPC protocol handshake
- Install to both Claude Desktop and Claude Code settings
You can also specify tools explicitly:
{
"name": "weather-lookup",
"description": "Fetch current weather data",
"tools": [
{
"name": "get_weather",
"description": "Get current weather for a city",
"parameters": {
"city": { "type": "string", "description": "City name", "required": true }
}
}
],
"env_vars": {
"OPENWEATHERMAP_API_KEY": "your-key-here"
}
}Created servers are installed to ~/.claude/settings.json under the mcp-factory- prefix, making them available to Claude Code agent teams. Since each server uses stdio transport, every team member spawns its own isolated process — no concurrency issues.
mcpfactory/
src/
index.ts # MCP server entry point (4 tools)
agent/
spawn.ts # Claude agent spawning via SDK
prompts.ts # System/user prompt templates
config/
desktop-config.ts # Claude Desktop config management
claude-code-config.ts # Claude Code settings management
tools/
create-mcp.ts # Create server handler
list-mcps.ts # List servers handler
remove-mcp.ts # Remove server handler
test-mcp.ts # Test server handler
testing/
mcp-tester.ts # JSON-RPC protocol test runner
servers/ # Generated MCP servers live here
Every server created by the factory follows these conventions:
- TypeScript with ES2022 target and Node16 module resolution
@modelcontextprotocol/sdkfor MCP protocolzodfor input schema validationStdioServerTransportfor communication- No
console.log(stdout is reserved for JSON-RPC protocol) - Compiled output in
dist/, source insrc/