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
基本情報
Reference https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/weather/starter-webmvc-oauth2-server
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"mcp-weather-oauth2-server": {
"command": "npx",
"args": [
"@modelcontextprotocol/inspector@0.6.0"
]
}
}
}ツール一覧はまだありません
この掲載には表示できるツール一覧がまだありません。サーバーにツールがないという意味ではありません。対応機能はプロジェクトのドキュメントをご確認ください。
上のボタンで一時的なサンドボックスでこのサーバーを実行し、ツール一覧を取得できます。
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.
Live FrontRowTickets.com ticket inventory for AI agents: search, availability, pricing, deals.
Give your AI agent a real design engine. Create, edit and export real, editable designs from Claude Code, Codex, Cursor and more.
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

Lets Claude, ChatGPT and other MCP clients build and run AI video pipelines on Treza, from script and generated shots to narration, captions and posting to YouTube or TikTok.

Plan, create and schedule social media content from your AI assistant. Blaze makes on-brand posts, carousels and short videos, writes blog posts and newsletters, and schedules them to Instagram, TikTok, YouTube, LinkedIn
コメント