spring-ai-mcp-authorization-demo
This project is an AI-based MCP authorization demo using the Spring framework. It provides features to enhance user authentication and authorization management, along with security analysis capabilities. Implemented in Java, it allows integration with APIs.
GitHub Stars
15
User Rating
Not Rated
Favorites
0
Views
18
Forks
8
Issues
0
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.
JVM Diagnostics MCP is a server that wraps various JVM diagnostic tools, enhancing CLI functionalities. It utilizes tools like jstat, jcmd, and jps to monitor JVM performance, manage processes, and execute diagnostic commands. However, due to security risks, it is recommended to use it in a trusted environment.
The mCP-ABE_API is a Java library that implements attribute-based encryption, allowing access control based on specific policies. This library can be used by companies to restrict access to confidential documents, ensuring that only users meeting certain criteria can access the information. Designed for high security and flexibility, this API is particularly suitable for scenarios requiring elevated security levels.