@whook/mcp
v27.0.2
Published
Adds an MCP server that proxies the API routes
Downloads
726
Maintainers
Readme
@whook/mcp
Adds an MCP server that proxies the API routes
This module provides MCP capabilities to a Whook server !
Usage
This module requires @whook/authorization.
Setup
Install the module:
npm i @whook/mcpUpdate the types (usually in src/whook.d.ts):
+import {
+ type WhookMCPServerConfig,
+ type WhookMCPHandlerConfig,
+ type WhookMCPRouteConfig,
+} from '@whook/mcp';
// ...
declare module 'application-services' {
export interface AppConfig
extends WhookBaseConfigs,
// (...)
+ WhookMCPServerConfig,
+ WhookMCPHandlerConfig,
JWTServiceConfig {}
// ...
declare module '@whook/whook' {
export interface WhookRouteConfig
- extends WhookBaseRouteConfig {}
+ extends WhookBaseRouteConfig,
+ WhookMCPRouteConfig {}
}
}Declare the plugin into your src/index.ts file:
// (...)
// Setup your own whook plugins or avoid whook defaults by leaving it empty
$.register(
constant('WHOOK_PLUGINS', [
...WHOOK_DEFAULT_PLUGINS,
+ '@whook/mcp',
'@whook/cors',
]),
);
// ...
Alternatively, you can use the HTTP router wrapper if you wish to use several
wrappers for it by cloning the httpRouter
service file in your project.
