mcpkit
mcpkit copied to clipboard
MCPKit is a TypeScript library that lets you build MCP servers using decorators. Instead of manually wiring up handlers and schemas, you just decorate your methods and let the library handle the rest.
MCPKit
A modern, decorator-based framework for building Model Context Protocol (MCP) servers in TypeScript.
Why MCPKit?
- Decorator-based API - Clean, declarative syntax inspired by NestJS
- Type-safe - Full TypeScript support with automatic type inference
- Production-ready - Built-in auth, rate limiting, metrics, tracing, and health checks
- Extensible - Plugin system for reusable functionality
- Multiple transports - stdio, HTTP/SSE, and Streamable HTTP support
Quick Start
npx @mcpkit-dev/cli init my-server
cd my-server
npm run dev
Or install manually:
npm install @mcpkit-dev/core reflect-metadata zod
import 'reflect-metadata';
import { createServer, MCPServer, Tool, Param } from '@mcpkit-dev/core';
@MCPServer({
name: 'my-server',
version: '1.0.0',
})
class MyServer {
@Tool({ description: 'Greet someone' })
greet(@Param({ name: 'name', description: 'Name to greet' }) name: string) {
return `Hello, ${name}!`;
}
}
const server = createServer(MyServer);
await server.listen();
Documentation
Packages
| Package | Description |
|---|---|
| @mcpkit-dev/core | Core framework with decorators and server |
| @mcpkit-dev/cli | CLI for project scaffolding |
| @mcpkit-dev/testing | Testing utilities and mock clients |
Using with Claude Desktop
Add to your Claude Desktop config:
{
"mcpServers": {
"my-server": {
"command": "node",
"args": ["/path/to/your/server/dist/index.js"]
}
}
}
Requirements
- Node.js 18+
- TypeScript 5.0+
Contributing
Contributions are welcome! Please read our contributing guidelines.
License
MIT