Index of every page on this site: llms.txt
All skills
github avatar

/java-mcp-server-generator

@f10fdb8 official
by githubgithub/awesome-copilot41k stars
5,399
Run it yourself

Use this skill when the user wants to create a Model Context Protocol (MCP) server in Java or in a Spring Boot app. Also use it when the user wants AI agents, such as GitHub Copilot or Claude, to use Java code, an API, or a database. Use it even if the user does not say "MCP". The skill makes a Maven or Gradle project with the MCP Java SDK 2.x, tools, JUnit tests, and client configuration. Do not use it for Quarkus/Quarkiverse MCP servers (use the `quarkus-mcp-server-sse` instruction), for an MCP client or for a server in another language.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/java-mcp-server-generator

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesgradle.md

≈584 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Gradle Projects

Use this file only when the project uses Gradle or the user asks for Gradle. The Java code and the tests do not change.

Create the project

Make this layout. Do not write pom.xml:

project-name/
├── settings.gradle.kts
├── build.gradle.kts
└── src/
    ├── main/java/com/example/McpServerApp.java
    └── test/java/com/example/McpServerAppTest.java

Write settings.gradle.kts:

rootProject.name = "mcp-server-demo"

Write build.gradle.kts:

plugins {
    application
}

group = "com.example"
version = "0.1.0"

repositories {
    mavenCentral()
}

dependencies {
    implementation(platform("io.modelcontextprotocol.sdk:mcp-bom:2.0.1"))
    implementation("io.modelcontextprotocol.sdk:mcp")
    runtimeOnly("org.slf4j:slf4j-simple:2.0.17")

    testImplementation(platform("org.junit:junit-bom:6.1.3"))
    testImplementation("org.junit.jupiter:junit-jupiter")
    testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

tasks.withType<JavaCompile> {
    options.release = 17
}

application {
    mainClass = "com.example.McpServerApp"
}

tasks.test {
    useJUnitPlatform()
}

Build until the tests pass

  1. If the project has no gradlew file, run gradle wrapper one time.
  2. Run ./gradlew build installDist. This command compiles the code and runs the tests. It also makes the start script build/install/mcp-server-demo/bin/mcp-server-demo.
  3. If a test fails, read the error. Fix the server or the test.
  4. Run ./gradlew build installDist again.
  5. Continue only when the build is successful.

Configure the client

For VS Code, write .vscode/mcp.json:

{
  "servers": {
    "demo": {
      "type": "stdio",
      "command": "/absolute/path/to/project/build/install/mcp-server-demo/bin/mcp-server-demo"
    }
  }
}

On Windows, use mcp-server-demo.bat.

Gotchas

  • Gradle 9 does not add the JUnit Platform launcher. Without junit-platform-launcher, the test task fails.
  • The application plugin does not make an executable JAR. The JAR in build/libs has no Main-Class and no dependencies. Use the start script from installDist.
  • Do not use ./gradlew run as the client command. The run task does not send stdin to the server. Gradle also writes its own output to stdout.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning28d5 checks · Risk SAFE
  • Gen Agent Trust Hub28d

    This skill provides templates and instructions for generating Model Context Protocol (MCP) servers in Java using Maven or Gradle. It follows standard software development practices, uses official SDK libraries, and includes security-focused guidance for implementing HTTP transports with Host and Origin validation to prevent DNS rebinding attacks.

  • Socket28d

    No alerts

  • Snyk28d

    Risk: LOW · No issues

  • Runlayer8mo

    1/1 file flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at f10fdb8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
Other metadata
compatibility
JDK 17 or later, Maven 3.9 or later or Gradle 9 or later, and network access to download dependencies. The MCP Inspector also uses Node.js.
  • MCP
  • java
  • model-context-protocol
  • sdk
  • maven
  • gradle
  • reactive
  • spring-boot

README badge

README badge for github/awesome-copilot/java-mcp-server-generator

Generates a complete Model Context Protocol server project in Java using the official MCP Java SDK with Maven or Gradle build configuration. Includes templates for tool, resource, and prompt handlers with reactive streams support via Project Reactor.

Generated from the current SKILL.md.

Does this skill support both Maven and Gradle?
Yes. The skill provides complete templates for both Maven (pom.xml) and Gradle (build.gradle.kts) project setups.
What Java version is required?
Java 17 or later. Both the Maven and Gradle templates target Java 17 as the minimum version.
Does this use the official MCP Java SDK?
Yes. The skill generates projects using the official Model Context Protocol Java SDK (io.modelcontextprotocol.sdk:mcp).
Can I use Spring Boot with this skill?
The skill mentions optional Spring Boot integration but does not provide Spring Boot-specific templates or configuration in the SKILL.md content shown.
What capabilities does the generated server support?
The generated server supports tools, resources, and prompts as core MCP capabilities, with handlers for each included in the templates.

Generated from the current SKILL.md. These answers refresh after source changes.