MCP Create Server
MCP 创建服务器
动态 MCP 服务器管理服务,用于动态创建、运行和管理模型上下文协议 (MCP) 服务器。此服务本身充当 MCP 服务器,并以子进程的形式启动/管理其他 MCP 服务器,从而实现灵活的 MCP 生态系统。
主要特点
MCP 服务器代码的动态创建和执行
仅支持 TypeScript(计划在未来版本中支持 JavaScript 和 Python)
在子 MCP 服务器上执行工具
服务器代码更新并重启
删除不必要的服务器
Related MCP server: dynamic-mcp
安装
注意:Docker 是运行此服务的推荐方式
Docker 安装(推荐)
# Build Docker image
docker build -t mcp-create .
# Run Docker container
docker run -it --rm mcp-create手动安装(仅限 TypeScript)
# Clone repository
git clone https://github.com/tesla0225/mcp-create.git
cd mcp-create
# Install dependencies
npm install
# Build
npm run build
# Run
npm start与 Claude Desktop 集成
将以下内容添加到您的 Claude Desktop 配置文件( claude_desktop_config.json )中:
{
"mcpServers": {
"mcp-create": {
"command": "docker",
"args": ["run", "-i", "--rm", "mcp-create"]
}
}
}可用工具
工具名称 | 描述 | 输入参数 | 输出 |
从模板创建服务器 | 从模板创建 MCP 服务器 | 语言:字符串 | { 服务器 ID:字符串,消息:字符串 } |
执行工具 | 在服务器上执行工具 | serverId: stringtoolName: stringargs: 对象 | 工具执行结果 |
获取服务器工具 | 获取服务器工具列表 | 服务器ID:字符串 | { 工具:工具定义[] } |
删除服务器 | 删除服务器 | 服务器ID:字符串 | { 成功:布尔值,消息:字符串 } |
列表服务器 | 获取正在运行的服务器列表 | 没有任何 | { 服务器:字符串[] } |
使用示例
创建新服务器
{
"name": "create-server-from-template",
"arguments": {
"language": "typescript"
}
}执行工具
{
"name": "execute-tool",
"arguments": {
"serverId": "ba7c9a4f-6ba8-4cad-8ec8-a41a08c19fac",
"toolName": "echo",
"args": {
"message": "Hello, dynamic MCP server!"
}
}
}技术规格
Node.js 18 或更高版本
TypeScript(必需)
依赖项:
@modelcontextprotocol/sdk:MCP 客户端/服务器实现
child_process(Node.js内置):子进程管理
fs/promises(Node.js 内置):文件操作
uuid:唯一服务器ID生成
安全注意事项
**代码执行限制:**当服务执行任意代码时,请考虑沙盒
**资源限制:**设置内存、CPU 使用率、文件数量等的限制。
**进程监控:**监控并强制终止僵尸进程或失控进程
**路径验证:**正确验证文件路径以防止目录遍历攻击
执照
麻省理工学院
Available Tools
5 toolscreate-server-from-templateC
Create a new MCP server from a template.
以下のテンプレートコードをベースに、ユーザーの要求に合わせたサーバーを実装してください。 言語に応じて適切なテンプレートを選択し、必要に応じて機能を追加・変更してください。
TypeScriptテンプレート:
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import {
CallToolRequestSchema,
ListToolsRequestSchema
} from "@modelcontextprotocol/sdk/types.js";
const server = new Server({
name: "dynamic-test-server",
version: "1.0.0"
}, {
capabilities: {
tools: {}
}
});
// ここでツールを実装してください
server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: [{
name: "echo",
description: "Echo back a message",
inputSchema: {
type: "object",
properties: {
message: { type: "string" }
},
required: ["message"]
}
}]
};
});
server.setRequestHandler(CallToolRequestSchema, async (request) => {
if (request.params.name === "echo") {
// TypeScriptの型を適切に扱うため、型アサーションを使用
const message = request.params.arguments.message as string;
// または any を使う: const message: any = request.params.arguments.message;
return {
content: [
{
type: "text",
text: `Echo: ${message}`
}
]
};
}
throw new Error("Tool not found");
});
// Server startup
const transport = new StdioServerTransport();
server.connect(transport);Pythonテンプレート:
import asyncio
from mcp.server import Server
from mcp.server.stdio import stdio_server
app = Server("dynamic-test-server")
@app.list_tools()
async def list_tools():
return [
{
"name": "echo",
"description": "Echo back a message",
"inputSchema": {
"type": "object",
"properties": {
"message": {"type": "string"}
},
"required": ["message"]
}
}
]
@app.call_tool()
async def call_tool(name, arguments):
if name == "echo":
return [{"type": "text", "text": f"Echo: {arguments.get('message')}"}]
raise ValueError(f"Tool not found: {name}")
async def main():
async with stdio_server() as streams:
await app.run(
streams[0],
streams[1],
app.create_initialization_options()
)
if __name__ == "__main__":
asyncio.run(main())注意事項:
TypeScript実装時は、引数の型を適切に扱うために型アサーション(as string)を使用するか、 明示的に型を宣言してください(例:const value: string = request.params.arguments.someValue)。
複雑な型を扱う場合は、interface や type を定義して型安全性を確保することをお勧めします。
ユーザーの要求に応じて上記のテンプレートを参考にカスタマイズしてください。その際、基本的な構造を維持しつつ、ツール名や機能を変更できます。
Inputs: language (required), code, dependencies.
delete-serverC
Delete a server
Inputs: serverId (required).
execute-toolC
Execute a tool on a server
Inputs: serverId (required), toolName (required), args.
get-server-toolsC
Get the tools available on a server
Inputs: serverId (required).
list-serversB
List all running servers
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Most tools have distinct purposes: create, delete, list, get tools, and execute. However, 'execute-tool' could potentially overlap with server-specific tools, but its description clarifies it's for executing tools on servers, making it reasonably distinct. The set covers different aspects of server management without significant ambiguity.
All tools follow a consistent verb-noun pattern with hyphens: create-server-from-template, delete-server, execute-tool, get-server-tools, list-servers. The naming is predictable and uniform throughout the set, making it easy for agents to understand the action and target.
With 5 tools, the count is appropriate for a server management domain, covering core operations like creation, deletion, listing, and tool interaction. It's slightly lean but reasonable; adding a tool for server status or configuration might enhance completeness, but the current scope is well-defined.
The tool set covers basic server lifecycle (create, delete, list) and tool interaction (get tools, execute), but has notable gaps. Missing operations include updating server configurations, stopping/starting servers, or monitoring server status, which are common in server management. Agents might encounter dead ends when needing to modify existing servers beyond deletion.
Maintenance
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
Marketplace and infrastructure for MCP servers and skills: deploy, host, monetize, analytics.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
An MCP server that provides agents access to the KeldynAI platform
Related MCP Servers
- AlicenseAqualityDmaintenanceA lightweight framework for building and running Model Context Protocol (MCP) servers using FastMCP, providing tools for development, debugging, and server management.4MIT
- AlicenseBqualityDmaintenanceDynamic MCP server for Node.js enabling runtime tool creation, management, and execution in isolated sandboxes (Docker or Node).84 npm1MIT
- AlicenseNot gradedqualityNot gradedmaintenanceAn enhanced dynamic MCP server management service that creates, runs, and manages Model Context Protocol servers with multi-language support and strict parameter validation.MIT
- FlicenseNot gradedqualityNot gradedmaintenanceA service orchestration layer for the Model Context Protocol. Manages multiple MCP services through a single unified interface — spawn, supervise, and route tool calls across all your services.1-