-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Choose the server-everything transport on the command line #1673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
olaservo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…-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