This example is structured like a user-owned Java project. It has its own
easyp.yaml, Gradle build, protobuf contract, generated source directory, and
stdio MCP server.
make generateeasyp.yaml does two jobs:
- resolves
mcp/options/v1/options.protothroughdeps - runs Java protobuf generation plus
protoc-gen-mcpwithlang=java
The proto is Java-native and intentionally does not declare go_package.
protoc-gen-mcp synthesizes the internal metadata that protogen needs for
lang=java.
with_imports: true is used so the local mcp.options.v1 Java extension
class is generated from the Easyp dependency. The build removes generated
com.google.protobuf sources afterward and uses the protobuf Java jar for
Google runtime classes.
The local repository version uses:
command: ["go", "run", "../../cmd/protoc-gen-mcp"]In an external project, replace it with the released plugin binary or module entrypoint you want to pin.
make build
make runThe server registers generated tools through:
TodoMcp.registerTodoAPITools(transportProvider, new Handler(), "todo");The generated source lives under src/generated/main/java after generation.
The handwritten server lives under src/main/java and implements the generated
TodoMcp.TodoAPIToolHandler interface.