mcp
by xuemingqi
Overview
This server acts as a Model Context Protocol (MCP) tool provider, exposing various functionalities (like user management and mail services) as AI-callable tools for Spring AI applications.
Installation
java -jar x-mcp-server/target/x-mcp-server-1.0.0.jarEnvironment Variables
- SPRING_DATASOURCE_URL
- SPRING_DATASOURCE_USERNAME
- SPRING_DATASOURCE_PASSWORD
- SPRING_REDIS_REDISSON_SINGLE_ADDRESS
- SPRING_REDIS_REDISSON_SINGLE_PASSWORD
- SPRING_AI_MCP_SERVER_NAME
- SPRING_AI_MCP_SERVER_VERSION
- SPRING_AI_MCP_SERVER_SSE_MESSAGE_ENDPOINT
Security Notes
Critical security risks identified: 1. **Hardcoded Empty Passwords:** `application.yml` contains hardcoded empty passwords for MySQL (`password: ''`) and Redis (`password: ''`). This is highly insecure and makes the server vulnerable to unauthorized access. 2. **Hardcoded API Keys:** The client's `application.yml` (though not the primary focus, it's part of the repo) contains a hardcoded DeepSeek/OpenAI API key (`api-key: sk-413c6606010c4852939181278ed7e4a2`), which is a critical secret exposure. 3. **Custom Authentication via Query Params:** The `McpFilter` implements custom authentication using `key` or `sessionId` passed as query parameters. Relying on query parameters for sensitive authentication tokens is generally less secure than using HTTP headers, as query parameters can be logged more easily and persist in browser history/proxy logs. 4. **Extensive Logging:** The `McpFilter` logs full request and response bodies, which could inadvertently expose sensitive data if not handled with caution in production environments. 5. **Test Secrets:** The `ClientSse.java` test file contains a hardcoded key (`sk-e7030e17d1d64881a44a53b359af1644`), which is poor practice even in test code as it could be mistakenly deployed or reveal patterns.
Similar Servers
solon-ai
The Model Context Protocol (MCP) server provides a standardized interface for AI models to interact with external tools, resources, and prompt templates through a structured, bidirectional communication protocol.
solon-ai-embedded-examples
Provides examples of integrating AI functionalities (LLM interaction, RAG, Agent, and Model Context Protocol server/client) within various Java web frameworks.
spring-boot-ai
A Spring Boot application implementing a Model Context Protocol (MCP) server that provides a remote 'Booking Tool' for an AI agent.
MCP-Client-Host-Java
An MCP (Model Context Protocol) client that acts as a server to the MCP host, managing connections to various external MCP servers (tools) and orchestrating tool discovery and execution for AI assistants.