rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
bauerelizabeth07139/opencode-tokenrhythm-image-mcp
DeepSeek Harness plugin and OpenCode MCP server: generate images with TokenRhythm (qwen-image-2.0, wan2.7-image) and save them to a directory you choose. Exposes mcp__tokenrhythm_image__generate_image.
PROJECT TOPICS
PROJECT README
Text to image, straight to disk. qwen-image-2.0 or wan2.7-image
through TokenRhythm; the generated file lands in a directory you choose and its
path is returned to the model.
用 TokenRhythm 生成图片并直接落盘,把本地路径交回模型。
As a DeepSeek Harness plugin: the MCP server ships inside the bundle, so
installing one plugin is the whole setup — no mcpServers file to hand-edit.
DeepSeek Harness Desktop — open Plugins in the sidebar, choose Add plugin, and enter:
https://github.com/bauerelizabeth07139/opencode-tokenrhythm-image-mcp
Then switch the new dsh-tokenrhythm-image bundle on. The Desktop app boots the
reserved desktop profile, so that is where it has to be enabled.
dsh CLI — install it into the profile you actually boot:
dsh plugin --profile web add bauerelizabeth07139/opencode-tokenrhythm-image-mcp
No git on the machine? pnpm resolves a git shorthand with git ls-remote,
which fails with 'git' is not recognized when git is missing. Use the tarball
instead — that path is plain HTTPS:
dsh plugin --profile web add https://codeload.github.com/bauerelizabeth07139/opencode-tokenrhythm-image-mcp/tar.gz/main
The same address works in the Desktop Add plugin dialog. Replace main
with a commit SHA to pin an exact revision (/tar.gz/<sha>).
Uninstall with dsh plugin --profile web remove dsh-tokenrhythm-image.
PATH, or pointed at with python.TOKENRHYTHM_API_KEY (or config.apiKey), plus
network access to https://tokenrhythm.studio/v1.The server registers 2 tool(s). DSH namespaces them automatically,
so the model calls them as mcp__tokenrhythm_image__<tool>:
| Tool | What it does |
|---|---|
generate_image |
Generates up to four images and writes each one into the output directory, returning the local paths and the remote URLs. Parameters: prompt (required), model (qwen-image-2.0 or wan2.7-image), n (1–4), size. |
list_image_models |
Lists the two TokenRhythm image models. |
| Key | Environment variable | Default | Meaning |
|---|---|---|---|
python |
— | discovered | interpreter that runs the server |
apiKey |
TOKENRHYTHM_API_KEY |
(empty) | TokenRhythm credential |
baseUrl |
TOKENRHYTHM_BASE_URL |
https://tokenrhythm.studio/v1 |
API base |
outputDir |
TOKENRHYTHM_OUTPUT_DIR |
~/Pictures/opencode-tokenrhythm |
where generated images are written |
toolCallTimeoutMs |
— | 360000 |
DSH's per-call budget; a single request may take 300 s |
env |
— | {} |
raw environment passthrough |
Every field is optional and lives in the loader row. For example, in
cordis.patch.yml:
- id: dsh-tokenrhythm-image
name: 'dsh-tokenrhythm-image'
config:
apiKey: 'sk-...'
outputDir: 'D:/images/generated'
toolCallTimeoutMs: 360000
outputDir. The server's default writes outside the workspace
(~/Pictures/opencode-tokenrhythm on this platform). Point it somewhere you
expect files to appear.TOKENRHYTHM_API_KEY environment variable is not set.index.js resolves a Python interpreter (the configured python, then
python3/python on PATH), hands the server its argv and working directory,
and mounts it as a stdio MCP server through @deepseek-ai/dsh-mcp-client with
failOnStartupError: true, so a server that cannot start is a visible error
rather than a silently missing tool.
Credentials are forwarded explicitly. The harness scrubs credential-shaped
variables (KEY, TOKEN, SECRET, PASSWORD) out of the environment a child
process inherits, so config.apiKey — falling back to the variable the server
documents — is written into the child's environment by the plugin itself. That
means both of these work:
config:
apiKey: '<your key>'
export TOKENRHYTHM_API_KEY='<your key>' # picked up at load time
No build step and no runtime dependencies — @deepseek-ai/cordis and
@deepseek-ai/dsh-mcp-client are peers supplied by the Harness.
npm test # node >= 22: manifest checks + the stdio mount, both Harness-free
The mount test loads index.js with @deepseek-ai/dsh-mcp-client stubbed and
asserts the exact stdio configuration the plugin produces, including the
credential forwarding above.
| Path | Purpose |
|---|---|
index.js |
the DSH plugin: resolves the interpreter and mounts the server |
cordis.patch.yml |
the loader row that activates the plugin |
locale/{en,zh}.json |
card title and description for the plugin lists |
assets/icon.svg |
card artwork |
test/ |
npm test: manifest composition and the mount contract |
server.py |
the MCP server, unchanged |
The server is a plain stdio MCP server and still works anywhere else. The
repository's original README is kept verbatim as
README.opencode.md, and the launch stanza from it keeps
working:
{
"mcp": {
"tokenrhythm-image": {
"type": "local",
"command": ["python", "C:\\path\\to\\server.py"],
"enabled": true,
"environment": { "TOKENRHYTHM_API_KEY": "{env:TOKENRHYTHM_API_KEY}" }
}
}
}
MIT — the repository shipped no licence; this plugin's release adds one for the repository owner's own code.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: mcp、deepseek-harness。