Andrus Adamchik created CAY-2936:
------------------------------------

             Summary: Add a placeholder MCP server to the Modeler distribution
                 Key: CAY-2936
                 URL: https://issues.apache.org/jira/browse/CAY-2936
             Project: Cayenne
          Issue Type: Task
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik


h2. Summary

Add a new {{cayenne-mcp-server}} Maven module that builds an executable jar 
implementing a minimal Model Context Protocol server. The jar ships inside 
every Modeler distribution. When a coding agent launches it, the server speaks 
MCP over stdio and exposes a single {{hello}} tool that returns {{"hello 
world"}}.

h2. Background

The Modeler distribution (cross-platform jar bundle, plus macOS and Windows app 
bundles) is the artifact users already install to work with Cayenne projects. 
To enable agent-driven workflows, we want an MCP server packaged inside that 
same distribution — no extra downloads, no separate install. This ticket lands 
the scaffolding and a placeholder tool, proving the end-to-end wiring from 
agent to MCP jar to a registered tool handler.

h2. Goals

* A new {{cayenne-mcp-server}} module that produces a single self-contained 
executable jar.
* The jar is included in all three Modeler distribution archives at a known 
relative path.
* The server speaks MCP over stdio and registers a {{hello}} tool that returns 
{{"hello world"}} when invoked.

h2. Architecture

{{cayenne-mcp-server}} depends on the official MCP Java SDK. Its {{main}} 
method configures stderr logging, builds an MCP server with the {{hello}} tool 
registered, and hands off to the SDK's stdio loop. The module is shaded into a 
single executable jar by {{maven-shade-plugin}}. The existing {{assembly}} 
module is updated to drop that jar into {{lib/mcp/}} of each Modeler 
distribution. Agents launch it with {{java -jar}}.

h2. Launch contract

The agent's MCP server config invokes:

{code}
java -jar <modeler-install>/lib/mcp/cayenne-mcp-server.jar
{code}

The placeholder takes no options other than {{-h}}/{{--help}} and 
{{-V}}/{{--version}}.

h2. Logging

Stdout is reserved for the MCP transport. All logs go to stderr. Capturing or 
surfacing stderr is the MCP host's responsibility. Logback is configured 
programmatically at boot with stdout appenders disabled.

h2. Dependencies

The MCP Java SDK ({{io.modelcontextprotocol.sdk:mcp}}), SLF4J + Logback, and 
Jackson (transitively via the SDK). Tests use JUnit 5 (already managed by the 
existing {{junit-bom}}).

h2. Prerequisites

Cayenne must be on Java 21 before this work starts — the MCP SDK requires Java 
17+, and the JDK upgrade is being planned independently.

h2. Acceptance criteria

* {{mvn clean verify}} from the repo root builds the new module and includes 
its shaded jar in each of the three Modeler distribution archives at 
{{lib/mcp/cayenne-mcp-server.jar}}.
* Launching the jar with {{java -jar}} starts an MCP server on stdio that 
successfully completes {{initialize}}, lists exactly one tool ({{hello}}) under 
{{tools/list}}, and returns {{"hello world"}} when that tool is called.
* Nothing the server writes lands on stdout.
* License/notice headers and Apache RAT pass on all new files.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to