feat: add MCP_SERVER_ENDPOINT env var with transport auto-detection#1056
Open
koepalex wants to merge 2 commits intomodelcontextprotocol:mainfrom
Open
feat: add MCP_SERVER_ENDPOINT env var with transport auto-detection#1056koepalex wants to merge 2 commits intomodelcontextprotocol:mainfrom
koepalex wants to merge 2 commits intomodelcontextprotocol:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
modelcontextprotocol/inspector is a great tool, that I use regularly to test my own MCP servers. In my environment the server endpoint of the mcp server changes (e.g. running multiple instances, port already occupied etc.) to address this I use either dotnet aspire or docker compose which will start the mcp server along with the inspector. I would like to pass the currently used mcp server endpoint as environment variable.
Type of Change
Changes Made
server/src/index.ts:README.md:Usage example:
SSE transport (auto-detected from /sse path)
Streamable HTTP transport (auto-detected from /mcp path)
Related Issues
Testing
Test Results and/or Instructions
Checklist
npm run prettier-fix)Breaking Changes
Additional Context
As this is a relatively small change, I hope it can get merged before V2 (architecture changes) are done, even if it is not a bugfix.