A CLI tool to create MCP (Model Context Protocol) applications with ease.
- 🚀 Quick project scaffolding
- 📦 TypeScript support out of the box
- 🛠️ Built-in development tools
- 🔧 Configurable project templates
npm create mcp-kit@latest
or
yarn create mcp-kit@latest
or
pnpm create mcp-kit@latest
The generated project will have the following structure:
├── src/
│ ├── tools/ # MCP tools implementation
│ ├── resources/ # MCP resources implementation
│ ├── prompts/ # MCP prompts implementation
│ ├── services/ # Server implementations (stdio/web)
│ └── index.ts # Entry point
├── tests/ # Test files
├── scripts/ # Build and development scripts
├── .github/ # GitHub Actions workflows
└── package.json
- npm run dev - Start the development server in stdio mode
- npm run dev:web - Start the development server in web mode
- npm run build - Build the project
- npm run test - Run tests
- npm run coverage - Generate test coverage report
Implement custom tools that can be used by MCP clients:
server.registerTool(
'GetData',
{
title: 'Get Data',
description: 'Get Data',
inputSchema: {
keyword: z.string().describe('search keyword'),
},
},
async ({ keyword }) => {
// Your implementation
}
)
Define resources that can be accessed by MCP clients:
server.registerResource(
'search',
new ResourceTemplate('search://{keyword}', {
list: undefined,
}),
{
title: 'Search Resource',
description: 'Dynamic generate search resource',
},
async (uri, { keyword }) => {
// Your implementation
}
)
Create reusable prompts for MCP clients:
server.registerPrompt(
'echo',
{
title: 'Echo Prompt',
description: 'Creates a prompt to process a message.',
argsSchema: {
message: z.string(),
},
},
({ message }) => {
// Your implementation
}
)
Feel free to dive in! Open an issue or submit PRs.
Standard Readme follows the Contributor Covenant Code of Conduct.
This project exists thanks to all the people who contribute.
MIT © MichaelSun