Context7
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
LLM-operable Midjourney pipeline: 21 MCP tools to compose, generate, curate with vision, and log.
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
DISCORD_USER_TOKEN, MJ_CHANNEL_ID, MJ_IMAGINE_VERSION, CASCADE_BRIDGE_URLค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"cascade-img": {
"command": "uvx",
"args": [
"cascade-img"
],
"env": {
"DISCORD_USER_TOKEN": "ใส่ค่าของคุณ",
"MJ_CHANNEL_ID": "ใส่ค่าของคุณ",
"MJ_IMAGINE_VERSION": "ใส่ค่าของคุณ",
"CASCADE_BRIDGE_URL": "ใส่ค่าของคุณ"
}
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add cascade-img --env DISCORD_USER_TOKEN='ใส่ค่าของคุณ' --env MJ_CHANNEL_ID='ใส่ค่าของคุณ' --env MJ_IMAGINE_VERSION='ใส่ค่าของคุณ' --env CASCADE_BRIDGE_URL='ใส่ค่าของคุณ' -- uvx cascade-imgเติมค่าที่เว้นว่างไว้ก่อนรัน
วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"cascade-img": {
"command": "uvx",
"args": [
"cascade-img"
],
"env": {
"DISCORD_USER_TOKEN": "ใส่ค่าของคุณ",
"MJ_CHANNEL_ID": "ใส่ค่าของคุณ",
"MJ_IMAGINE_VERSION": "ใส่ค่าของคุณ",
"CASCADE_BRIDGE_URL": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"cascade-img": {
"type": "stdio",
"command": "uvx",
"args": [
"cascade-img"
],
"env": {
"DISCORD_USER_TOKEN": "ใส่ค่าของคุณ",
"MJ_CHANNEL_ID": "ใส่ค่าของคุณ",
"MJ_IMAGINE_VERSION": "ใส่ค่าของคุณ",
"CASCADE_BRIDGE_URL": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
CASCADE_BRIDGE_URL envค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 7 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub laffeyp ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
ต้องใส่ค่าเหล่านี้: DISCORD_USER_TOKEN, MJ_CHANNEL_ID, MJ_IMAGINE_VERSION
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.1.1) เข้า registry 4 เดือนที่ผ่านมา
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย
ในหมวดเดียวกันมี Context7, Codebase Memory, Exa
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
Generate Midjourney images by conversation instead of by hand. You describe what you want; your AI assistant composes the prompt, fires it, inspects the grid with vision, crops the best quadrant, cleans it up, and logs what worked.
You: "I need a flat-design mountain icon, centered, simple shapes, transparent background"
Agent: reads prompt log → composes prompt from parts → fires imagine → waits → inspects 2x2 grid with vision → picks best quadrant → crops it → removes background → saves → logs what worked
cascade-img is an MCP server with 23 tools that plugs into Claude, Cursor, Codex, or anything that speaks MCP. Midjourney is the first backend; Flux, DALL-E, and Imagen are on the roadmap. There's also a CLI.
Not a programmer? Open an AI assistant that can run commands (Claude Code, Cursor, or Cline), point it at this repo, and say: *"Read RUNBOOK.md and set up cascade-img on this machine, then let me make images by describing them to you."* It does the technical parts. You just need a Midjourney subscription and to copy a few values from Discord.
You need: a paid Midjourney subscription, a Discord account with the MJ bot in a channel, and Python 3.12 or newer.
pip install cascade-img
Or from source:
git clone https://github.com/laffeyp/cascade-img
cd cascade-img/packages/python pip install -e .
This puts three commands for operating cascade-img on your PATH: cascade-mj-bridge (the daemon), cascade-mcp (the MCP server), and cascade-mj (the CLI). Installing also adds a fourth command, cascade-trace-check — a diagnostics validator (not part of the generation loop) that replays a recorded event log and checks it against the vocabulary's declared event ordering and timing rules.
Configure — you need four values from the Discord desktop app (channel ID, server ID, imagine version, and your user token). Takes about five minutes. RUNBOOK.md walks through each one step by step.
cp "$(python -c 'import cascade_img, pathlib; print(pathlib.Path(cascade_img.__path__[0]) / ".env.example")')" .env
cascade-mj-bridge --check-env --pretty
Start the daemon in one terminal, then connect from another:
cascade-mj-bridge # leave running — holds the Discord connection
Connect your AI assistant — add to your MCP config (Claude Desktop, Cursor, Cline):
{
"mcpServers": { "cascade-img": { "command": "cascade-mcp" } } }
Or point your assistant at this repo and ask it to read AGENTS.md — it'll wire everything up.
Or use the CLI:
echo '{
"mountain-icon": { "subject": "a flat-design icon of a mountain, centered, simple shapes", "aspect_ratio": "1:1" } }' > assets.json
cascade-mj mountain-icon --registry assets.json --upscale all --pretty
| Category | Tools | What they do |
|---|---|---|
| Onboarding | cascade_guide | Returns the full operating manual in one call — the loop, every tool, the failure→action table. Call it first; the generation and curation tools are gated until it's read. |
| Generation | imagine, generate_video, wait, status, bridge_health, mj_action | Compose and fire prompts, poll for results, check daemon health, trigger Midjourney actions (upscale, vary, pan) |
| Catch-up | channel_recent, adopt_message | See what the human did by hand in Discord and claim those results into the pipeline — adopted messages become normal jobs that curation and mj_action work on |
| Composition | compose_prompt, compose_video | Build prompts from structured parts — subject, moodboard, style refs, aspect ratio, negatives — not freeform text |
| Curation | crop_grid, alpha_key, auto_trim, palette_quantize, contact_sheet, sprite_sheet, score_grid, video_filmstrip, loop_seam_delta, promote | Extract quadrants from grids, remove backgrounds, trim whitespace, build sprite sheets, score results with vision, promote winners to final output |
| Working memory | log_append, read_prompt_log | Append-only prompt log the agent reads before every run — what was tried, what worked, what didn't. Persists across sessions. |
Every call returns {ok, result} or {ok: false, error: {code, remediation}}. Branch on the stable code, not the message. Full tool reference in AGENTS.md.
Other open-source Midjourney tools focus on the generation step — fire the prompt, hand back the image. cascade-img does the work around that:
One daemon, two stateless clients, all over local HTTP:
--http for HTTP. Stateless — start and stop freely.Prompts are composed from structured parts, not written as raw strings:
from cascade_img.prompt.composer import PromptComposer, Subject, StyleStack, IdentityStack
prompt = PromptComposer().compose( Subject( text="a flat-design icon of a mountain", constraints=["centered", "simple shapes", "transparent background"], ),
style=StyleStack(moodboard="abc123def", sref="https://cdn.example.com/style.png"), identity=IdentityStack(oref="https://cdn.example.com/ref.png", ow=1000), aspect_ratio="1:1", version="7", )
All three entry points emit structured JSON and follow the same {ok, result | error: {code, remediation}} envelope. Every failure carries a stable error code (e.g. DISCORD_401, MJ_UUID_MISSING, UPSCALE_BUTTON_FAILED) with a machine-readable remediation — so a caller branches on the code, not the message. The full catalog of log events and error codes is in vocabulary/0.1.json, and a trace checker (cascade-trace-check) enforces event ordering over recorded runs.
Midjourney terminology
prompt — the text + flags you send Midjourney. grid — the 2x2 set of four candidates returned per prompt. quadrant / U1-U4 — the four cells; "U2" means upscale the second. upscale — render one cell at full resolution. aspect ratio (`--ar`) — output shape. sref — an image whose *style* to borrow. oref — an image whose *subject identity* to keep across poses. moodboard (`--p`) — a saved personalization profile. stylize (`--s`) — how strongly MJ applies its own aesthetic.
| Doc | What it covers |
|---|---|
| AGENTS.md | The LLM operator's guide. Read this when handing cascade-img to an agent. |
| RUNBOOK.md | Install, env capture, setup, reconnect lifecycle, every failure mode with error codes and fixes. |
| CAPABILITIES.md | Every Midjourney feature cascade-img drives — prompt parameters, mj_actions, the V8.1/V7 split. |
| ARCHITECTURE.md | Internal architecture and design decisions. |
| examples/ | Three walkthroughs: single image, batch, video. Read AGENTS.md first. |
| CHANGELOG.md | Release history. |
| Version | What's in it |
|---|---|
| v0.1 (current) | MJ backend (V8.1 + V7), prompt composer, curation tools, MCP server, CLI, prompt log |
| v0.2 | Channel catch-up + message adoption — landed on main: channel_recent and adopt_message let the agent see what the human did by hand in Discord and act on it (design); still to come: more MJ commands (/describe, /blend, Vary Region inpaint, /tune), retro-U-press on adopted grids, internal refactoring |
| v0.3 | TypeScript wrapper; first API backends — Flux via Fal + Flux Kontext, Ideogram |
| v0.4 | Google Imagen, Recraft (native vector/SVG) |
| v0.5 | OpenAI gpt-image, Stable Diffusion |
| v1.0 | API stable, three+ backends in production |
Every backend implements one interface, so a later release can chain them — generate on one provider, refine on a second (e.g. Flux Kontext), upscale on a third.
cascade-img/
├── packages/python/ # the Python package (cascade_img) │ ├── src/cascade_img/ # prompt/, interfaces/, backends/, curation/, vocabulary/ │ ├── tests/ # behavior tests │ └── tools/ # live smoke walk ├── examples/ # three walkthroughs of the operating loop ├── vocabulary/0.1.json # event log-line catalog └── *.md # README, ARCHITECTURE, RUNBOOK, AGENTS, CAPABILITIES, ...
This tool automates Midjourney through a Discord user account. A paid Midjourney subscription is required. Both Discord and Midjourney's Terms of Service prohibit user-account automation. This is the same mechanism used by every open-source MJ tool (midjourney-proxy, midjourney-api, etc.) — there is no public Midjourney API. Use at your own risk.
The backend interface is pluggable — Flux, DALL-E, and Imagen are on the roadmap.
Apache-2.0. See LICENSE.