MCP-Client-Host-Java
by Explorerlowi
Overview
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.
Installation
docker-compose up -d --buildEnvironment Variables
- MYSQL_ROOT_PASSWORD
- MYSQL_DATABASE
- MYSQL_USER
- MYSQL_PASSWORD
- TZ
- LLM_QIANWEN_KEY
- MCP_HOST_URL
- MCP_CLIENT_GRPC_HOST
- MCP_CLIENT_GRPC_PORT
- MCP_CLIENT_GRPC_TIMEOUT_SECONDS
- TAVILY_API_KEY
Security Notes
1. Arbitrary Command Execution (Critical): The `MCPStdioClient` executes arbitrary shell commands (`spec.getCommand()`, `spec.getArgs()`) configured for an MCP Server. If a malicious server configuration is registered (e.g., via the exposed `/api/mcp/servers` endpoint), it can lead to remote code execution on the `mcp-client` host. This is a severe vulnerability. 2. Plaintext gRPC Communication (High): The `GrpcClientConfig` uses `usePlaintext()` for gRPC communication between `mcp-host` and `mcp-client`. While noted for development, this is a significant security risk in production as it exposes sensitive data and is vulnerable to Man-in-the-Middle attacks. 3. Sensitive Information Exposure (Medium): Environment variables for API keys (e.g., `TAVILY_API_KEY`) can be passed to container environments for tool execution. While standard for Docker, these should be carefully managed (e.g., using Docker Secrets) and the `.env` file secured, especially given the arbitrary command execution risk.
Similar Servers
tmcp
Build Model Context Protocol (MCP) servers for AI agents, providing schema-agnostic tools, resources, and prompts, with optional OAuth 2.1 authentication and distributed session management.
1xn-vmcp
An open-source platform for composing, customizing, and extending multiple Model Context Protocol (MCP) servers into a single logical, virtual MCP server, enabling fine-grained context engineering for AI workflows and agents.
spring-boot-ai
Provides a remote booking tool via the Model Context Protocol (MCP) for an AI agent.
mcp-server-llmling
mcp-server-llmling serves as a Machine Chat Protocol (MCP) server, providing a YAML-based system to configure and manage LLM applications, including resources, prompts, and tools.