Skip to content

Feature/java kotlin - #3

Merged
Yakwilik merged 74 commits into
masterfrom
feature/java-kotlin
May 14, 2026
Merged

Feature/java kotlin#3
Yakwilik merged 74 commits into
masterfrom
feature/java-kotlin

Conversation

@Yakwilik

@Yakwilik Yakwilik commented May 1, 2026

Copy link
Copy Markdown
Member

No description provided.

Yakwilik added 21 commits April 14, 2026 23:55
- 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
Copilot AI review requested due to automatic review settings May 1, 2026 20:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=java and lang=kotlin generator 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.

Comment thread internal/examplemcp/jvm_stdio_test.go
Comment thread internal/pythontest/env.go
Comment thread internal/codegen/render_kotlin.go
Comment thread examples/6_java_standalone/settings.gradle.kts
Comment thread examples/7_kotlin_standalone/settings.gradle.kts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Yakwilik added 2 commits May 3, 2026 23:36
- 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
Yakwilik added 29 commits May 6, 2026 17:23
- 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
@Yakwilik
Yakwilik merged commit 44991eb into master May 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants