agentleFS
thenavidmthenavidm/midjourney-mcp-cli/CLAUDE.md

midjourney-mcp-cli

CLAUDE.md10 starsChanged 41 days agoMITView on GitHub

Read SKILL.md for how to use the server. This file is about changing it. src/tools/index.ts exports one ALL_TOOLS array. tools/kit.ts turns each spec into a Slipway tool, and Slipway serves it as an MCP tool and as a shell command from src/app.ts. Add a tool to that array and it exists on both surfaces, with flags, help, validation and the write guard already applied. A tool that spends GPU time is risk: "spend", which Slipway confirms, and which MIDJOURNEY_ALLOW_DESTRUCTIVE=0 refuses.

The file

We split this CLAUDE.md into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read SKILL.md for how to *use* the server.

    line 3
  2. Very specific:

    Never add a shell command by hand.

    line 14
  3. Very specific:

    When you need an endpoint that does not exist here yet, do not guess it.

    line 34
  4. Very specific:

    Every environment variable the code reads goes in ENV_VARS in config.ts, in --help, and in the README.

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Working on this repo

Read SKILL.md for how to use the server. This file is about changing it.

The one rule that shapes everything

src/tools/index.ts exports one ALL_TOOLS array. tools/kit.ts turns each spec into a Slipway tool, and Slipway serves it as an MCP tool and as a shell command from src/app.ts. Add a tool to that array and it exists on both surfaces, with flags, help, validation and the write guard already applied. A tool that spends GPU time is risk: "spend", which Slipway confirms, and which MIDJOURNEY_ALLOW_DESTRUCTIVE=0 refuses.

Never add a shell command by hand. If a tool needs a nicer shell spelling, that is a FLAG_ALIASES entry in src/vocabulary.ts, not a second code path; a word people type when looking for it is a SYNONYMS entry there.

Where the risk lives

Everything reaches Midjourney through CdpBrowser.apiFetch, which runs fetch() inside a real logged-in page. There is no credential in this process and there must never be one. If a change introduces cookie handling, token storage or TLS impersonation, it is the wrong change: the browser is the credential.

src/api/client.ts is the only place that talks to the transport. Pacing, retries and error classification live there so an upstream change is one file.

Shapes are not contracts

Midjourney publishes nothing. format/jobs.ts reads what it recognises, keeps the untouched record alongside, and never throws because a field moved. Keep that discipline in anything new: prefer returning a partial answer over failing.

When you need an endpoint that does not exist here yet, do not guess it. Run midjourney-cli capture --seconds 60 --out capture.json, use the site, and read the real request out of the file.

Before shipping

npm run typecheck && npm test && npm run build

Tests use a faked transport and never touch the network. tests/cli.test.ts holds the seam between the two surfaces; if it fails, they have drifted.

Every environment variable the code reads goes in ENV_VARS in config.ts, in --help, and in the README. A test checks all three agree.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.