- Implement new tool that returns configurable number of resource links (1-10)
- Each link includes URI, name, description, and MIME type from available resources
- Minor formatting fixes for trailing commas and whitespace
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
In the first case (line 16) we already know that req.query.sessionId is set to something. I
n the second (line 40), it doesn't matter because if it doesn't map to a transport no further action is taken.
For both sse and streamableHttp, a server instance needs to be created for each transport. Otherwise, when a new client connects and its new transport is connected to the single server, the previous transport is overwritten in the server instance and can no longer communicate.
* In sse.ts
- remove global server, cleanup, and transport vars
- add transports map
- in sse GET handler,
- check for sessionId, there shouldn't be one, so comment "Reconnecting?" and do nothing if present
- if sessionId not present
- create new server and transport instance
- connect server to transport
- add transport to transports map
- in server.onclose, delete the transport from the transports map and call cleanup
- in /message POST handler
- get the sessionId from the request
- get the transport from the map by sessionId
- handle the message if the transport was found
* In streamableHttp.ts
- remove the global server and cleanup vars
- change transports var to Map
- in /mcp POST handler
- when creating a new session
- create a server instance
- in server.onclose, delete the transport from the transports map and call cleanup
- remove the calls to cleanup and server.close in the SIGINT handler, because the transport is closed and its onclose handler closes the server.
- Replace console.log with console.error throughout
* In src/everything/sse.ts
- remove the process.exit() in the server.onclose handler so reconnections are possible
# Run the default (stdio) server
```npx @modelcontextprotocol/server-everything```
# Or specify stdio explicitly
```npx @modelcontextprotocol/server-everything stdio```
# Run the SSE server
```npx @modelcontextprotocol/server-everything sse```
# Run the streamable HTTP server
```npx @modelcontextprotocol/server-everything streamableHttp```
* In src/everything/index.ts
- refactor/extracted contents to stdio.ts
- replaced with code that
- Gets the single argument from the commandline as scriptName
- switches on scriptName
- imports the appropriate server script or outputs usage options
- scripts run on import
* In src/everything/stdio.ts
- added console log "Starting default (STDIO) server..."
* In src/everything/sse.ts
- added console log "Starting SSE server..."
* In src/everything/streamableHttp.ts
- added console log "Starting Streamable HTTP server..."
* This fixes#1594
In everything.ts
- add a 10 second interval for sending 'notifications/stderr' messages to the client
This was created in order to test the display and clearing of stderr messages in the client.
- see https://github.com/modelcontextprotocol/inspector/pull/286
- Add new tool 'getResourceReference' that returns embedded resources
- Add new prompt 'resource_prompt' demonstrating embedded resources in prompts
- Update documentation with new tool and prompt details
- Create CLAUDE.md with development guidelines
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>