Overview
What is MCP with OAuth?
MCP with OAuth is a sample project that demonstrates how to secure a Model Context Protocol (MCP) server using OAuth2, following the MCP specification.
How to use MCP with OAuth?
To use this project, run the server using the command ./mvnw spring-boot:run, obtain an access token by calling the /oauth2/token endpoint, and then use the MCP inspector to connect with the token.
Key features of MCP with OAuth?
- Demonstrates OAuth2 security for MCP servers
- Provides a sample implementation for obtaining access tokens
- Integrates with Spring Security and Spring Authorization Server
Use cases of MCP with OAuth?
- Securing an MCP server for authorized access.
- Implementing token-based authentication for applications using MCP.
- Learning how to integrate OAuth2 with Spring applications.
FAQ from MCP with OAuth?
- What is the purpose of this project?
This project serves as a demonstration of securing an MCP server using OAuth2.
- How long is the access token valid?
The access token is valid for 5 minutes.
- What dependencies are required?
The project requires Spring Security, Spring Authorization Server, and Spring Security OAuth2 Resource Server.