Skip to content

Commit 4b90ed6

Browse files
committed
docs alignment
1 parent 8610adf commit 4b90ed6

9 files changed

Lines changed: 53 additions & 41 deletions

File tree

ai-plugin/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The plugin assumes downstream **users of Cayenne** writing their own Java apps.
3131

3232
## Install
3333

34-
**Cayenne 5.0+ only.** The MCP server ships with Cayenne 5.0. Skills that depend on it (`cayenne-cgen`, `cayenne-modeler`, `cayenne-reverse-engineer`) will not work against earlier Cayenne versions. The XML-editing, runtime, and query skills also target 5.0 idioms — for older Cayenne, this plugin is not the right tool.
34+
**Cayenne 5.0+ only.** The MCP server ships with Cayenne 5.0. Skills that depend on it (`cayenne-cgen`, `cayenne-modeler`, `cayenne-db-import`) will not work against earlier Cayenne versions. The XML-editing, runtime, and query skills also target 5.0 idioms — for older Cayenne, this plugin is not the right tool.
3535

3636
The plugin is distributed from the Apache Cayenne GitHub repository: **https://github.com/apache/cayenne**. Inside Claude Code:
3737

@@ -58,7 +58,7 @@ ai-plugin/
5858
├── README.md # this file
5959
├── skills/ # auto-triggering workflows
6060
│ ├── cayenne-modeling/ # edit *.map.xml and cayenne-*.xml
61-
│ ├── cayenne-reverse-engineer/# import a DB schema (Modeler GUI)
61+
│ ├── cayenne-db-import/ # import a DB schema (Modeler GUI)
6262
│ ├── cayenne-cgen/ # regenerate Java classes via MCP
6363
│ ├── cayenne-modeler/ # open the GUI on a project
6464
│ ├── cayenne-runtime/ # bootstrap CayenneRuntime in an app

ai-plugin/references/mcp-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
The Cayenne MCP server (`cayenne-mcp-server` module) exposes Cayenne operations to AI agents over stdio.
2222

23-
**Availability: Cayenne 5.0+ only.** The MCP server is a new component shipped alongside CayenneModeler starting with the 5.0 release. There is no MCP server for Cayenne 4.x or earlier — skills that depend on these tools (`cayenne-cgen`, `cayenne-modeler`, `cayenne-reverse-engineer`) cannot be used against pre-5.0 projects.
23+
**Availability: Cayenne 5.0+ only.** The MCP server is a new component shipped alongside CayenneModeler starting with the 5.0 release. There is no MCP server for Cayenne 4.x or earlier — skills that depend on these tools (`cayenne-cgen`, `cayenne-modeler`, `cayenne-db-import`) cannot be used against pre-5.0 projects.
2424

2525
Setup is documented in `cayenne-mcp-server/README.md` at the repo root. Quick form for Claude Code:
2626

ai-plugin/skills/cayenne-reverse-engineer/SKILL.md renamed to ai-plugin/skills/cayenne-db-import/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: cayenne-reverse-engineer
2+
name: cayenne-db-import
33
description: "Use this skill whenever the user wants to import database schema metadata into a Cayenne DataMap — full-schema sync from a live DB. Trigger on phrases like 'reverse engineer the database', 'import the schema', 'generate a DataMap from my DB', 'sync the model with the database', 'add the new tables from the DB', 'import the customer table', 'pick up the latest schema changes', 'create entities from these tables', or any request that involves reading database metadata to populate or update a DataMap. This is for *full schema* or *bulk table* import; one-off a-la-carte entity additions belong in the cayenne-modeling skill. The skill runs reverse engineering directly via the `mcp__cayenne__dbimport_run` MCP tool when a DBConnector is already configured; otherwise it opens the CayenneModeler GUI via `mcp__cayenne__open_project` to configure the connection first."
44
---
55

@@ -21,7 +21,7 @@ description: "Use this skill whenever the user wants to import database schema m
2121
specific language governing permissions and limitations
2222
under the License.
2323
-->
24-
# cayenne-reverse-engineer
24+
# cayenne-db-import
2525

2626
Import a database schema into a Cayenne DataMap using the `mcp__cayenne__dbimport_run` MCP tool. If a DBConnector is already stored in preferences for the DataMap the import runs directly without any GUI interaction. When the connection has not been configured yet, the workflow launches CayenneModeler and walks the user through the dialog once to save the connection, then re-runs `dbimport_run`.
2727

ai-plugin/skills/cayenne-modeler/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: cayenne-modeler
3-
description: "Use this skill when the user explicitly wants to open CayenneModeler (the GUI) on a Cayenne project, or when the modeling task is inherently visual — reverse engineering (delegated to cayenne-reverse-engineer), bulk relationship layout, multi-entity visual refactoring. Trigger on phrases like 'open the Modeler', 'open in CayenneModeler', 'launch the GUI', 'edit visually', 'show me the project in the Modeler'. Do NOT trigger as a fallback for ordinary a-la-carte XML edits — those belong in the cayenne-modeling skill, which is faster and doesn't require the user to context-switch."
3+
description: "Use this skill when the user explicitly wants to open CayenneModeler (the GUI) on a Cayenne project, or when the modeling task is inherently visual — reverse engineering (delegated to cayenne-db-import), bulk relationship layout, multi-entity visual refactoring. Trigger on phrases like 'open the Modeler', 'open in CayenneModeler', 'launch the GUI', 'edit visually', 'show me the project in the Modeler'. Do NOT trigger as a fallback for ordinary a-la-carte XML edits — those belong in the cayenne-modeling skill, which is faster and doesn't require the user to context-switch."
44
---
55

66
<!--
@@ -63,7 +63,7 @@ The tool spawns the Modeler asynchronously, then waits up to ~15 seconds for a s
6363

6464
Once `open_project` returns `ok`, the user is in the GUI. From here, depending on intent:
6565

66-
- **Reverse engineering**: that's the `cayenne-reverse-engineer` skill's job to walk them through. Do not duplicate that workflow here — just open and step out.
66+
- **Reverse engineering**: that's the `cayenne-db-import` skill's job to walk them through. Do not duplicate that workflow here — just open and step out.
6767
- **Visual layout / bulk editing**: tell the user what tab to navigate to (e.g., DataMap → ObjEntity for entity-level edits, DataMap → Class Generation for cgen config) and let them work. Don't try to script GUI actions.
6868
- **Just wanted to see the project**: nothing more to do.
6969

ai-plugin/skills/cayenne-modeling/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ If anything fails, fix it before reporting done.
8181

8282
- **If you modified entities and the DataMap has a `<cgen>` block:** suggest invoking the `cayenne-cgen` skill to regenerate Java classes. Mention which entities are affected.
8383
- **If the user added a new entity and there's no Java class yet:** same — recommend `cayenne-cgen`.
84-
- **If the user is asking about a full DB sync** (importing many tables, syncing with a changed schema): hand off to `cayenne-reverse-engineer`. Do not try to script this via XML edits.
84+
- **If the user is asking about a full DB sync** (importing many tables, syncing with a changed schema): hand off to `cayenne-db-import`. Do not try to script this via XML edits.
8585
- **If the change is structurally messy** (bulk renaming relationships, visual graph rework): suggest the `cayenne-modeler` skill. Otherwise do not.
8686

8787
## Modeler coexistence

docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part3.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616

1717
include::part3/overview.adoc[]
1818

19-
include::part3/installingMcpServer.adoc[]
19+
include::part3/installing.adoc[]
2020

2121
include::part3/mcpTools.adoc[]

docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part3/installingMcpServer.adoc renamed to docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part3/installing.adoc

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,61 +12,64 @@
1212
// the specific language governing permissions and limitations under the
1313
// License.
1414

15-
=== Installing the Cayenne MCP Server
1615

17-
The MCP server is a self-contained, stdio-based process that the AI client launches on demand. It is bundled with the
18-
platform-specific CayenneModeler and requires Java 21 or later on the system `PATH`.
16+
=== Installing `apache-cayenne` Plugin (Claude Code)
17+
18+
Install the `apache-cayenne` plugin with Cayenne-specific skills under Claude Code:
19+
20+
[source,bash]
21+
----
22+
/plugin marketplace add apache/cayenne
23+
/plugin install apache-cayenne@apache-cayenne
24+
/reload-plugins
25+
----
26+
27+
The plugin adds skills for DataMap editing, class generation, reverse engineering, query writing, and runtime setup.
28+
The skills work best with the MCP server present (see the next chapter).
1929

20-
==== Finding the JAR
30+
=== Installing the Cayenne MCP Server
2131

22-
As mentioned above, the MCP server jar is a part if the CayenneModeler download (available at
23-
https://cayenne.apache.org/download/). Its location depends on the install format:
32+
The MCP server is a self-contained, stdio-based process that the AI agent launches on demand. It works with most agents
33+
(not only Claude). The MCP server is bundled with the platform-specific CayenneModeler and requires Java 21 or
34+
later on the system `PATH`. So to get it, first download the Modeler at https://cayenne.apache.org/download/ .
2435

25-
===== macOS
36+
MCP runnable jar is `CayenneMCPServer.jar`. Its location is OS-dependent (you will need this location in the next step):
2637

38+
Mac:
2739
[source]
2840
----
2941
# <install-dir> is typically "/Applications", but it can be any other directory
3042
<install-dir>/CayenneModeler.app/Contents/Resources/mcp/CayenneMCPServer.jar
3143
----
3244

33-
===== Windows
34-
45+
Windows:
3546
[source]
3647
----
3748
<install-dir>\bin\CayenneMCPServer.jar
3849
----
3950

40-
===== Linux / cross-platform
41-
51+
Linux / cross-platform:
4252
[source]
4353
----
4454
<install-dir>/bin/CayenneMCPServer.jar
4555
----
4656

47-
==== Configuring AI clients
48-
49-
The server communicates over stdio and is launched on demand by the client. In the snippets below, replace
50-
`/path/to/CayenneMCPServer.jar` with the actual jar path from the previous section.
51-
52-
===== Claude Code
57+
When installaing the MCP, replace `/path/to/CayenneMCPServer.jar` mentioned in the instructions with the actual jar path:
5358

54-
By default `claude mcp add` registers the server for the current project only. Use `--scope user` to make it available
55-
across all projects for your OS user:
59+
==== Claude Code
5660

5761
[source,bash]
5862
----
59-
# Current project only
60-
claude mcp add cayenne -- java -jar /path/to/CayenneMCPServer.jar
61-
62-
# All projects for the current user
63+
# Register the MCP server (--scope user makes it available across all projects)
6364
claude mcp add cayenne --scope user -- java -jar /path/to/CayenneMCPServer.jar
65+
66+
# Verify it is connected
67+
claude mcp list
6468
----
6569

66-
===== Cursor
70+
==== Cursor
6771

6872
Edit `~/.cursor/mcp.json` (global, all projects) or `.cursor/mcp.json` in your project (per-project):
69-
7073
[source,json]
7174
----
7275
{
@@ -79,8 +82,7 @@ Edit `~/.cursor/mcp.json` (global, all projects) or `.cursor/mcp.json` in your p
7982
}
8083
----
8184

82-
===== Codex
83-
85+
==== Codex
8486
Add a `[mcp_servers.cayenne]` entry to `~/.codex/config.toml`:
8587

8688
[source,toml]

docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part3/mcpTools.adoc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414

1515
=== MCP Tools
1616

17-
The server exposes three tools. Your agent will discover them on its own, but it is useful to understand the capabilities and possible prompts. All tools operate on a Cayenne project descriptor (a `cayenne-*.xml` file) and take absolute paths - agents should resolve relative paths against the current workspace before invoking.
17+
The server exposes three tools. Your agent will discover them on its own, but it is useful to understand the
18+
capabilities and possible prompts. All tools operate on a Cayenne project descriptor (a `cayenne-*.xml` file) and take
19+
absolute paths — agents should resolve relative paths against the current workspace before invoking.
20+
21+
If you are using the `apache-cayenne` Claude Code plugin, its skills (`cayenne-cgen`, `cayenne-modeler`, `cayenne-db-import`)
22+
call these tools automatically. You can verify the server is available with `claude mcp list` — look for an entry named `cayenne`.
1823

1924
==== open_project
2025

@@ -70,12 +75,12 @@ ____
7075
==== dbimport_run
7176

7277
Runs Cayenne reverse engineering (dbimport) for a single DataMap inside the project.
73-
The tool reads the JDBC connection from the DBConnector that CayenneModeler stored in preferences when the user last ran the reverse-engineering dialog for this DataMap.
78+
The tool reads the JDBC connection from CayenneModeler preferences on the local machine (the agent doesn't see the credentials).
7479
If the DataMap has a `<reverse-engineering>` block its filters are applied; otherwise the full database schema is imported.
7580
The DataMap XML is rewritten on disk with the merged schema, and a JSON summary of what changed is returned.
7681

77-
JDBC credentials are not passed as arguments — they come from CayenneModeler preferences.
78-
If no connection has been saved yet (`dbconnector_not_configured` error), open the project in the Modeler with `open_project`, run the dialog once to save the connection, then call `dbimport_run` again.
82+
If no connection has been saved yet (`dbconnector_not_configured` error), open the project in the Modeler with
83+
`open_project`, run the dialog once to save the connection, then call `dbimport_run` again.
7984

8085
.Parameters
8186
[cols="1,1,3", options="header"]

docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part3/overview.adoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@
1616

1717
AI coding agents such as Claude Code, Cursor, etc. can read and write Cayenne projects like any other Java codebase. For day-to-day API work — writing queries, manipulating an `ObjectContext`, etc. — you don't need anything Cayenne-specific. Prompt the agent the way you would for any other project.
1818

19-
The Cayenne MCP (Model Context Protocol) server is what makes the agent _Cayenne-aware_ beyond plain source editing. It is a small stdio-based process that the AI client launches on demand and exposes a focused set of tools for operating on a Cayenne project descriptor. This chapter walks you through installing the server and explains the available tools.
19+
Two additional elements make the agent _Cayenne-aware_ beyond plain source editing:
20+
21+
* MCP server — a small stdio-based process the agent launches on demand, exposing tools for class generation, DB import, and opening CayenneModeler. Works with any MCP-compatible client (Claude Code, Cursor, Codex, etc.).
22+
* `apache-cayenne` Claude Code plugin — a Claude Code-specific extension that bundles pre-built skills for DataMap editing, query writing, runtime setup, and more. The skills detect the MCP server at runtime;
23+
24+
Both elements are independent but work best together. This chapter walks you through installing both and explains the available MCP tools.

0 commit comments

Comments
 (0)