Back to Home
gemo12123 icon

dynamic-java-mcp-server

by gemo12123

Overview

Dynamically registers and exposes internal Java tools as HTTP APIs for AI models using the Model Context Protocol (MCP), enabling a single-process multi-MCP server setup.

Installation

Run Command
mvn clean install && java -jar webmvc-dynamic-mcp-server/target/webmvc-dynamic-mcp-server-*.jar

Environment Variables

  • MCP_REGISTER_ENABLED
  • MCP_REGISTER_MODULEID
  • MCP_REGISTER_MODULENAME
  • MCP_REGISTER_MODULEDESCRIPTION
  • MCP_REGISTER_MODULEVERSION
  • MCP_REGISTER_REPORT_ADDRESSSOURCE
  • MCP_REGISTER_REPORT_FIXEDURLPREFIX

Security Notes

The `HttpExecutor` makes HTTP calls to dynamically configured service instances and paths. If `ModuleDefinition` (containing `ServiceInstance` and `ToolDefinitionWrapper`) is sourced from an untrusted or insufficiently validated external input, this could lead to Server-Side Request Forgery (SSRF) or arbitrary code execution via external tool calls. The `inputSchema` for tools, deserialized into `McpSchema.JsonSchema`, also presents a potential vector if not properly validated for malicious JSON content. No obvious hardcoded secrets or 'eval' equivalents were found in the truncated code, but the dynamic nature requires careful input sanitization and source validation.

Similar Servers

Stats

Interest Score0
Security Score6
Cost ClassMedium
Avg Tokens500
Stars0
Forks0
Last Update2025-11-28

Tags

JavaSpring BootMCP ServerDynamic APIAI Tooling