Skip to content

feat(auth-middleware): add example MCP server with JWT and API key #339

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yasomaru
Copy link
Contributor

This commit introduces a new example demonstrating the integration of authentication middleware with an MCP server. The server supports both JWT token and API key authentication, along with scope-based access control for various MCP tools. Key features include token generation endpoints, in-memory API key storage, and a health check endpoint.

New files added:

  • main.go: Implements the MCP server and authentication logic.
  • go.mod and go.sum: Manage dependencies for the project.
  • README.md: Provides setup instructions, available endpoints, and example usage.

This example serves as a reference for implementing secure access to MCP tools.

Fixes #330

…thentication

This commit introduces a new example demonstrating the integration of authentication middleware with an MCP server. The server supports both JWT token and API key authentication, along with scope-based access control for various MCP tools. Key features include token generation endpoints, in-memory API key storage, and a health check endpoint.

New files added:
- `main.go`: Implements the MCP server and authentication logic.
- `go.mod` and `go.sum`: Manage dependencies for the project.
- `README.md`: Provides setup instructions, available endpoints, and example usage.

This example serves as a reference for implementing secure access to MCP tools.
@findleyr findleyr requested review from jba and ant-joe and removed request for ant-joe August 20, 2025 23:39
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.

Example of how to use Auth Middleware
1 participant