Get the FREE Ultimate OpenClaw Setup Guide →

spring-ai -security -demo

实现带鉴权的Spring AI MCP 服务,并通过Spring AI/Langchain4j/Cherry Studio进行调用

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ningning0111-spring-ai-mcp-security-server-demo node path/to/server.js \
  --env ENV_VAR="description or placeholder"

How to use

This MCP server exposes endpoints and tooling that can be accessed by multiple MCP clients, including the Spring AI MCP Client, Langchain4j MCP Client, and Cherry Studio. The available integrations allow you to interact with the underlying Spring AI security demo features through standardized MCP requests, enabling you to test prompts, manage sessions, and observe responses from the demo-enabled security modules. Use the included clients to connect to the server, send requests, and parse the responses in your preferred workflow. If you are using the Spring AI MCP Client, you’ll typically construct requests using the client’s API to invoke model inference, authentication checks, or policy decisions; Langchain4j offers a Java-based chain interface for composing prompts and tools; and Cherry Studio provides a UI-oriented way to experiment with prompts and see results in real time. Start with a basic prompt to validate connectivity, then progressively explore the security-focused capabilities demonstrated by this server.

How to install

Prerequisites:

  • Node.js (for the MCP server launcher) or an environment where your chosen command can run as configured
  • Access to the repository containing the MCP server and its dependencies
  • Optional: Docker if you prefer containerized deployment

Install and run (example – adjust to your environment):

  1. Clone the repository git clone https://github.com/your-org/ningning0111-spring-ai-mcp-security-server-demo.git cd ningning0111-spring-ai-mcp-security-server-demo

  2. Install dependencies (adjust if using a different runtime) npm install

  3. Start the MCP server (based on the configured command) npm run start

    or, if using a direct node command as configured in mcp_config

    npm exec node path/to/server.js

  4. Verify the server is running by sending a test MCP request via one of the clients (Spring AI MCP Client, Langchain4j MCP Client, or Cherry Studio) to the server endpoint.

If you prefer Docker:

  1. Build or pull the image (adjust as needed) docker pull your-docker-repo/ningning0111-spring-ai-mcp-security-server-demo:latest

  2. Run the container docker run -i your-docker-repo/ningning0111-spring-ai-mcp-security-server-demo:latest

Prerequisites can vary based on the runtime you choose; replace commands with your actual setup if you deploy differently.

Additional notes

Notes and tips:

  • Ensure the server endpoint is reachable from your client environment (check host/port configuration in mcp_config).
  • If using authentication or security features demonstrated by the demo, set appropriate environment variables (for example, API keys, tokens, or TLS configuration) as required by the server.
  • The repository's MCP clients (Spring AI, Langchain4j) may require specific Java versions or Maven/Gradle configurations; consult the respective client documentation for compatibility.
  • If you encounter port conflicts, adjust the server port in the configuration or use a different host as needed.
  • For debugging, enable verbose logs in both the server and the MCP clients to get detailed request/response traces.

Related MCP Servers

Sponsor this space

Reach thousands of developers