@forinda/kickjs-mcp
Expose controller routes as Model Context Protocol tools for Claude, Claude Code, Cursor and other MCP clients. Every option, field and type is in the MCP reference; the MCP guide covers how to use them.
Installation
pnpm add @forinda/kickjs-mcp @modelcontextprotocol/serverExports
| Export | Description |
|---|---|
McpAdapter | Adapter factory: discovers tools and serves the MCP endpoint |
@McpTool(opts) | Expose a controller method as a tool |
McpToolError | Throw from a custom tool for a typed, machine-readable error |
MCP_ADAPTER | DI token for the adapter instance (McpAdapterInstance) |
getMcpToolMeta | Read @McpTool options for a method |
isMcpTool | Whether a method carries @McpTool |
MCP_TOOL_METADATA | Metadata key @McpTool writes |
Types: McpResourceProvider, McpResource, McpResourceTemplate, McpResourceLink, McpResourceContext, McpResourceSummary, McpResourceReadResult, McpAdapterInstance, McpAdapterOptions, McpAuthOptions, McpPrincipal, McpRequestInfo, McpCallContext, McpProtectedResourceOptions, McpToolOptions, McpToolDefinition, McpToolAnnotations, McpToolSummary, McpCustomTool, McpToolContext, McpToolProvider, McpToolExample, McpExposureMode, McpTransport.
Behaviour in brief
- Tool calls are requests to your routes, run in-process through the full pipeline (middleware, contributors, guards, validation) with the caller's credentials and host. No listening server is needed.
- Identity and access:
auth.authenticatereturns the caller;toolFilterpicks each caller's tools; toolscopesanswer 403insufficient_scope;protectedResourceserves OAuth metadata. - Resources:
registerResourceProviderserves fixed URIs and URI templates, filtered per caller withresourceFilter. - Asking the user: custom tools call
ctx.elicitfor a confirmation or a missing field. - Serving: protocol 2026-07-28 and the 2025 revisions on one endpoint. 2025 clients get a session each, or
stateless: truefor several instances; stdio for local clients. Works on Express, Fastify, h3 and h3 v2.
Related
- MCP guide and reference
- AI — call the same routes from your own agent loop
- Route flags