
create mcp tool
一个用于创建Model Context Protocol (MCP) 服务器的灵活工具。
Repository Info
About This Server
一个用于创建Model Context Protocol (MCP) 服务器的灵活工具。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
@mantiqo/create-mcp
A flexible bootstrap tool for creating Model Context Protocol (MCP) servers.
What is this?
This tool creates a customizable scaffold for building MCP servers with optional enhancements. It provides:
- A complete but minimal TypeScript MCP server implementation
- Support for different transport mechanisms (stdio or HTTP) via templates
- Support for built-in templates, local templates, or GitHub templates
- Customization options for ESLint and Prettier
- Simple example showing the pattern for adding tools
- Easy extensibility for your specific needs
Installation
# Install globally from npm
npm install -g @mantiqo/create-mcp
# Or use npx to run without installing
npx @mantiqo/create-mcp@latest my-mcp-project
Usage
Basic Usage
# Create a new MCP project with stdio transport (default)
create-mcp my-mcp-project
# Create a new MCP project with HTTP transport
create-mcp my-mcp-project --template basic-http
Template Selection
There are three ways to select templates:
-
Using built-in templates:
# Use the stdio template (this is the default) create-mcp my-project --template basic-stdio # Use the HTTP template create-mcp my-project --template basic-http -
Using custom local templates:
# Use a local directory as template create-mcp my-project --template ./path/to/template -
Using GitHub templates:
# Use a GitHub repository as template create-mcp my-project --template https://github.com/username/mcp-template
Other Options
# Skip customization prompts
create-mcp my-mcp-project --no-customize
# Skip installing dependencies
create-mcp my-mcp-project --no-install
Templates
Built-in Templates
- basic-stdio (default): Minimal MCP server with stdio transport and echo tool
- basic-http: Minimal MCP server with HTTP transport and echo tool
Each template is designed for a specific transport mechanism. Choose the one that best fits your needs.
Using Custom Templates
You can use any directory or GitHub repository as a template. The tool will:
- Copy all files from the template
- Update package.json with your project information
- Modify README.md to reflect your project name and description
- Optionally customize with additional features
- Include prompts directory for LLM interaction
Template-Specific Configuration Instructions
Templates can provide their own configuration instructions by including a config-instructions.json file at the root of the template. This file allows templates to define exactly how they should be configured in different environments.
Example config-instructions.json:
{
"transportType": "http",
"Claude Desktop": {
"configPath": "$HOME/Library/Application\\ Support/Claude/claude_desktop_config.json",
"instructions": "Add to mcpServers:",
"snippet": "{\n \"mcpServers\": {\n \"${projectName}\": {\n \"type\": \"sse\",\n \"url\": \"http://localhost:3000/mcp\"\n }\n }\n}"
},
"VS Code": {
"configPath": "$HOME/Library/Application\\ Support/Code/User/settings.json",
"instructions": "Add to settings:",
"snippet": "\"mcp\": {\n \"servers\": {\n \"${projectName}\": {\n \"type\": \"sse\",\n \"url\": \"http://localhost:3000/mcp\"\n }\n }\n}"
}
}
The format supports:
transportType: Specify "http" or "stdio" to indicate which transport mechanism the template uses- Multiple environments (Claude Desktop, VS Code, etc.)
- Template variables:
${projectName}and${projectDir}are automatically replaced - Custom instructions and configuration snippets
Transport Options
The MCP specification defines different transport mechanisms, which are implemented in our built-in templates:
- stdio (basic-stdio template): Simple transport using standard input/output, ideal for direct integration with Claude Desktop
- HTTP (basic-http template): Uses Streamable HTTP transport with Server-Sent Events (SSE) for server-to-client communication
Customization Options
When using built-in templates, you can add optional features:
- ESLint: Adds linting with TypeScript support
- Prettier: Adds code formatting
Features
The generated MCP server includes:
- TypeScript support
- MCP SDK integration
- Basic server setup with the transport defined by the template
- Example echo tool to demonstrate the pattern
- Clean architecture to extend with your own tools
- Prompts directory with reference materials for LLM interaction
Configuration
stdio Transport (basic-stdio template)
After creating a server with the stdio transport template, you can integrate it with Claude Desktop by adding it to your configuration file:
# Edit Claude Desktop config
$HOME/Library/Application\ Support/Claude/claude_desktop_config.json
Or for VS Code:
$HOME/Library/Application\ Support/Code/User/settings.json
In VS Code, add to the settings.json:
"mcp": {
"servers": {
"my-mcp-project": {
"type": "stdio",
"command": "node",
"args": [
"/absolute/path/to/my-mcp-project/dist/index.js"
]
}
}
}
Or for Cursor IDE:
$HOME/.cursor/mcp.json
For Claude Desktop and Cursor, add an entry to the mcpServers section:
{
"mcpServers": {
"my-mcp-project": {
"type": "stdio",
"command": "node",
"args": [
"/absolute/path/to/my-mcp-project/dist/index.js"
]
}
}
}
After updating the configuration, restart Claude Desktop.
HTTP Transport (basic-http template)
After creating a server with the HTTP transport template, start it and connect to it:
# Start the server
npm start
# The MCP endpoint will be available at:
http://localhost:3000/mcp
You can also configure Claude Desktop to use the HTTP-based MCP server:
{
"mcpServers": {
"my-mcp-project": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}
Extending Your Server
The minimal template is designed to be extended. Add your own tools by:
- Editing
src/index.ts - Adding new tool definitions in the
registerTools()method - Following the patterns established in the sample code
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
Quick Start
Clone the repository
git clone https://github.com/posidron/create-mcp-toolInstall dependencies
cd create-mcp-tool
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.