clean up and small fixes to comments

This commit is contained in:
ihrpr 2025-04-11 10:42:41 +01:00
commit e3b4496579
No known key found for this signature in database
4 changed files with 2 additions and 9 deletions

View file

@ -30,7 +30,6 @@ async function main(): Promise<void> {
// Connect the client using the transport and initialize the server
await client.connect(transport);
console.log('Connected to MCP server');
// Open a standalone SSE stream to receive server-initiated messages
console.log('Opening SSE stream to receive server notifications...');
try {
await transport.openSseStream();

View file

@ -174,7 +174,7 @@ app.post('/mcp', async (req: Request, res: Response) => {
}
});
// Handle GET requests for SSE streams (now using built-in support from StreamableHTTP)
// Handle GET requests for SSE streams (using built-in support from StreamableHTTP)
app.get('/mcp', async (req: Request, res: Response) => {
const sessionId = req.headers['mcp-session-id'] as string | undefined;
if (!sessionId || !transports[sessionId]) {

View file

@ -8,12 +8,6 @@ import { ReadResourceResult } from '../../types.js';
const server = new McpServer({
name: 'resource-list-changed-notification-server',
version: '1.0.0',
}, {
capabilities: {
resources: {
listChanged: true, // Support notifications for resource list changes
},
}
});
// Store transports by session ID to send notifications

View file

@ -136,7 +136,7 @@ export class StreamableHTTPServerTransport implements Transport {
// or else return HTTP 405 Method Not Allowed
const headers: Record<string, string> = {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
"Cache-Control": "no-cache, no-transform",
Connection: "keep-alive",
};