go-sdk/examples/server/auth-middleware/go.mod
Shusaku Yasoda a3935c6be2
examples/server: add example MCP server with JWT and API key (#339)
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
2025-09-02 11:49:46 -04:00

15 lines
350 B
Modula-2

module auth-middleware-example
go 1.23.0
require (
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/modelcontextprotocol/go-sdk v0.3.0
)
require (
github.com/google/jsonschema-go v0.2.1-0.20250825175020-748c325cec76 // indirect
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
)
replace github.com/modelcontextprotocol/go-sdk => ../../../