Add internal/auth package and update documentation for MCP spec 7.1 authentication#245
Merged
Add internal/auth package and update documentation for MCP spec 7.1 authentication#245
Conversation
- Created internal/auth package with header parsing functionality - Added comprehensive package documentation per MCP spec 7.1 - Updated AGENTS.md with auth package structure and tasks - Updated README.md with authentication section - Updated inline comments in server/auth.go and guard/context.go Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update documentation for auth package refactoring
Add internal/auth package and update documentation for MCP spec 7.1 authentication
Jan 14, 2026
This was referenced Jan 14, 2026
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.
Centralizes authentication logic into a dedicated
internal/authpackage and updates documentation to reflect MCP specification 7.1 compliance for Authorization headers.Changes
New
internal/authpackage:ParseAuthHeader()- Extracts API key and agent ID from Authorization headers per MCP spec 7.1 (plain API key, not Bearer scheme)ValidateAPIKey()- Validates provided API keys against expected valuesDocumentation updates:
AGENTS.md- Added auth package to Project Structure and Common Tasks sectionsREADME.md- Added Authentication section under Security Features documenting:Authorization: <api-key>(plain text, NOTBearer <token>)MCP_GATEWAY_API_KEYenvironment variableinternal/server/auth.go- Added reference to auth package for header parsinginternal/guard/context.go- Added note about MCP spec 7.1 compliant parsingExample Usage
Request format:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.