Compare commits
2 Commits
3e0ed2d6c6
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66cf3e851e | ||
|
|
15127c3cbd |
10
src/index.ts
10
src/index.ts
@@ -11,7 +11,7 @@ import express, { Request, Response } from 'express';
|
||||
import { ToolHandlers } from './tool-handlers.js';
|
||||
|
||||
// Define the default model to use when none is specified
|
||||
const DEFAULT_MODEL = 'qwen/qwen2.5-vl-32b-instruct:free';
|
||||
const DEFAULT_MODEL = 'openai/gpt-4o-mini';
|
||||
|
||||
interface ServerOptions {
|
||||
apiKey?: string;
|
||||
@@ -110,9 +110,9 @@ class OpenRouterMultimodalServer {
|
||||
return;
|
||||
}
|
||||
|
||||
// Let the transport handle the SSE stream
|
||||
// Let the transport handle the SSE stream (no body for GET)
|
||||
const transport = transports[sessionId];
|
||||
await transport.handleRequest(req, res);
|
||||
await transport.handleRequest(req, res, undefined);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -174,9 +174,9 @@ class OpenRouterMultimodalServer {
|
||||
transport = transports[sessionId];
|
||||
}
|
||||
|
||||
// Handle the request
|
||||
// Handle the request - pass body for POST, omit for GET/DELETE
|
||||
try {
|
||||
await transport.handleRequest(req, res);
|
||||
await transport.handleRequest(req, res, req.body);
|
||||
} catch (error) {
|
||||
console.error('[MCP] Request handling error:', error);
|
||||
if (!res.headersSent) {
|
||||
|
||||
Reference in New Issue
Block a user