Currently if the init method in McpAgent throws an error the user will only see Error 1101
This is not ideal. If I wrap the serveSSE methods calls with catch I still see the Error 1101 screen
export class MyMCP extends McpAgent<Env> {
server = new Server(
{
name: 'Framer MCP',
version: '1.8.0',
},
{
capabilities: {
tools: {},
prompts: {},
resources: {},
},
},
)
// ideal solution, allow user to handle errors. Pass a default onError handler
async onError(error) {
return new Response(
error instanceof Error ? error.message : String(error),
{ status: 500 },
)
}
async init() {
throw new Error(
'this error is impossible to handle sending a Response back',
)
}
}
Currently if the
initmethod inMcpAgentthrows an error the user will only seeError 1101This is not ideal. If I wrap the
serveSSEmethods calls with catch I still see theError 1101screen