Submit

MCP with OAuth

@akshay12390

a year ago
developer-tools
Forked from
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?

  1. Securing an MCP server for authorized access.
  2. Implementing token-based authentication for applications using MCP.
  3. 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.

© 2025 MCP.so. All rights reserved.

Build with ShipAny.

MCP with OAuth MCP Server