Back to Home
sandipanchakraborty2016 icon

spring-ai-mcp-demo

Verified Safe

by sandipanchakraborty2016

Overview

Demonstrates the Model Context Protocol (MCP) with Spring AI, showcasing a model-agnostic tool server and AI hosts for OpenAI and Anthropic Claude.

Installation

Run Command
docker-compose up --build

Environment Variables

  • SPRING_AI_OPENAI_API_KEY
  • ANTHROPIC_API_KEY
  • SPRING_AI_MCP_SERVER_TRANSPORT
  • SPRING_AI_MCP_SERVER_SSE_MESSAGE_ENDPOINT
  • SPRING_AI_MCP_CLIENT_TRANSPORT
  • SPRING_AI_MCP_CLIENT_SSE_BASE_URL
  • SPRING_AI_MCP_CLIENT_SSE_MESSAGE_ENDPOINT

Security Notes

The MCP Server's FileService operates within a sandboxed `~/.mcp-demo-workspace` directory, mitigating arbitrary file access. API keys for AI models are correctly handled as environment variables. The direct exposure of tool calls via REST endpoints in `mcp-client` and `mcp-host` (for demonstration) could pose a risk if not properly secured in a production environment, as it bypasses LLM safety layers. However, for a demo, this exposure is intentional for illustrative purposes. No 'eval' or obfuscation found.

Similar Servers

Stats

Interest Score0
Security Score8
Cost ClassMedium
Avg Tokens200
Stars0
Forks0
Last Update2025-11-25

Tags

Spring AIMCPToolingModel-AgnosticJavaMicroservices