Feature/java kotlin - #3
Merged
Merged
Conversation
- cover protoc-compatible default outer class naming - assert default wrapper refs stop appending OuterClass unnecessarily
- resolve default JVM outer classes from descriptor-aware proto file names - refresh Kotlin and Java example goldens to use protoc-compatible wrappers
- assert public server client connection usage in generated Kotlin - require networknt validation and escaped schema dollar keys
- use public server client connection lookup in low-level Kotlin handlers - add networknt raw JSON Schema validation and escape dollar keys in schema constants
- add isolated examples/jvm workspace that builds the local protoc-gen-mcp binary - compile generated Java and Kotlin sidecars with Maven protoc and official SDK artifacts
There was a problem hiding this comment.
Pull request overview
Adds first-class JVM (Java/Kotlin) generation support to protoc-gen-mcp, expands docs/examples/CI to cover JVM workflows, and extends the Python runtime to project tool execution metadata (task support), while making Python-invoking Go tests use a hermetic venv.
Changes:
- Add
lang=javaandlang=kotlingenerator modes (new JVM semantic model + Kotlin renderer; Java contracts/tests; generator dispatch + option parsing updates). - Add JVM runnable examples (Gradle workspace + standalone Java/Kotlin projects) and CI compile/install + stdio parity gates.
- Extend generated Python MCP bindings to include
ToolExecution(execution.task_support) and introduce hermetic Python runtime setup for Go tests (internal/pythontest).
Reviewed changes
Copilot reviewed 66 out of 70 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/golden/example_mcp.py.golden | Updates golden snapshot to include execution projection in generated Python. |
| mcp/options/v1/options_mcp.py | Adds execution field plumbed into tool registration for options runtime. |
| internal/testproto/example/v1/example_mcp.py | Updates generated test proto Python bindings to include execution. |
| internal/pythontest/env.go | New hermetic Python venv bootstrap used by Go tests that execute Python. |
| internal/examplemcp/stdio_test.go | Switches Python stdio tests to use the hermetic Python runtime helper. |
| internal/examplemcp/jvm_stdio_test.go | New stdio parity tests for installed Java/Kotlin example servers. |
| internal/codegen/request_test.go | Adds request-prep tests for JVM synthetic go_package behavior. |
| internal/codegen/request.go | Generalizes synthetic go_package synthesis for non-Go (Python + JVM). |
| internal/codegen/render_python_runtime.go | Emits Python runtime support for execution / ToolExecution. |
| internal/codegen/render_python.go | Projects method task_support into generated Python tool registration. |
| internal/codegen/render_kotlin.go | New Kotlin sidecar renderer and embedded runtime for Kotlin SDK server. |
| internal/codegen/python_mapper_test.go | Uses hermetic Python runtime for mapper tests executing Python. |
| internal/codegen/python_contract_test.go | Adds contract coverage for Python execution.taskSupport projection. |
| internal/codegen/options_test.go | Adds `lang=java |
| internal/codegen/options.go | Adds LanguageJava/LanguageKotlin and option validation updates. |
| internal/codegen/model.go | Extends shared method model to preserve TaskSupport. |
| internal/codegen/kotlin_contract_test.go | Contract tests locking Kotlin output shape and key runtime behavior. |
| internal/codegen/jvm_package_resolver_test.go | Tests JVM package/type reference resolution (java_package, outer class, etc.). |
| internal/codegen/jvm_package_resolver.go | Resolves JVM package metadata and type refs for renderers. |
| internal/codegen/jvm_names_test.go | Tests JVM naming helpers (methods, handlers, schema consts, collision checks). |
| internal/codegen/jvm_names.go | Implements JVM naming and collision detection helpers. |
| internal/codegen/jvm_model_test.go | Tests JVM IR constraints and semantic preservation (annotations/icons/task support/type graph). |
| internal/codegen/jvm_model.go | Defines the JVM structural IR (services/methods/types/fields/oneofs). |
| internal/codegen/jvm_collect.go | Collects JVM IR from protogen descriptors + shared model. |
| internal/codegen/java_contract_test.go | Contract tests for Java sidecar API shape and runtime seam expectations. |
| internal/codegen/generator.go | Adds generator dispatch for Kotlin/Java and updates Python support file emission. |
| internal/codegen/collect.go | Preserves TaskSupport in the shared model collection. |
| go.mod | Bumps Go dependencies for jsonschema-go and go-sdk. |
| go.sum | Updates checksums for bumped dependencies. |
| examples/python_stdio_test.go | Uses hermetic Python runtime helper for stdio tests under examples. |
| examples/jvm/settings.gradle.kts | New JVM workspace settings for Gradle-based examples. |
| examples/jvm/kotlin-server/src/main/kotlin/internal/examplemcp/kotlin/ExampleKotlinServer.kt | Adds Kotlin stdio example server using generated bindings. |
| examples/jvm/kotlin-server/build.gradle.kts | Kotlin JVM example build (protoc + generated MCP sidecar + SDK deps). |
| examples/jvm/java-server/src/main/java/internal/examplemcp/java/ExampleJavaServer.java | Adds Java stdio example server using generated bindings. |
| examples/jvm/java-server/build.gradle.kts | Java JVM example build (protoc + generated MCP sidecar + SDK deps). |
| examples/jvm/build.gradle.kts | Root JVM workspace task to build local protoc-gen-mcp for subprojects. |
| examples/jvm/README.md | JVM workspace walkthrough and the tested compile/install/run flow. |
| examples/README.md | Extends examples docs to include Java/Kotlin standalone + JVM workspace. |
| examples/Makefile | Updates generation/lint flows to include JVM standalone examples and clean build artifacts. |
| examples/7_kotlin_standalone/src/main/kotlin/com/example/todo/kotlin/TodoKotlinServer.kt | Adds standalone Kotlin user-style MCP server example. |
| examples/7_kotlin_standalone/settings.gradle.kts | Adds standalone Kotlin Gradle settings. |
| examples/7_kotlin_standalone/proto/todo.proto | Adds Kotlin standalone example proto (java_package + MCP options). |
| examples/7_kotlin_standalone/easyp.yaml | Adds Easyp config for Kotlin standalone generation (java + kotlin + mcp sidecar). |
| examples/7_kotlin_standalone/easyp.lock | Pins protoc-gen-mcp dependency for Kotlin standalone example. |
| examples/7_kotlin_standalone/build.gradle.kts | Adds Kotlin standalone Gradle build (easyp-driven generation). |
| examples/7_kotlin_standalone/README.md | Documents Kotlin standalone example layout and workflow. |
| examples/7_kotlin_standalone/Makefile | Adds generate/lint/build/run targets for Kotlin standalone example. |
| examples/7_kotlin_standalone/.gitignore | Ignores Gradle + generated outputs for Kotlin standalone example. |
| examples/6_java_standalone/src/main/java/com/example/todo/java/TodoJavaServer.java | Adds standalone Java user-style MCP server example. |
| examples/6_java_standalone/settings.gradle.kts | Adds standalone Java Gradle settings. |
| examples/6_java_standalone/proto/todo.proto | Adds Java standalone example proto (java_package + MCP options). |
| examples/6_java_standalone/easyp.yaml | Adds Easyp config for Java standalone generation (java + mcp sidecar). |
| examples/6_java_standalone/easyp.lock | Pins protoc-gen-mcp dependency for Java standalone example. |
| examples/6_java_standalone/build.gradle.kts | Adds Java standalone Gradle build (easyp-driven generation). |
| examples/6_java_standalone/README.md | Documents Java standalone example layout and workflow. |
| examples/6_java_standalone/Makefile | Adds generate/lint/build/run targets for Java standalone example. |
| examples/6_java_standalone/.gitignore | Ignores Gradle + generated outputs for Java standalone example. |
| examples/5_python_standalone/proto/notebook_mcp.py | Updates generated Python example to include execution. |
| examples/4_crm_system/proto/crm_mcp.py | Updates generated Python example to include execution. |
| examples/3_file_manager/proto/filemanager_mcp.py | Updates generated Python example to include execution. |
| examples/2_weather_api/proto/weather_mcp.py | Updates generated Python example to include execution. |
| examples/1_helloworld/proto/helloworld_mcp.py | Updates generated Python example to include execution. |
| README.md | Updates top-level docs to include JVM support, workflows, and inspector usage. |
| AGENTS.md | Updates repo architecture/verification docs for JVM + hermetic Python runtime. |
| .gitignore | Ignores Gradle build outputs for new JVM examples/standalone projects. |
| .github/workflows/tests.yml | Adds JDK/Gradle setup and JVM compile/install + stdio test steps to CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 67 out of 71 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- accept lang=typescript in protoc-gen-mcp options - synthesize protogen go_package metadata for TypeScript-only protos
- dispatch lang=typescript through shared FileModel collection - emit deterministic TypeScript schema JSON constants - add TypeScript golden and fail-fast coverage
- Build Protobuf-ES registries with dependency descriptors for Any WKT payloads - Require successful structuredContent to be a JSON object before output validation - Align advanced runtime assertions with canonical ProtoJSON output
- Lock structuredContent object validation snippets - Refresh TypeScript golden output for dependency-aware Protobuf-ES registries - Keep high-level SDK and Zod omissions enforced
- Add hermetic protobuf-mode Python runtime harness - Cover public low-level server registration with namespace normalization - Assert raw pb2 dispatch and text/structured output parity
- Assert schema-invalid payloads fail before raw handlers run - Assert schema-valid ProtoJSON-invalid payloads fail in ParseDict - Check protobuf mode reports INVALID_PARAMS through the shared runtime
- Cover invalid enum output through protobuf-mode validation - Cover non-message handler output through marshal wrapping - Keep failure assertions on the shared mcpruntime prefixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.