clean up and small fixes to comments
This commit is contained in:
parent
5730f3e92a
commit
e3b4496579
4 changed files with 2 additions and 9 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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]) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue