spring-ai-mcp-authorization-demo
このプロジェクトは、Springフレームワークを使用したAIベースのMCP認証デモです。ユーザー認証と権限管理を強化するための機能を提供し、セキュリティ分析を行います。Javaで実装されており、APIとの連携が可能です。
GitHubスター
15
ユーザー評価
未評価
お気に入り
0
閲覧数
29
フォーク
8
イシュー
0
README
Spring AI MCP Security demo
This repository showcases Spring AI MCP security integration.
Usage
Before starting, set your Anthropic key in the env var ANTHROPIC_API_KEY
.
- Run the authorization-server project, it starts on port 9000
- Run the MCP Server (mcp-weather-webmvc-server)
- Run the MCP client Servlet app (mcp-sse-servlet-webflux-client)
- Navigate to http://localhost:8080/
- When you try to get the temperature for, say, Paris, you will be redirected to the auth-server on port 9000. Log in
withuser
/password
. Tadaa 🎉- there will be a nasty error in the console logs. This is expected, it's from Spring Security's OAuth2 internals.
- Subsequent calls will not require a login.
Notes on WebFlux
If you would like to build a fully reactive Spring AI app, you need to use WebFlux. Some changes to Spring AI are
required to get it to work.
You MUST use this exact build of Spring
AI: https://github.com/Kehrlann/spring-ai/tree/dgarnier/poc-propagate-reactive-context-to-mcp-async
You MUST use the Anthropic model.
- Run the authorization-server project, it starts on port 9000
- Run the MCP Server (mcp-weather-webmvc-server)
- Run the MCP client Reactive app (mcp-sse-webflux)
- Navigate to http://localhost:8081/
- When you try to get the temperature for, say, Paris, you will be redirected to the auth-server on port 9000. Log in
withuser
/password
. Tadaa 🎉- there will be a nasty error in the console logs. This is expected, it's from Spring Security's OAuth2 internals.
- Subsequent calls will not require a login.