MCP工具工厂(TypeScript)
从自然语言描述、OpenAPI规范、数据库模式、GraphQL模式或本体生成生产就绪的MCP(模型上下文协议)服务器。
](https://www.npmjs.com/package/@heshamfsalama/mcp-tool-factory) ](https://www.npmjs.com/package/@heshamfsalama/mcp-tool-factory)    ](https://nodejs.org/) 
为什么选择MCP?
这 模型上下文协议(MCP) 是一个开放标准,使人工智能助手能够安全地与外部数据源和工具连接。MCP服务器公开了可供以下人员使用的工具:
- 克劳德代码 和 克劳德桌面
- OpenAI代理SDK
- Google ADK(代理开发工具包)
- LangChain 和 CrewAI
- 任何兼容MCP的客户端
MCP工具工厂允许您在几秒钟内生成完整的、可用于生产的MCP服务器。
特性
| 特性 | 描述 |
|---|---|
| 自然语言 | 用简单的英语描述你的工具 |
| OpenAPI导入 | 将任何REST API规范转换为MCP工具 |
| 数据库CRUD | 从SQLite或PostgreSQL模式生成工具 |
| GraphQL导入 | 将GraphQL模式转换为MCP工具(查询为读取,突变为写入) |
| 本体导入 | 从RDF/OWL、JSON-LD或YAML本体生成 |
| 资源和提示 | 完全支持所有三种MCP原语:工具、资源和提示 |
| 10名法学硕士提供者 | Anthropic、OpenAI、谷歌、Mistral、DeepSeek、Groq、xAI、Azure、Cohere+Claude代码通过Vercel AI SDK |
| 成本跟踪 | 每次通话成本计算、预算限制、提供商成本比较 |
| 并行生成 | 同时生成的工具实现可实现更快的输出 |
| LLM响应缓存 | 使用可配置的TTL消除相同的LLM调用 |
| 流式HTTP | 生成的服务器使用现代可流式HTTP传输 |
| 网页搜索 | Auto-fatch API文档以实现更好的生成 |
| 生产就绪 | 内置日志记录、指标、速率限制、重试 |
| 类型安全 | 带有严格模式的完整TypeScript |
| MCP注册表 | 生成server.json用于注册表发布 |
| 是MCP服务器 | 直接与Claude一起使用它来动态生成服务器 |
用作MCP服务器
MCP工具工厂本身就是一个MCP服务器!将其添加到Claude Desktop、Claude Code、Cursor或VS Code中,通过对话生成MCP服务器。
第1层——零配置(克劳德代码)
Claude Code自动注入 CLAUDE_CODE_OAUTH_TOKEN --不需要env变量:
claude mcp add mcp-tool-factory -- node /path/to/mcp-tool-factory-ts/bin/mcp-server.js第2层——标准(选择提供商)
设置一个API键并执行。工厂自动检测提供商:
克劳德桌面/光标/VS代码 --添加到MCP配置(claude_desktop_config.json, .cursor/mcp.json,或 .vscode/mcp.json):
{
"mcpServers": {
"mcp-tool-factory": {
"command": "node",
"args": ["/path/to/mcp-tool-factory-ts/bin/mcp-server.js"],
"env": {
"ANTHROPIC_API_KEY": "your-key-here"
}
}
}
}这些API密钥中的任何一个都可以工作: 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.
第3层——完全控制(供应商+型号+预算)
使用 MCP_FACTORY_PROVIDER, MCP_FACTORY_MODEL,以及 MCP_FACTORY_BUDGET 要覆盖自动检测:
{
"mcpServers": {
"mcp-tool-factory": {
"command": "node",
"args": ["/path/to/mcp-tool-factory-ts/bin/mcp-server.js"],
"env": {
"OPENAI_API_KEY": "your-key-here",
"MCP_FACTORY_PROVIDER": "openai",
"MCP_FACTORY_MODEL": "gpt-5.2",
"MCP_FACTORY_BUDGET": "0.50"
}
}
}
}| 环境变量 | 目的 | 示例 |
|---|---|---|
MCP_FACTORY_PROVIDER | 覆盖自动检测到的提供程序 | openai, groq, deepseek |
MCP_FACTORY_MODEL | 覆盖默认模型 | gpt-5.2, deepseek-chat |
MCP_FACTORY_BUDGET | 每代预算限额(美元) | 0.50 |
完全控制的Claude Code CLI:
claude mcp add mcp-tool-factory \
-e DEEPSEEK_API_KEY=your-key \
-e MCP_FACTORY_PROVIDER=deepseek \
-e MCP_FACTORY_MODEL=deepseek-chat \
-e MCP_FACTORY_BUDGET=0.25 \
-- node /path/to/mcp-tool-factory-ts/bin/mcp-server.js可用工具
| 工具 | 说明 |
|---|---|
generate_mcp_server | 从自然语言描述生成 |
generate_from_openapi | 根据OpenAPI规范生成 |
generate_from_database | 从数据库架构生成 |
generate_from_graphql | 从GraphQL模式生成 |
generate_from_ontology | 从RDF/OWL、JSON-LD或YAML本体生成 |
validate_typescript | 验证TypeScript代码 |
list_providers | 列出可用的LLM提供商 |
get_factory_info | 获得工厂能力 |
对话示例
你: 为GitHub API创建MCP服务器,使用工具列出转发、创建问题和管理拉取请求 克劳德: *用途generate_mcp_server工具* 我使用以下工具生成了一个完整的MCP服务器: -list_repositories-列出用户存储库 -create_issue-创建新问题 -list_pull_requests-列出回购的PR -merge_pull_request-合并PR 让我把这些文件写入你的项目。..
快速开始
安装
# Global installation
npm install -g @heshamfsalama/mcp-tool-factory
# Or use npx
npx @heshamfsalama/mcp-tool-factory generate "Create tools for managing a todo list"设置API密钥
至少需要一个提供程序API密钥:
# Anthropic Claude (recommended)
export ANTHROPIC_API_KEY=your-key-here
# Or Claude Code OAuth
export CLAUDE_CODE_OAUTH_TOKEN=your-token-here
# Or any other supported provider
export OPENAI_API_KEY=your-key-here
export GOOGLE_API_KEY=your-key-here
export MISTRAL_API_KEY=your-key-here
export DEEPSEEK_API_KEY=your-key-here
export GROQ_API_KEY=your-key-here
export XAI_API_KEY=your-key-here
export AZURE_OPENAI_API_KEY=your-key-here
export COHERE_API_KEY=your-key-here生成您的第一台服务器
# From natural language
mcp-factory generate "Create tools for fetching weather data by city and converting temperatures"
# From OpenAPI spec
mcp-factory from-openapi ./api-spec.yaml
# From database
mcp-factory from-database ./data.db
# From GraphQL schema
mcp-factory from-graphql ./schema.graphql
# From ontology
mcp-factory from-ontology ./ontology.owl --format rdf用法
自然语言生成
mcp-factory generate "Create tools for managing a todo list with priorities" \
--name todo-server \
--output ./servers/todo \
--web-search \
--logging \
--metricsOpenAPI规范
# From local file
mcp-factory from-openapi ./openapi.yaml --name my-api-server
# With custom base URL
mcp-factory from-openapi ./spec.json --base-url https://api.example.com数据库模式
# SQLite
mcp-factory from-database ./myapp.db --tables users,posts,comments
# PostgreSQL
mcp-factory from-database "postgresql://user:pass@localhost/mydb" --type postgresqlGraphQL架构
# From a GraphQL SDL file
mcp-factory from-graphql ./schema.graphql --name my-graphql-server
# From a URL endpoint
mcp-factory from-graphql https://api.example.com/graphql --name my-api-serverGraphQL查询被映射到只读MCP工具,突变被映射到写工具。GraphQL类型会自动转换为Zod验证模式。
本体论
# From RDF/OWL (.owl, .rdf, .ttl)
mcp-factory from-ontology ./ontology.owl --format rdf --name knowledge-server
# From JSON-LD (.jsonld)
mcp-factory from-ontology ./schema.jsonld --format jsonld --name linked-data-server
# From custom YAML ontology
mcp-factory from-ontology ./domain.yaml --format yaml --name domain-serverOWL类映射到MCP资源,对象属性成为工具,数据属性成为工具参数。
测试与服务
# Run tests
mcp-factory test ./servers/my-server
# Start server for testing
mcp-factory serve ./servers/my-server生成的服务器结构
servers/my-server/
├── src/
│ └── index.ts # MCP server with tools, resources, and prompts
├── tests/
│ └── tools.test.ts # Vitest tests (InMemoryTransport)
├── package.json # Dependencies
├── tsconfig.json # TypeScript config
├── Dockerfile # Container deployment
├── README.md # Usage documentation
├── skill.md # Claude Code skill file
├── server.json # MCP Registry manifest
├── EXECUTION_LOG.md # Generation trace (optional)
└── .github/
└── workflows/
└── ci.yml # GitHub Actions CI/CD生成的服务器导出a createServer() 工厂功能,便于测试。服务器使用Streamable HTTP传输 /mcp POST端点和a /health GET端点。测试使用 InMemoryTransport.createLinkedPair() 使用vitest进行快速、可靠的过程测试。
CLI参考
| 命令 | 描述 |
|---|---|
generate | 从自然语言生成MCP服务器 |
from-openapi | 根据OpenAPI规范生成 |
| `from-database | |
| ` | 从数据库架构生成 |
from-graphql | 从GraphQL模式生成 |
from-ontology | 从RDF/OWL、JSON-LD或YAML本体生成 |
test | 对生成的服务器运行测试 |
serve | 启动服务器进行测试 |
info | 显示工厂信息 |
生成选项
mcp-factory generate "..." \
--output, -o
# Output directory (default: ./servers)
--name, -n # Server name
--description, -d # Package description
--github-username, -g # GitHub username for MCP Registry
--version, -v # Server version (default: 1.0.0)
--provider, -p
# LLM provider (anthropic, openai, google, mistral, deepseek, groq, xai, azure, cohere, claude_code)
--model, -m # Specific model to use
--web-search, -w # Search web for API documentation
--auth # Environment variables for auth
--health-check # Include health check endpoint (default: true)
--logging # Enable structured logging (default: true)
--metrics # Enable Prometheus metrics
--rate-limit # Rate limiting (requests per minute)
--retries # Enable retry logic (default: true)
--budget # Maximum spend in USD (aborts if exceeded)
--compare-costs # Show cost comparison across providers before generating配置
环境变量
| 变量 | 描述 | 必填 |
|---|---|---|
ANTHROPIC_API_KEY | 人类克劳德API密钥 | 至少一个 |
CLAUDE_CODE_OAUTH_TOKEN | Claude Code OAuth令牌 | 提供者密钥 |
OPENAI_API_KEY | 需要OpenAI API密钥 | |
GOOGLE_API_KEY | Google Gemini API密钥 | 用于生成 |
MISTRAL_API_KEY | Mistral AI API密钥 | |
DEEPSEEK_API_KEY | DeepSeek API密钥 | |
GROQ_API_KEY | Groq API密钥 | |
XAI_API_KEY | xAI Grok API密钥 | |
AZURE_OPENAI_API_KEY | Azure OpenAI API密钥 | |
COHERE_API_KEY | 一致的API密钥 |
LLM提供商
所有供应商都使用 Vercel AI SDK 通过统一 UnifiedLLMProvider 类具有惰性动态导入——只有 @ai-sdk/* 所选提供程序的包将在运行时加载。
| 提供商 | 型号 | 最适合 |
|---|---|---|
| 拟人 | claude-opus-4-6,claude-connet-4-5,claude-haiku-4-5 | 最高品质 |
| OpenAI | gpt-5.2,gpt-5.2索引,o3,o4 mini | 快速生成 |
| 谷歌 | 双子座3-pro、双子座3-flash、双子座-2.5-pro | 性价比高 |
| Mistral | Mistral大,代码,magister | 欧洲AI,代码 |
| DeepSeek | 深度搜索聊天,深度搜索推理器 | 超低成本 |
| Groq | Calma-3.3-70b,Calma-4-Maverick | 超快速推理 |
| xAI | grok-4、grok-3、grok代码快速 | 推理 |
| Azure | gpt-4o(Azure托管) | 企业合规性 |
| Cohere | command-a,command-r+ | RAG,企业搜索 |
| Claude Code | Claude-sonnet-4-5(OAuth) | Claude Code用户 |
程序化使用
基本用法
import { ToolFactoryAgent, writeServerToDirectory, formatCost } from '@heshamfsalama/mcp-tool-factory';
// Create agent (auto-detects provider from env vars)
const agent = new ToolFactoryAgent();
// Generate from description
const server = await agent.generateFromDescription(
'Create tools for managing a todo list with priorities',
{
serverName: 'todo-server',
webSearch: true,
parallel: true, // Enable parallel generation (default)
maxConcurrency: 5, // Max concurrent LLM calls (default)
budget: 1.00, // Optional: abort if cost exceeds $1.00
productionConfig: {
enableLogging: true,
enableMetrics: true,
},
}
);
// Cost tracking — see how much the generation cost
if (server.executionLog) {
console.log(`Cost: ${formatCost(server.executionLog.totalCost)}`);
}
// Write to directory
await writeServerToDirectory(server, './servers/todo');来自OpenAPI
import { ToolFactoryAgent, writeServerToDirectory } from '@heshamfsalama/mcp-tool-factory';
import { readFileSync } from 'fs';
import yaml from 'js-yaml';
const spec = yaml.load(readFileSync('./openapi.yaml', 'utf-8'));
const agent = new ToolFactoryAgent({ requireLlm: false });
const server = await agent.generateFromOpenAPI(spec, {
serverName: 'my-api-server',
baseUrl: 'https://api.example.com',
});
await writeServerToDirectory(server, './servers/api');来自数据库
import { ToolFactoryAgent, writeServerToDirectory } from '@heshamfsalama/mcp-tool-factory';
const agent = new ToolFactoryAgent({ requireLlm: false });
// SQLite (auto-detected from file path)
const server = await agent.generateFromDatabase('./data/app.db', {
serverName: 'app-database-server',
tables: ['users', 'posts', 'comments'],
});
// PostgreSQL (auto-detected from connection string)
const pgServer = await agent.generateFromDatabase(
'postgresql://user:pass@localhost/mydb',
{ serverName: 'postgres-server' }
);
await writeServerToDirectory(server, './servers/app-db');来自GraphQL
import { ToolFactoryAgent, writeServerToDirectory } from '@heshamfsalama/mcp-tool-factory';
import { readFileSync } from 'fs';
const schema = readFileSync('./schema.graphql', 'utf-8');
const agent = new ToolFactoryAgent({ requireLlm: false });
const server = await agent.generateFromGraphQL(schema, {
serverName: 'my-graphql-server',
});
await writeServerToDirectory(server, './servers/graphql');来自本体论
import { ToolFactoryAgent, writeServerToDirectory } from '@heshamfsalama/mcp-tool-factory';
import { readFileSync } from 'fs';
const ontologyData = readFileSync('./ontology.owl', 'utf-8');
const agent = new ToolFactoryAgent({ requireLlm: false });
const server = await agent.generateFromOntology(ontologyData, {
serverName: 'knowledge-server',
format: 'rdf',
});
await writeServerToDirectory(server, './servers/knowledge');代码验证
import { validateTypeScriptCode, validateGeneratedServer } from '@heshamfsalama/mcp-tool-factory';
// Validate TypeScript syntax
const result = await validateTypeScriptCode(code);
// { valid: false, errors: [{ line: 4, column: 1, message: "'}' expected." }] }
// Validate complete server
const serverResult = await validateGeneratedServer(serverCode);
// { valid: true, errors: [], summary: 'Generated server code is syntactically valid' }与AI框架一起使用
克劳德代码/克劳德桌面
添加到MCP设置(claude_desktop_config.json):
{
"mcpServers": {
"my-server": {
"command": "npx",
"args": ["tsx", "./servers/my-server/src/index.ts"]
}
}
}OpenAI代理SDK
from agents import Agent
from agents.mcp import MCPServerStdio
async with MCPServerStdio(
command="npx",
args=["tsx", "./servers/my-server/src/index.ts"]
) as mcp:
agent = Agent(
name="My Agent",
tools=mcp.list_tools()
)谷歌ADK
from google.adk.tools.mcp_tool import MCPToolset
tools = MCPToolset(
connection_params=StdioServerParameters(
command="npx",
args=["tsx", "./servers/my-server/src/index.ts"]
)
)LangChain
from langchain_mcp_adapters.client import MCPClient
client = MCPClient(
command="npx",
args=["tsx", "./servers/my-server/src/index.ts"]
)
tools = client.get_tools()生产特点
结构化日志记录
mcp-factory generate "..." --logging生成服务器 皮诺 结构化JSON日志记录:
const logger = pino({ level: 'info' });
logger.info({ tool: 'get_weather', params }, 'Tool called');普罗米修斯指标
mcp-factory generate "..." --metrics生成服务器 舞会客户 韵律学:
mcp_tool_calls_total-工具调用计数器mcp_tool_duration_seconds-执行时间柱状图
速率限制
mcp-factory generate "..." --rate-limit 100每个客户端可配置的速率限制,带有滑动窗口。
重试逻辑
mcp-factory generate "..." --retries瞬时故障的指数回退重试。
结构化错误代码
生成的服务器使用结构化错误代码进行一致的错误处理:
INVALID_INPUT-刀具参数格式错误或无效NOT_FOUND-请求的资源不存在AUTH_ERROR-身份验证或授权失败INTERNAL_ERROR-意外的服务器错误
增强健康检查
这 /health 终结点返回详细的服务器状态:
{
"status": "ok",
"version": "1.0.0",
"uptime": 3600,
"memory": { "rss": 52428800, "heapUsed": 20971520 },
"transport": "streamable-http"
}MCP注册表发布
将生成的服务器发布到 MCP注册表 为了可发现性。
使用注册表支持生成
mcp-factory generate "Create weather tools" \
--name weather-server \
--github-username your-github-username \
--description "Weather tools for Claude" \
--version 1.0.0这将生成符合注册表的文件:
package.json:
{
"name": "@your-github-username/weather-server",
"mcpName": "io.github.your-github-username/weather-server"
}server.json:
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "io.github.your-github-username/weather-server",
"packages": [{
"registryType": "npm",
"identifier": "@your-github-username/weather-server",
"transport": { "type": "stdio" }
}],
"tools": [...]
}发布工作流
# 1. Build and publish to npm
cd ./servers/weather-server
npm install && npm run build
npm publish --access public
# 2. Install mcp-publisher
brew install modelcontextprotocol/tap/mcp-publisher
# 3. Authenticate
mcp-publisher login github
# 4. Publish to registry
mcp-publisher publish看 出版指南 详细说明。
建筑
┌───────────────────────────────────────────────────────────────────────┐
│ MCP Tool Factory │
├───────────────────────────────────────────────────────────────────────┤
│ Input Sources │
│ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌─────────┐│
│ │ Natural │ │ OpenAPI │ │ Database │ │ GraphQL │ │Ontology ││
│ │ Language │ │ Spec │ │ Schema │ │ Schema │ │RDF/YAML ││
│ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ └────┬────┘│
│ └──────────┬───┴─────────────┴─────────────┴────────────┘ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────────────┐ │
│ │ ToolFactoryAgent │ │
│ │ ┌─────────────────────────────────────────────────────────┐ │ │
│ │ │ UnifiedLLMProvider (Vercel AI SDK) │ │ │
│ │ │ Anthropic │ OpenAI │ Google │ Mistral │ DeepSeek │ │ │
│ │ │ Groq │ xAI │ Azure │ Cohere + Claude Code OAuth │ │ │
│ │ └─────────────────────────────────────────────────────────┘ │ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌───────────────────────┐ │ │
│ │ │ LLM Cache │ │ Cost │ │ Parallel Generation │ │ │
│ │ │ (TTL-based) │ │ Tracking │ │ (max concurrency: 5) │ │ │
│ │ └──────────────┘ └──────────────┘ └───────────────────────┘ │ │
│ └────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────────────┐ │
│ │ Generators │ │
│ │ ServerGenerator │ DocsGenerator │ TestsGenerator │ │
│ └────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────────────┐ │
│ │ GeneratedServer │ │
│ │ Tools │ Resources │ Prompts │ Tests │ Docs │ Dockerfile │ │
│ └────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────────────┐ │
│ │ Streamable HTTP Transport │ │
│ │ POST /mcp │ GET /health │ │
│ └────────────────────────────────────────────────────────────────┘ │
└───────────────────────────────────────────────────────────────────────┘发展
# Clone the repository
git clone https://github.com/HeshamFS/mcp-tool-factory-ts.git
cd mcp-tool-factory-ts
# Install dependencies
pnpm install
# Build
pnpm run build
# Run tests
pnpm test
# Type check
pnpm run typecheck
# Lint
pnpm run lint项目结构
mcp-tool-factory-ts/
├── src/
│ ├── agent/ # Main ToolFactoryAgent
│ ├── auth/ # OAuth2 providers
│ ├── cache/ # LLM response caching with configurable TTL
│ ├── cli/ # Command-line interface
│ ├── config/ # Configuration management
│ ├── database/ # Database introspection (SQLite, PostgreSQL)
│ ├── execution-logger/ # Execution logging
│ ├── generators/ # Code generators (server, docs, tests)
│ ├── graphql/ # GraphQL SDL parsing and server generation
│ ├── middleware/ # Validation middleware
│ ├── models/ # Data models
│ ├── observability/ # Telemetry and tracing
│ ├── ontology/ # Ontology parsing (RDF/OWL, JSON-LD, YAML)
│ ├── openapi/ # OpenAPI spec parsing
│ ├── production/ # Production code generation
│ ├── prompts/ # LLM prompt templates
│ ├── providers/ # LLM providers (10 providers via Vercel AI SDK + Claude Code)
│ ├── security/ # Security scanning
│ ├── server/ # MCP server mode (factory-as-a-server)
│ ├── templates/ # Handlebars templates for generated files
│ ├── validation/ # Code validation and Zod schemas
│ └── web-search/ # Web search integration
├── docs/ # Documentation
├── tests/ # Test files
└── dist/ # Built output文档
故障排除
常见问题
找不到API密钥
# Check your environment
echo $ANTHROPIC_API_KEY
# Set it
export ANTHROPIC_API_KEY=your-key-here生成的服务器无法启动
# Install dependencies first
cd ./servers/my-server
npm install
npx tsx src/index.tsTypeScript错误
# Validate generated code
import { validateGeneratedServer } from '@heshamfsalama/mcp-tool-factory';
const result = await validateGeneratedServer(code);
console.log(result.errors);看 故障排除指南 更多解决方案。
更新日志
v0.3.0
- Vercel AI SDK迁移 -所有LLM提供商现在都使用 Vercel AI SDK 通过单一
UnifiedLLMProvider类与懒惰的动态导入。删除了特定于提供者的实现的~473个LOC。唯有@ai-sdk/*所选提供程序的包将在运行时加载。 - 10名法学硕士提供者 -除了现有的Anthropic、OpenAI、Google和Claude Code提供商外,还添加了Mistral、DeepSeek、Groq、xAI、Azure和Cohere。所有这些都使用相同的统一界面。
- 成本跟踪 -现在,每次LLM调用都会使用50多种型号的内置定价表计算估计成本。显示每次调用成本、总生成成本和每个阶段的细分(工具提取、实施、测试、文档)。详细的令牌细分包括来自AI SDK的缓存读/写令牌和推理令牌。
- 预算限额 (
--budget)-设置美元最高消费额。一代人优雅地终止了BudgetExceededError如果累计成本超过预算。 - 供应商成本比较 (
--compare-costs)-在生成之前,估算所有可用提供商的成本,并显示排序的比较表。不需要额外的API调用-使用静态定价表。 - 每阶段成本明细 -CLI输出和执行日志显示了哪些生成步骤成本最高(工具提取、实现、资源提取、提示提取、测试生成、文档生成)。
- OpenAI推理模型支持 -对于不支持温度参数的OpenAI o系列和gpt-5.x型号,温度参数会自动省略。
v0.2.0版本
- 可流式HTTP传输 -生成的服务器使用
StreamableHTTPServerTransport与本地http模块而不是Express/SSE(2025年6月弃用)。单/mcpPOST端点/healthGET端点。 - MCP SDK v1.26.0 -更新自
^1.0.0到^1.26.0 - 资源和提示 -完全支持所有三种MCP原语。资源公开结构化数据(文档、数据库记录、文件树)。提示为指导LLM工作流程提供了可重用的模板。代理通过LLM自动从描述中提取资源和提示。
- GraphQL输入源 新
from-graphqlCLI命令和generate_from_graphqlMCP工具。查询映射到读取工具,突变映射到写入工具,GraphQL类型转换为Zod模式。 - 本体输入源 新
from-ontologyCLI命令和generate_from_ontologyMCP工具。支持RDF/OWL、JSON-LD和自定义YAML格式。OWL类映射到资源,ObjectProperties映射到工具,DataProperties映射到工具参数。 - LLM响应缓存 -使用可配置的TTL消除相同的LLM调用。旁通
skipCache选项。 - 并行生成 -默认情况下同时生成的工具实现(
parallel: true,maxConcurrency: 5).多工具服务器的速度显著提高。 - 内存传输测试 -生成的测试使用
InMemoryTransport.createLinkedPair()而不是子进程生成。服务器导出createServer()工厂功能可测试性。 - 生产增强 -速率限制、结构化日志记录、指标和持续时间跟踪连接到工具处理程序中。通过版本、正常运行时间、内存和传输信息增强健康检查。结构化错误代码:
INVALID_INPUT,NOT_FOUND,AUTH_ERROR,INTERNAL_ERROR.
v0.1.0
- TypeScript初始版本
- 使用Claude、Claude Code、OpenAI、Google Gemini生成自然语言
- OpenAPI 3.0+规范导入
- 数据库CRUD生成(SQLite、PostgreSQL)
- 生产特征(测井、指标、限速)
- MCP注册表服务器.json生成
- TypeScript语法验证
- API文档的Web搜索
- GitHub操作CI/CD生成
- 使用Claude进行动态生成的MCP服务器模式
许可证
麻省理工学院
