
Java Mcp Server Generator
Scaffold a production-shaped Java MCP server with tools, resources, prompts, tests, and Maven or Gradle using the official MCP Java SDK.
Overview
java-mcp-server-generator is an agent skill for the Build phase that scaffolds a complete MCP server project in Java with the official SDK, reactive streams, and optional Spring Boot.
Install
npx skills add https://github.com/github/awesome-copilot --skill java-mcp-server-generatorWhat is this skill?
- Full project tree: application entry, config, tools/resources/prompts packages, and McpServerTest
- Supports Maven pom.xml or Gradle build.gradle.kts with official Java MCP SDK dependencies
- Separates ToolDefinitions/Handlers, ResourceDefinitions/Handlers, and PromptDefinitions/Handlers
- Optional Spring Boot integration via application.properties when requested
- README and test stub included for immediate compile-and-extend workflow
- Six top-level source areas: config, tools, resources, prompts, tests, plus README
- Dual build options: Maven pom.xml or Gradle build.gradle.kts templates
Adoption & trust: 8.5k installs on skills.sh; 34.6k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need a Java MCP server but staring at empty repos and SDK docs costs days before your first tool handler compiles.
Who is it for?
Java-first indie builders adding MCP tools to an existing JVM service or starting a dedicated agent bridge server.
Skip if: Teams wanting Python or Node MCP servers only, or a no-code MCP host without maintaining Java source.
When should I use this skill?
Generate a complete Model Context Protocol server project in Java using the official MCP Java SDK with reactive streams and optional Spring Boot integration.
What do I get? / Deliverables
You receive a Maven or Gradle project with tools, resources, prompts modules, configuration, tests, and README ready to implement handlers and run locally.
- Complete my-mcp-server directory with handlers, config, and McpServerTest stub
- pom.xml or build.gradle.kts wired to the official MCP Java SDK
Recommended Skills
Journey fit
Generating an MCP server is core agent infrastructure work during product build, before you ship clients that consume those tools. Agent-tooling is the shelf for MCP servers, tool handlers, and SDK wiring—not generic REST CRUD unless exposed as MCP capabilities.
How it compares
A codegen scaffold for the Java MCP SDK—not a hosted MCP marketplace entry or a security-hardened production deploy playbook by itself.
Common Questions / FAQ
Who is java-mcp-server-generator for?
Solo developers and small JVM teams exposing APIs or internal actions as MCP tools, resources, and prompts for coding agents.
When should I use java-mcp-server-generator?
During Build agent-tooling when starting a new MCP server; after validate when you know which tools agents must call.
Is java-mcp-server-generator safe to install?
Use the Security Audits panel on this page; generated projects still need your dependency review, secret handling, and network exposure choices.
SKILL.md
READMESKILL.md - Java Mcp Server Generator
# Java MCP Server Generator Generate a complete, production-ready MCP server in Java using the official Java SDK with Maven or Gradle. ## Project Generation When asked to create a Java MCP server, generate a complete project with this structure: ``` my-mcp-server/ ├── pom.xml (or build.gradle.kts) ├── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── com/example/mcp/ │ │ │ ├── McpServerApplication.java │ │ │ ├── config/ │ │ │ │ └── ServerConfiguration.java │ │ │ ├── tools/ │ │ │ │ ├── ToolDefinitions.java │ │ │ │ └── ToolHandlers.java │ │ │ ├── resources/ │ │ │ │ ├── ResourceDefinitions.java │ │ │ │ └── ResourceHandlers.java │ │ │ └── prompts/ │ │ │ ├── PromptDefinitions.java │ │ │ └── PromptHandlers.java │ │ └── resources/ │ │ └── application.properties (if using Spring) │ └── test/ │ └── java/ │ └── com/example/mcp/ │ └── McpServerTest.java └── README.md ``` ## Maven pom.xml Template ```xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>my-mcp-server</artifactId> <version>1.0.0</version> <packaging>jar</packaging> <name>My MCP Server</name> <description>Model Context Protocol server implementation</description> <properties> <java.version>17</java.version> <maven.compiler.source>17</maven.compiler.source> <maven.compiler.target>17</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <mcp.version>0.14.1</mcp.version> <slf4j.version>2.0.9</slf4j.version> <logback.version>1.4.11</logback.version> <junit.version>5.10.0</junit.version> </properties> <dependencies> <!-- MCP Java SDK --> <dependency> <groupId>io.modelcontextprotocol.sdk</groupId> <artifactId>mcp</artifactId> <version>${mcp.version}</version> </dependency> <!-- Logging --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>${logback.version}</version> </dependency> <!-- Testing --> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> <version>${junit.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>io.projectreactor</groupId> <artifactId>reactor-test</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.11.0</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.1.2</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId>