What are the steps to reproduce this issue?
- Install
cbmcp (1.0.0-snapshot) with statsEnabled: true in ModuleConfig.bx
- Start a ColdBox application with the module loaded
- Make a
GET request to http://<host>:<port>/api/cbmcp/stats (as documented in the official docs under Monitoring Tool Calls)
What happens?
ColdBox throws an EventHandlerNotRegisteredException:
The event: api.cbmcp is not a valid registered event.
What were you expecting to happen?
A JSON response containing MCP server usage metrics as described in the docs under "Monitoring Tool Calls":
GET /api/cbmcp/stats
Returns detailed metrics on tool calls, resources accessed, and performance data.
Any logs, error output, etc?
EventHandlerNotRegisteredException
The event: api.cbmcp is not a valid registered event.
Stack trace points to coldbox\system\web\services\HandlerService.cfc:513.
Any other comments?
The MCPServerStats class collects data correctly when statsEnabled: true, and MCPServer exposes getStats() and getStatsSummary() methods. The stats data is there, it just has no HTTP surface.
Workaround: Add the following route to the module's Router.bx before the toMCP catch-all:
route( "/stats", function( event, rc, prc ){
return mcpServer( "cbMCP" ).getStats()
} )
route( "/" ).toMCP( "cbMCP" )
Note: this surfaces the endpoint at /cbmcp/stats rather than /api/cbmcp/stats, as the module entry point is cbmcp, not api/cbmcp.
What versions are you using?
Operating System: Windows 11 Pro 25H2
Package Version: 1.0.0-snapshot
What are the steps to reproduce this issue?
cbmcp (1.0.0-snapshot)withstatsEnabled: trueinModuleConfig.bxGETrequest tohttp://<host>:<port>/api/cbmcp/stats(as documented in the official docs underMonitoring Tool Calls)What happens?
ColdBox throws an
EventHandlerNotRegisteredException:What were you expecting to happen?
A JSON response containing MCP server usage metrics as described in the docs under "Monitoring Tool Calls":
Any logs, error output, etc?
Stack trace points to
coldbox\system\web\services\HandlerService.cfc:513.Any other comments?
The
MCPServerStatsclass collects data correctly whenstatsEnabled: true, andMCPServerexposesgetStats()andgetStatsSummary()methods. The stats data is there, it just has no HTTP surface.Workaround: Add the following route to the module's
Router.bxbefore thetoMCPcatch-all:Note: this surfaces the endpoint at
/cbmcp/statsrather than/api/cbmcp/stats, as the module entry point iscbmcp, notapi/cbmcp.What versions are you using?
Operating System: Windows 11 Pro 25H2
Package Version: 1.0.0-snapshot