@ts-kizuna/mcp
v1.64.1
Published
MCP server generation for ts-kizuna contracts
Downloads
2,774
Readme
@ts-kizuna/mcp
@ts-kizuna/mcp adds an MCP (Model Context Protocol) endpoint to your API. The tools you declare, and the routes you choose to publish, become tools that AI assistants can discover and call.
Installation
pnpm add @ts-kizuna/mcpUsage
Declare the plugin on k.contract:
import { mcpPlugin } from '@ts-kizuna/mcp';
import { k } from './k';
import { routes } from './routes';
export const contract = k.contract({
routes,
plugins: {
mcp: mcpPlugin({
name: 'My API',
}),
},
});Then pass its server half to server.api, where the MCP SDK and the transport live:
import { mcpPluginServer } from '@ts-kizuna/mcp/server';
export const api = server.api({
router,
plugins: {
mcp: mcpPluginServer(),
},
});