Choose the server-everything transport on the command line#1673
Conversation
…mand line.
# 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 modelcontextprotocol#1594
…mand line. * Update README.md
|
Looks good, I was also able to publish this branch to a personal version of the package in npm and run all variations on my Windows machine:
|
olaservo
left a comment
There was a problem hiding this comment.
Thanks for adding this, left a comment on a logging issue but works for me on the terminal so far.
* In stdio.ts - change console.log to console.error
* In sse.ts & streamableHttp.ts - change console.log to console.error
…-npx Choose the server-everything transport on the command line

Description
Update
server-everythingto allow choosing the transport on the command line.In src/everything/index.ts
In src/everything/stdio.ts
In src/everything/sse.ts
In src/everything/streamableHttp.ts
In README.md
Server Details
Motivation and Context
To allow specifying the transport to start the server with on the command line.
Valid commands
Run the default (stdio) server
npx @modelcontextprotocol/server-everythingOr specify stdio explicitly
npx @modelcontextprotocol/server-everything stdioRun the SSE server
npx @modelcontextprotocol/server-everything sseRun the streamable HTTP server
npx @modelcontextprotocol/server-everything streamableHttpHow Has This Been Tested?
npxwill invoke with the argsnpm linkin src/everything and then test withnpxBreaking Changes
Nope.
Types of changes
Checklist
Additional context