fix lint and rename

This commit is contained in:
ihrpr 2025-04-08 16:16:51 +01:00
commit 161b8da3e0
No known key found for this signature in database

View file

@ -135,11 +135,11 @@ app.post('/mcp', async (req: Request, res: Response) => {
});
// Helper function to detect initialize requests
function isInitializeRequest(body: any): boolean {
function isInitializeRequest(body: unknown): boolean {
if (Array.isArray(body)) {
return body.some(msg => msg.method === 'initialize');
return body.some(msg => typeof msg === 'object' && msg !== null && 'method' in msg && msg.method === 'initialize');
}
return body.method === 'initialize';
return typeof body === 'object' && body !== null && 'method' in body && body.method === 'initialize';
}
// Start the server