Skip to content

Add Authorization header if init SSETransport with token #105

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

Closed
wants to merge 1 commit into from

Conversation

stevensu1977
Copy link

Add Authorization header if init SSETransport with token, you can protect your MCP SSE Server with Authorization header.

Motivation and Context

I think MCP is great idea , we can provide service through SSE MCP Server , but this version client not support Auth header , so I add it to SDK

How Has This Been Tested?

new SSEClientTransport(new URL("your mcp server url "),"you token")

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@santiq
Copy link

santiq commented Dec 26, 2024

I think It would be better to pass Headers and not just token.

Several apis use different prefix and header name for authentication

Copy link
Member

@jspahrsummers jspahrsummers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the comment above—I think this change is a bit too limited. It would make sense to support open-ended additions to the headers list here. Would you like to make that change? 🙏

@jspahrsummers
Copy link
Member

Nevermind, superseded by #109.

Thank you for the PR nonetheless!

Pizzaface pushed a commit to RewstApp/mcp-inspector that referenced this pull request May 2, 2025
…vin/1733551277-capability-negotiation

feat: implement capability negotiation for UI tabs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants