java-mcp-server-generator
Generate a complete Model Context Protocol server project in Java using the official MCP Java SDK with reactive streams and optional Spring Boot integration.
npx skills add github/awesome-copilot --skill java-mcp-server-generator --agent copilot
Same command for any agent — swap --agent for claude-code, codex, cursor.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Generates a full MCP server project structure for Java, including main application, configuration, tool and resource handlers, prompts, tests, and build files. It creates a McpServerApplication with server setup, registers ToolHandlers, ResourceHandlers, and PromptHandlers, and provides templates for ToolDefinitions, ToolHandlers, ResourceDefinitions, ResourceHandlers, and McpServer components. It supports both Maven and Gradle builds and includes example tool and resource definitions, along with sample server transport via StdioServerTransport.
How it works
- Produces a project skeleton named my-mcp-server/ with either pom.xml or build.gradle.kts, source directories, and a test directory.
- Provides Maven pom.xml template including MCP SDK dependency, logging, and testing configuration, plus a Maven Shade Plugin setup to define the main class.
- Provides Gradle build script with MCP SDK, logging, testing dependencies, and an application mainClass.
- Generates McpServerApplication.java that builds the server via McpServerBuilder, enables tools/resources/prompts, registers handlers, and starts a StdioServerTransport.
- Includes ToolDefinitions and ToolHandlers to expose tools like greet and calculate with basic validation and responses.
- Includes ResourceDefinitions and ResourceHandlers for listing, reading, subscribing/unsubscribing resources with simple in-memory state.
- Includes PromptDefinitions (truncated in excerpt) to define prompts to be wired into the server.
- Uses the provided templates to wire components together and run the MCP server in a self-contained project.
# 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</gr
- Project Generation
- Maven pom.xml Template
- Gradle build.gradle.kts Template
- McpServerApplication.java Template
- ToolDefinitions.java Template
- ToolHandlers.java Template
- ResourceDefinitions.java Template
- ResourceHandlers.java Template
- PromptDefinitions.java Template
- PromptHandlers.java Template
- McpServerTest.java Template
- README.md Template
- Generation Instructions
What does the java-mcp-server-generator skill do?
Generate a complete Model Context Protocol server project in Java using the official MCP Java SDK with reactive streams and optional Spring Boot integration.
How do I install it?
Run `npx skills add github/awesome-copilot --skill java-mcp-server-generator --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From github/awesome-copilot, a repository with 37,432 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.