DEV Community

Anthony Viard
Anthony Viard

Posted on

Pairing up: scaffolding OtakuShelf with an agent

Sam has shipped a dozen JHipster apps the old-fashioned way: open an editor, write the JDL, run the CLI, answer its questions, repeat. This time Sam wants to try something different — keep the JHipster expertise, but hand the typing to an AI agent. The guinea pig is a personal project that's been on the back burner forever: OtakuShelf, an app to catalog manga and anime, grouped by franchise. Naruto is one franchise — it has a manga side and an anime side, and Sam wants both under one roof.

The agent needs hands

An AI agent is great at turning "a franchise has many book series" into correct JDL. What it can't do on its own is run your jhipster binary. That's the gap the JHipster MCP fills: it's a small server that exposes JHipster to the agent as a set of safe actions. Three flavors, and that's the whole mental model:

  • tools — things the agent does (scaffold, add an entity, validate);
  • resources — things the agent reads (the JDL grammar, your project's current entities);
  • prompts — ready-made recipes you launch.

Crucially, it doesn't bundle JHipster — it drives the same global jhipster Sam already has (version 9.0.0 here). So nothing about the generator changes; the agent just operates it, non-interactively.

Wiring it into Sam's editor is one line:

claude mcp add jhipster -- npx -y jhipster-mcp
Enter fullscreen mode Exit fullscreen mode

Restart, confirm the tools show up, done. (Other hosts and options live in the install guide.)

One sentence, one monolith

Sam decides to start with just the manga side — get the shape right before piling on anime. So:

Create a JHipster monolith in /Users/sam/projects/otakushelf called otakushelf: JWT auth, PostgreSQL in prod with H2 in dev, Vue, Maven, package com.otakushelf. Add a Franchise (title, synopsis, a status that's ONGOING/COMPLETED/HIATUS, start year), a BookSeries (title, total volumes), and a Book (title, volume number, release date). A franchise has many book series; a book series has many books. Paginate everything.

The agent first glances at the jhipster://docs/jdl-grammar resource so it doesn't fumble syntax, then builds one JDL document and calls the create_app_from_jdl tool with roughly:

application {
  config {
    baseName otakushelf
    applicationType monolith
    authenticationType jwt
    databaseType sql
    prodDatabaseType postgresql
    devDatabaseType h2Disk
    clientFramework vue
    buildTool maven
    packageName com.otakushelf
  }
  entities *
}

enum FranchiseStatus { ONGOING, COMPLETED, HIATUS }

entity Franchise { title String required, synopsis TextBlob, status FranchiseStatus, startYear Integer }
entity BookSeries { title String required, totalVolumes Integer min(0) }
entity Book { title String, volumeNumber Integer required min(1), releaseDate LocalDate }

relationship OneToMany {
  Franchise{bookSeries} to BookSeries{franchise}
  BookSeries{books} to Book{bookSeries}
}

paginate * with pagination
Enter fullscreen mode Exit fullscreen mode

A minute later (PostgreSQL, a Vue front-end, and an npm install aren't instant), OtakuShelf exists. Sam didn't write a line of JDL — but, being Sam, read every line the agent did.

"Here" is not a place

One habit to build immediately: the MCP has no current directory. Every tool wants an absolute workingDirectory, and create_app_from_jdl flatly refuses to scribble into a folder that isn't empty. "Make me an app here" goes nowhere; "make me an app in /Users/sam/projects/otakushelf" works. Say where, every time. (It's also a nice guardrail — the agent can't wander off and generate in some surprising place.)

Okay, how do I actually run this thing?

The files exist, but the MCP draws a hard line: it scaffolds and edits, it does not build, run, start, or git-commit your app. That's your shell's job, on purpose. So Sam asks the obvious follow-up:

What are the build and run commands for /Users/sam/projects/otakushelf?

The project_commands tool reads the project and answers from facts — it sees Maven with the wrapper present and a Vue package.json, so it reports ./mvnw to start the backend, npm install then npm start for the Vue dev server, ./mvnw verify for tests, and so on — and reminds Sam it's reporting these, not running them. Two terminals later, OtakuShelf is live at localhost:8080, empty and waiting for its first franchise.

Where this is going

In one sitting Sam went from empty folder to a running, paginated CRUD app for the manga side — by describing it, not typing it. But a catalog of manga without anime is only half a shelf. Next, Sam comes back to a live project to add the anime side — and that's where a careful developer reaches for previews before touching anything.

Next in the series: "Adding the anime side without holding my breath" — coming back to a live project to add the anime entities, previewing every change first.

Top comments (0)