What dependencies are needed to add OAuth2 to an MCP server?
The sample uses Spring Security (infrastructure), Spring Authorization Server (token issuance), and Spring Security OAuth2 Resource Server (token-based authentication).
@akshay12390
Basic information
Reference https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/weather/starter-webmvc-oauth2-server
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp-weather-oauth2-server": {
"command": "npx",
"args": [
"@modelcontextprotocol/inspector@0.6.0"
]
}
}
}Tool list not available yet
This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.
Fetch the live tool list by running this server in a temporary sandbox using the button above.
MCP with OAuth is a sample project that demonstrates how to secure an MCP (Model Context Protocol) server using OAuth2, following the MCP specification’s authorization section. It is intended for developers who need to add OAuth2 authentication to an MCP server.
Run the project with ./mvnw spring-boot:run. Obtain tokens via client credentials or auth code (PKCE). For client credentials, call /oauth2/token with grant_type=client_credentials and authenticate as mcp-client:secret. For PKCE, first run pkce_generator.py and then token_request.py. Use the token with the MCP inspector (npx @modelcontextprotocol/inspector@0.6.0) by pasting it and clicking connect.
The sample uses Spring Security (infrastructure), Spring Authorization Server (token issuance), and Spring Security OAuth2 Resource Server (token-based authentication).
Tokens are valid for 15 minutes.
No. Spring Authorization Server does not support the reactive stack, so issuing tokens only works in Servlet environments.
Store the token obtained from the `/oauth2/token` endpoint, boot the MCP inspector (`npx @modelcontextprotocol/inspector@0.6.0`), paste the token, and click connect.
Continuing education rules for US financial advisors (CFP, CFA, IWI, IAR by state, FINRA, American College) with official sources and verified dates, plus firm-level data, national and state rankings and market stats on

Build TikTok LIVE overlay widgets from Claude or ChatGPT. Describe a widget and the assistant writes it, previews it with sample events and places it on your TikTok LIVE Studio or OBS overlay.

MCP server and CLI for TravelAnimator — generate animated travel videos, itineraries, and trip media from Claude, Codex, or your terminal

Run LinkedIn and email outreach from Claude, safely. Made for lead gen agencies, founders and medium-large companies. Every account gets enforced daily limits, its own proxy, and a review queue before anything sends.
Access 20+ AI video and image models from Google, OpenAI, xAI, ByteDance, and more. Generate and edit videos with Veo 3.1, Sora 2, Seedance, Kling O3, and images with FLUX, Nano Banana, Seedram 4, GPT Image — all in one
Comments