
Mcp Tool Factory
io.github.HeshamFS由 GitHub 帳號 HeshamFS 發布v0.1.0更新於 Oct 24, 2026
Generate MCP servers from natural language, OpenAPI specs, or database schemas.
概覽
依自然語言描述、OpenAPI 規格、資料庫結構、GraphQL 結構或本體產生完整的 MCP 伺服器。
- 可以做什麼
- MCP Tool Factory 本身就是一個 MCP 伺服器,用來產生其他 MCP 伺服器。其工具包括用於自然語言描述的 generate_mcp_server,以及 generate_from_openapi、generate_from_database、generate_from_graphql 和 generate_from_ontology,另有 validate_typescript、list_providers 和 get_factory_info。產生的內容包含工具、資源、提示、測試、文件、Dockerfile 和登錄清單,並使用 Streamable HTTP 傳輸。
- 適用情境
- 適合需要依現有 API 規格、資料庫結構、GraphQL 結構或本體快速建立新 MCP 伺服器的情境,也適合在對話中描述工具並讓檔案直接寫入專案。主要面向建置 MCP 整合的開發者,而非一般使用者。
- 執行需求
- 以本機 Node.js 程序執行,透過 npm 套件 @heshamfsalama/mcp-tool-factory 或 npx 安裝。產生時需要至少一個 LLM 供應商金鑰,例如 ANTHROPIC_API_KEY、CLAUDE_CODE_OAUTH_TOKEN、OPENAI_API_KEY 或 GOOGLE_API_KEY;也支援其他供應商。選用變數包括 MCP_FACTORY_PROVIDER、MCP_FACTORY_MODEL 和 MCP_FACTORY_BUDGET。僅限桌面端。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mcp Tool Factory,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
MCP Tool Factory (TypeScript)
Generate production-ready MCP (Model Context Protocol) servers from natural language descriptions, OpenAPI specs, database schemas, GraphQL schemas, or ontologies.
[npm version] [npm downloads] [CI] [License: MIT] [TypeScript] [Node.js] [MCP]
Why MCP?
The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect with external data sources and tools. MCP servers expose tools that can be used by:
- Claude Code and Claude Desktop
- OpenAI Agents SDK
- Google ADK (Agent Development Kit)
- LangChain and CrewAI
- Any MCP-compatible client
MCP Tool Factory lets you generate complete, production-ready MCP servers in seconds.
Features
Use as MCP Server
MCP Tool Factory is itself an MCP server! Add it to Claude Desktop, Claude Code, Cursor, or VS Code to generate MCP servers through conversation.
Tier 1 — Zero Config (Claude Code)
Claude Code auto-injects CLAUDE_CODE_OAUTH_TOKEN — no env vars needed:
Tier 2 — Standard (Pick a Provider)
Set one API key and go. The factory auto-detects the provider:
Claude Desktop / Cursor / VS Code — add to your MCP config (claude_desktop_config.json, .cursor/mcp.json, or .vscode/mcp.json):
Any of these API keys will work: ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY, MISTRAL_API_KEY, DEEPSEEK_API_KEY, GROQ_API_KEY, XAI_API_KEY, AZURE_OPENAI_API_KEY, COHERE_API_KEY.
Tier 3 — Full Control (Provider + Model + Budget)
Use MCP_FACTORY_PROVIDER, MCP_FACTORY_MODEL, and MCP_FACTORY_BUDGET to override auto-detection:
Claude Code CLI with full control:
Available Tools
Example Conversation
You: Create an MCP server for the GitHub API with tools to list repos, create issues, and manage pull requests
Claude: Uses
generate_mcp_servertoolI've generated a complete MCP server with the following tools:
list_repositories- List user repositoriescreate_issue- Create a new issuelist_pull_requests- List PRs for a repomerge_pull_request- Merge a PRLet me write these files to your project...
Quick Start
Installation
Set Your API Key
At least one provider API key is required:
Generate Your First Server
Usage
Natural Language Generation
OpenAPI Specification
Database Schema
GraphQL Schema
GraphQL queries are mapped to read-only MCP tools, and mutations are mapped to write tools. GraphQL types are automatically converted to Zod validation schemas.
Ontology
OWL Classes are mapped to MCP Resources, ObjectProperties become Tools, and DataProperties become tool parameters.
Test & Serve
Generated Server Structure
Generated servers export a createServer() factory function for easy testing. The server uses Streamable HTTP transport with a single /mcp POST endpoint and a /health GET endpoint. Tests use InMemoryTransport.createLinkedPair() for fast, reliable in-process testing with vitest.
CLI Reference
Generate Options
Configuration
Environment Variables
LLM Providers
All providers use the Vercel AI SDK via a unified UnifiedLLMProvider class with lazy dynamic imports — only the @ai-sdk/* package for your chosen provider is loaded at runtime.
Programmatic Usage
Basic Usage
From OpenAPI
From Database
From GraphQL
From Ontology
Code Validation
Use with AI Frameworks
Claude Code / Claude Desktop
Add to your MCP settings (claude_desktop_config.json):
OpenAI Agents SDK
Google ADK
LangChain
Production Features
Structured Logging
Generates servers with pino structured JSON logging:
Prometheus Metrics
Generates servers with prom-client metrics:
mcp_tool_calls_total- Counter of tool invocationsmcp_tool_duration_seconds- Histogram of execution times
Rate Limiting
Configurable rate limiting per client with sliding window.
Retry Logic
Exponential backoff retry for transient failures.
Structured Error Codes
Generated servers use structured error codes for consistent error handling:
INVALID_INPUT- Malformed or invalid tool parametersNOT_FOUND- Requested resource does not existAUTH_ERROR- Authentication or authorization failureINTERNAL_ERROR- Unexpected server error
Enhanced Health Check
The /health endpoint returns detailed server status:
MCP Registry Publishing
Publish your generated servers to the MCP Registry for discoverability.
Generate with Registry Support
This generates registry-compliant files:
package.json:
server.json:
Publish Workflow
See Publishing Guide for detailed instructions.
Architecture
Development
Project Structure
Documentation
- Getting Started
- CLI Reference
- API Reference
- Examples
- OpenAPI Guide
- Database Guide
- Providers Guide
- Production Features
- Architecture
- Troubleshooting
- Contributing
Troubleshooting
Common Issues
API Key Not Found
Generated Server Won't Start
TypeScript Errors
See Troubleshooting Guide for more solutions.
Changelog
v0.3.0
- Vercel AI SDK Migration - All LLM providers now use the Vercel AI SDK via a single
UnifiedLLMProviderclass with lazy dynamic imports. Removed ~473 LOC of provider-specific implementations. Only the@ai-sdk/*package for your chosen provider is loaded at runtime. - 10 LLM Providers - Added Mistral, DeepSeek, Groq, xAI, Azure, and Cohere alongside existing Anthropic, OpenAI, Google, and Claude Code providers. All use the same unified interface.
- Cost Tracking - Every LLM call now calculates estimated cost using a built-in pricing table for 50+ models. Shows per-call cost, total generation cost, and per-phase breakdown (tool extraction, implementation, tests, docs). Detailed token breakdowns include cache read/write tokens and reasoning tokens from the AI SDK.
- Budget Limits (
--budget <amount>) - Set a maximum spend in USD. Generation aborts gracefully withBudgetExceededErrorif cumulative cost exceeds the budget. - Provider Cost Comparison (
--compare-costs) - Before generation, estimates cost across all available providers and shows a sorted comparison table. No extra API calls needed — uses the static pricing table. - Per-Phase Cost Breakdown - CLI output and execution logs show which generation steps cost the most (tool extraction, implementation, resource extraction, prompt extraction, test generation, docs generation).
- OpenAI Reasoning Model Support - Temperature parameter is automatically omitted for OpenAI o-series and gpt-5.x models that don't support it.
v0.2.0
- Streamable HTTP Transport - Generated servers use
StreamableHTTPServerTransportwith nativehttpmodule instead of Express/SSE (deprecated June 2025). Single/mcpPOST endpoint with/healthGET endpoint. - MCP SDK v1.26.0 - Updated from
^1.0.0to^1.26.0 - Resources & Prompts - Full support for all three MCP primitives. Resources expose structured data (documents, DB records, file trees). Prompts provide reusable templates for guided LLM workflows. Agent automatically extracts resources and prompts from descriptions via LLM.
- GraphQL Input Source - New
from-graphqlCLI command andgenerate_from_graphqlMCP tool. Queries map to read tools, mutations map to write tools, and GraphQL types are converted to Zod schemas. - Ontology Input Source - New
from-ontologyCLI command andgenerate_from_ontologyMCP tool. Supports RDF/OWL, JSON-LD, and custom YAML formats. OWL Classes map to Resources, ObjectProperties to Tools, DataProperties to tool parameters. - LLM Response Caching - Deduplicates identical LLM calls with configurable TTL. Bypass with
skipCacheoption. - Parallel Generation - Tool implementations generated concurrently by default (
parallel: true,maxConcurrency: 5). Significant speed improvement for multi-tool servers. - InMemoryTransport Testing - Generated tests use
InMemoryTransport.createLinkedPair()instead of subprocess spawning. Servers exportcreateServer()factory function for testability. - Production Enhancements - Rate limiting, structured logging, metrics, and duration tracking wired into tool handlers. Enhanced health check with version, uptime, memory, and transport info. Structured error codes:
INVALID_INPUT,NOT_FOUND,AUTH_ERROR,INTERNAL_ERROR.
v0.1.0
- Initial TypeScript release
- Natural language generation with Claude, Claude Code, OpenAI, Google Gemini
- OpenAPI 3.0+ specification import
- Database CRUD generation (SQLite, PostgreSQL)
- Production features (logging, metrics, rate limiting)
- MCP Registry server.json generation
- TypeScript syntax validation
- Web search for API documentation
- GitHub Actions CI/CD generation
- MCP Server mode for on-the-fly generation with Claude
License
MIT
Links
來源:README.md,提交 7aa12b1
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分