janction-render 0.1.1__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of janction-render might be problematic. Click here for more details.

@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: janction-render
3
- Version: 0.1.1
4
- Summary: Render Blender scenes on JANCTION GPUs straight from terminal AI agents (Claude Code, Codex): MCP server + CLI
3
+ Version: 0.2.0
4
+ Summary: Cloud GPU render farm for Blender, for AI agents: MCP server (remote + stdio) and CLI. Render Blender without a GPU from Claude, ChatGPT, Claude Code, Codex, Cursor.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
7
7
  License-File: LICENSE
@@ -15,23 +15,47 @@ Dynamic: license-file
15
15
 
16
16
  # JANCTION Render
17
17
 
18
- Render Blender scenes on JANCTION GPUs straight from a terminal AI agent (Claude Code, Codex, or any MCP client).
19
- Use it when you are building 3DCG with Blender and have no GPU, or rendering locally is slow.
18
+ A cloud GPU render farm for Blender, built for AI agents. Render Blender scenes on JANCTION GPUs from **Claude, ChatGPT,
19
+ Claude Code, Codex, Cursor or any MCP client**: an MCP server (remote and stdio) plus a CLI. Use it to render Blender
20
+ without a GPU, or when rendering locally is slow.
20
21
 
21
22
  - Input: a `.blend` file, or a **bpy Python script that builds the scene** (no local Blender needed).
22
23
  - `scene_info` reads the scene without rendering (cameras, frame range, missing files).
23
24
  - `render_preview` returns 1-4 low-cost frames tiled in one image within seconds, so the agent can look, fix, and repeat.
24
- - `render_final` renders the frames on GPUs and joins them into an MP4.
25
+ - `render_estimate` says how long a render will take ("about 3 minutes") and whether it fits today's free quota.
26
+ - `render_final` renders the frames on GPUs and joins them into an MP4; `render_status` reports the remaining time.
25
27
  - Free beta: no charges. Each key gets 10 GPU-minutes per day; a final render is up to 240 frames at 1080p.
26
28
  Paid plans (per GPU second, prepaid credit) will be announced on the service page before they start.
27
29
  - Inputs and results are deleted 24 hours after last use and are never used for training.
28
30
 
29
31
  ## Status
30
32
 
31
- Free beta. The public endpoint is `https://render.janction.jp` (`/v1/health`, `/llms.txt`). Quotas and limits are on the
32
- service page; paid plans will be announced there before they start.
33
+ Free beta. Service page: `https://render.janction.jp` (`/v1/health`, `/llms.txt`). Blender 5.0, Cycles on GPU.
33
34
 
34
- ## Install
35
+ ## Connect (remote MCP, nothing to install)
36
+
37
+ MCP server URL: **`https://render.janction.jp/mcp`** (Streamable HTTP). Auth is OAuth 2.1 with dynamic client
38
+ registration: pressing "Connect" opens a page that creates a free API key (or takes one you already have). A raw API key
39
+ also works as `Authorization: Bearer jr_...`.
40
+
41
+ | client | how |
42
+ |---|---|
43
+ | Claude.ai (web, desktop, mobile) | Settings → Connectors → Add custom connector → paste the URL → Connect |
44
+ | ChatGPT | Settings → Connectors → Advanced → Developer mode → Create → paste the URL (OAuth) |
45
+ | Claude Code | `claude mcp add --transport http janction-render https://render.janction.jp/mcp`, then `/mcp` to authenticate |
46
+ | Cursor, Windsurf, other MCP clients | Streamable HTTP at the URL above (OAuth, or a Bearer API key header) |
47
+
48
+ Remote tools take `scene_script` (bpy code as text), `scene_url` (an https link to a `.blend` or `.py`) or `scene_id`;
49
+ results come back as an inline image plus download links that need no key and work for about 24 hours.
50
+
51
+ Claude Code plugin (the remote connector plus a skill with the workflow):
52
+
53
+ ```
54
+ /plugin marketplace add KJdayo/janction-render
55
+ /plugin install janction-render@janction-render
56
+ ```
57
+
58
+ ## Install (stdio MCP, sends local files)
35
59
 
36
60
  The package is on PyPI as `janction-render`.
37
61
 
@@ -54,7 +78,8 @@ env = { JANCTION_RENDER_SERVER = "https://render.janction.jp" }
54
78
  ```
55
79
 
56
80
  A temporary API key is issued automatically on first use and cached in `~/.janction-render.json`; set
57
- `JANCTION_RENDER_API_KEY` to pin one (quota and, later, credit belong to the key).
81
+ `JANCTION_RENDER_API_KEY` to pin one (quota and, later, credit belong to the key). The same key can be used from the
82
+ remote connector: paste it on the connect page.
58
83
 
59
84
  Then, in Claude Code:
60
85
 
@@ -64,12 +89,13 @@ Then, in Claude Code:
64
89
 
65
90
  | tool | what |
66
91
  |---|---|
67
- | `scene_info(scene_path | scene_script | scene_id)` | cameras, frame range, fps, resolution, objects, lights, missing files. No render. |
92
+ | `scene_info(scene_script | scene_url | scene_path | scene_id)` | cameras, frame range, fps, resolution, objects, lights, missing files. No render. |
68
93
  | `render_preview(..., frames="1-24")` | up to 4 frames (720p budget) tiled with frame labels; returns the image inline |
94
+ | `render_estimate(scene_id, frame_start, frame_end, width, height, samples)` | GPU seconds, queue wait, "about N minutes", fits today's free quota? No GPU time used |
69
95
  | `render_final(scene_id, frame_start, frame_end, width, height, samples, fps, output)` | PNG or MP4; returns job_id + estimate |
70
- | `render_status(job_id)` / `render_download(job_id)` / `render_cancel(job_id)` | progress, files, cancel |
71
- | `billing(topup_yen=0)` | free-beta quota (used today, daily limit, reset time); later balance and top-up link |
72
- | `render_info()` | server, workers online, queue |
96
+ | `render_status(job_id)` | progress and ETA (`eta.human`); `render_download(job_id)` files or links; `render_cancel(job_id)` |
97
+ | `billing()` | free-beta quota (used today, daily limit, reset time); later balance and top-up link |
98
+ | `render_info()` | workers online, queue and expected wait |
73
99
 
74
100
  CLI: `janction-render inspect|preview|render|status|download|cancel|jobs|balance|topup|info`.
75
101
 
@@ -97,11 +123,14 @@ Scripts run in an isolated container with no network. See `samples/cube_scene.py
97
123
  ```
98
124
  POST /v1/keys -> {api_key} (header X-API-Key afterwards)
99
125
  POST /v1/files multipart "file" (.blend|.py) -> {scene_id}
126
+ POST /v1/estimate {kind, frames|frame_start/frame_end, width, height, samples, scene_id?} -> seconds, wall_seconds, human, quota
100
127
  POST /v1/jobs {scene_id, kind: info|preview|final, frames|frame_start/frame_end, width, height, samples, camera, fps, output}
101
- GET /v1/jobs/{id} status, progress, artifacts[], cost, warnings, info DELETE /v1/jobs/{id} cancel
128
+ GET /v1/jobs/{id} status, progress, eta, artifacts[], cost, warnings, info DELETE /v1/jobs/{id} cancel
102
129
  GET /v1/jobs/{id}/artifacts/{name} PNG / MP4
130
+ POST /mcp remote MCP (Streamable HTTP; Bearer api key or OAuth)
131
+ GET /.well-known/oauth-protected-resource/mcp OAuth discovery
103
132
  POST /v1/billing/checkout {amount_yen} -> {checkout_url} POST /v1/billing/sync GET /v1/ledger GET /v1/me
104
- GET /llms.txt /terms /privacy /tokushoho
133
+ GET /llms.txt /terms /privacy /legal /security
105
134
  ```
106
135
 
107
136
  During the free beta a `429 quota_exceeded` response carries `resets_at`; a `400 beta_limit` means the job is too big
@@ -109,13 +138,13 @@ During the free beta a `429 quota_exceeded` response carries `resets_at`; a `400
109
138
 
110
139
  ## Self-hosting
111
140
 
112
- The server (FastAPI + SQLite) and the worker (Blender in disposable Docker containers, `--network none --cap-drop ALL`)
113
- live in the internal repository and are not part of this package yet. This repository holds the client side: MCP server, CLI,
114
- HTTP client and samples.
141
+ The server (FastAPI + SQLite, with the remote MCP endpoint) and the worker (Blender in disposable Docker containers,
142
+ `--network none --cap-drop ALL`) live in the internal repository and are not part of this package yet. This repository
143
+ holds the client side: stdio MCP server, CLI, HTTP client, samples and the Claude Code plugin.
115
144
 
116
145
  ## MCP registry
117
146
 
118
- This package is listed in the official MCP registry as `io.github.KJdayo/janction-render`.
147
+ This server is listed in the official MCP registry as `io.github.KJdayo/janction-render` (remote: `https://render.janction.jp/mcp`).
119
148
 
120
149
  mcp-name: io.github.KJdayo/janction-render
121
150
 
@@ -1,22 +1,46 @@
1
1
  # JANCTION Render
2
2
 
3
- Render Blender scenes on JANCTION GPUs straight from a terminal AI agent (Claude Code, Codex, or any MCP client).
4
- Use it when you are building 3DCG with Blender and have no GPU, or rendering locally is slow.
3
+ A cloud GPU render farm for Blender, built for AI agents. Render Blender scenes on JANCTION GPUs from **Claude, ChatGPT,
4
+ Claude Code, Codex, Cursor or any MCP client**: an MCP server (remote and stdio) plus a CLI. Use it to render Blender
5
+ without a GPU, or when rendering locally is slow.
5
6
 
6
7
  - Input: a `.blend` file, or a **bpy Python script that builds the scene** (no local Blender needed).
7
8
  - `scene_info` reads the scene without rendering (cameras, frame range, missing files).
8
9
  - `render_preview` returns 1-4 low-cost frames tiled in one image within seconds, so the agent can look, fix, and repeat.
9
- - `render_final` renders the frames on GPUs and joins them into an MP4.
10
+ - `render_estimate` says how long a render will take ("about 3 minutes") and whether it fits today's free quota.
11
+ - `render_final` renders the frames on GPUs and joins them into an MP4; `render_status` reports the remaining time.
10
12
  - Free beta: no charges. Each key gets 10 GPU-minutes per day; a final render is up to 240 frames at 1080p.
11
13
  Paid plans (per GPU second, prepaid credit) will be announced on the service page before they start.
12
14
  - Inputs and results are deleted 24 hours after last use and are never used for training.
13
15
 
14
16
  ## Status
15
17
 
16
- Free beta. The public endpoint is `https://render.janction.jp` (`/v1/health`, `/llms.txt`). Quotas and limits are on the
17
- service page; paid plans will be announced there before they start.
18
+ Free beta. Service page: `https://render.janction.jp` (`/v1/health`, `/llms.txt`). Blender 5.0, Cycles on GPU.
18
19
 
19
- ## Install
20
+ ## Connect (remote MCP, nothing to install)
21
+
22
+ MCP server URL: **`https://render.janction.jp/mcp`** (Streamable HTTP). Auth is OAuth 2.1 with dynamic client
23
+ registration: pressing "Connect" opens a page that creates a free API key (or takes one you already have). A raw API key
24
+ also works as `Authorization: Bearer jr_...`.
25
+
26
+ | client | how |
27
+ |---|---|
28
+ | Claude.ai (web, desktop, mobile) | Settings → Connectors → Add custom connector → paste the URL → Connect |
29
+ | ChatGPT | Settings → Connectors → Advanced → Developer mode → Create → paste the URL (OAuth) |
30
+ | Claude Code | `claude mcp add --transport http janction-render https://render.janction.jp/mcp`, then `/mcp` to authenticate |
31
+ | Cursor, Windsurf, other MCP clients | Streamable HTTP at the URL above (OAuth, or a Bearer API key header) |
32
+
33
+ Remote tools take `scene_script` (bpy code as text), `scene_url` (an https link to a `.blend` or `.py`) or `scene_id`;
34
+ results come back as an inline image plus download links that need no key and work for about 24 hours.
35
+
36
+ Claude Code plugin (the remote connector plus a skill with the workflow):
37
+
38
+ ```
39
+ /plugin marketplace add KJdayo/janction-render
40
+ /plugin install janction-render@janction-render
41
+ ```
42
+
43
+ ## Install (stdio MCP, sends local files)
20
44
 
21
45
  The package is on PyPI as `janction-render`.
22
46
 
@@ -39,7 +63,8 @@ env = { JANCTION_RENDER_SERVER = "https://render.janction.jp" }
39
63
  ```
40
64
 
41
65
  A temporary API key is issued automatically on first use and cached in `~/.janction-render.json`; set
42
- `JANCTION_RENDER_API_KEY` to pin one (quota and, later, credit belong to the key).
66
+ `JANCTION_RENDER_API_KEY` to pin one (quota and, later, credit belong to the key). The same key can be used from the
67
+ remote connector: paste it on the connect page.
43
68
 
44
69
  Then, in Claude Code:
45
70
 
@@ -49,12 +74,13 @@ Then, in Claude Code:
49
74
 
50
75
  | tool | what |
51
76
  |---|---|
52
- | `scene_info(scene_path | scene_script | scene_id)` | cameras, frame range, fps, resolution, objects, lights, missing files. No render. |
77
+ | `scene_info(scene_script | scene_url | scene_path | scene_id)` | cameras, frame range, fps, resolution, objects, lights, missing files. No render. |
53
78
  | `render_preview(..., frames="1-24")` | up to 4 frames (720p budget) tiled with frame labels; returns the image inline |
79
+ | `render_estimate(scene_id, frame_start, frame_end, width, height, samples)` | GPU seconds, queue wait, "about N minutes", fits today's free quota? No GPU time used |
54
80
  | `render_final(scene_id, frame_start, frame_end, width, height, samples, fps, output)` | PNG or MP4; returns job_id + estimate |
55
- | `render_status(job_id)` / `render_download(job_id)` / `render_cancel(job_id)` | progress, files, cancel |
56
- | `billing(topup_yen=0)` | free-beta quota (used today, daily limit, reset time); later balance and top-up link |
57
- | `render_info()` | server, workers online, queue |
81
+ | `render_status(job_id)` | progress and ETA (`eta.human`); `render_download(job_id)` files or links; `render_cancel(job_id)` |
82
+ | `billing()` | free-beta quota (used today, daily limit, reset time); later balance and top-up link |
83
+ | `render_info()` | workers online, queue and expected wait |
58
84
 
59
85
  CLI: `janction-render inspect|preview|render|status|download|cancel|jobs|balance|topup|info`.
60
86
 
@@ -82,11 +108,14 @@ Scripts run in an isolated container with no network. See `samples/cube_scene.py
82
108
  ```
83
109
  POST /v1/keys -> {api_key} (header X-API-Key afterwards)
84
110
  POST /v1/files multipart "file" (.blend|.py) -> {scene_id}
111
+ POST /v1/estimate {kind, frames|frame_start/frame_end, width, height, samples, scene_id?} -> seconds, wall_seconds, human, quota
85
112
  POST /v1/jobs {scene_id, kind: info|preview|final, frames|frame_start/frame_end, width, height, samples, camera, fps, output}
86
- GET /v1/jobs/{id} status, progress, artifacts[], cost, warnings, info DELETE /v1/jobs/{id} cancel
113
+ GET /v1/jobs/{id} status, progress, eta, artifacts[], cost, warnings, info DELETE /v1/jobs/{id} cancel
87
114
  GET /v1/jobs/{id}/artifacts/{name} PNG / MP4
115
+ POST /mcp remote MCP (Streamable HTTP; Bearer api key or OAuth)
116
+ GET /.well-known/oauth-protected-resource/mcp OAuth discovery
88
117
  POST /v1/billing/checkout {amount_yen} -> {checkout_url} POST /v1/billing/sync GET /v1/ledger GET /v1/me
89
- GET /llms.txt /terms /privacy /tokushoho
118
+ GET /llms.txt /terms /privacy /legal /security
90
119
  ```
91
120
 
92
121
  During the free beta a `429 quota_exceeded` response carries `resets_at`; a `400 beta_limit` means the job is too big
@@ -94,13 +123,13 @@ During the free beta a `429 quota_exceeded` response carries `resets_at`; a `400
94
123
 
95
124
  ## Self-hosting
96
125
 
97
- The server (FastAPI + SQLite) and the worker (Blender in disposable Docker containers, `--network none --cap-drop ALL`)
98
- live in the internal repository and are not part of this package yet. This repository holds the client side: MCP server, CLI,
99
- HTTP client and samples.
126
+ The server (FastAPI + SQLite, with the remote MCP endpoint) and the worker (Blender in disposable Docker containers,
127
+ `--network none --cap-drop ALL`) live in the internal repository and are not part of this package yet. This repository
128
+ holds the client side: stdio MCP server, CLI, HTTP client, samples and the Claude Code plugin.
100
129
 
101
130
  ## MCP registry
102
131
 
103
- This package is listed in the official MCP registry as `io.github.KJdayo/janction-render`.
132
+ This server is listed in the official MCP registry as `io.github.KJdayo/janction-render` (remote: `https://render.janction.jp/mcp`).
104
133
 
105
134
  mcp-name: io.github.KJdayo/janction-render
106
135
 
@@ -1,3 +1,3 @@
1
1
  """JANCTION Render — ターミナルの AI エージェントから GPU で 3DCG を描く。"""
2
2
 
3
- __version__ = "0.1.1"
3
+ __version__ = "0.2.0"
@@ -0,0 +1,55 @@
1
+ """仕事の状態を、エージェントが読みやすい短い形にする。stdio の MCP(mcp_server.py)とリモート MCP(server/mcp_remote.py)で共通。"""
2
+ from __future__ import annotations
3
+
4
+ from typing import Any
5
+
6
+
7
+ def eta_brief(e: dict[str, Any] | None) -> dict[str, Any] | None:
8
+ """受付の eta(作業時間の見積もり)から、伝える価値のある項目だけ。"""
9
+ if not e:
10
+ return None
11
+ keep = ("human", "remaining_seconds", "queue_wait_seconds", "remaining_gpu_seconds", "elapsed_seconds",
12
+ "running_for_seconds", "took_seconds", "workers_online", "basis")
13
+ return {k: e[k] for k in keep if e.get(k) is not None}
14
+
15
+
16
+ def estimate_brief(e: dict[str, Any] | None) -> dict[str, Any] | None:
17
+ if not e:
18
+ return None
19
+ keep = ("human", "seconds", "wall_seconds", "queue_wait_seconds", "per_frame_seconds", "frames", "chunks",
20
+ "workers_online", "basis", "basis_note", "note", "quota", "cost")
21
+ return {k: e[k] for k in keep if e.get(k) is not None}
22
+
23
+
24
+ def brief(j: dict[str, Any]) -> dict[str, Any]:
25
+ p = j["progress"]
26
+ out: dict[str, Any] = {
27
+ "job_id": j["job_id"],
28
+ "kind": j["kind"],
29
+ "status": j["status"],
30
+ "scene_id": j["scene_id"],
31
+ "frames": j["frames"] if j.get("frames") else f"{j['frame_start']}-{j['frame_end']}",
32
+ "progress": f"{p['frames_done']}/{p['frames_total']} frames, {p['chunks_done']}/{p['chunks_total']} chunks",
33
+ "queue_ahead": p["queue_ahead"],
34
+ "gpu_seconds": j["gpu_seconds"],
35
+ "device": j["device"],
36
+ "expires_at": j["expires_at"],
37
+ }
38
+ if j.get("eta"):
39
+ out["eta"] = eta_brief(j["eta"])
40
+ if j.get("estimate"):
41
+ out["estimate"] = estimate_brief(j["estimate"])
42
+ if j.get("error"):
43
+ out["error"] = j["error"]
44
+ if j.get("log_tail"):
45
+ out["log_tail"] = j["log_tail"][-1500:]
46
+ if j.get("warnings"):
47
+ out["warnings"] = j["warnings"]
48
+ if j.get("output"):
49
+ out["output"] = j["output"]["name"]
50
+ if j.get("cost"):
51
+ c = j["cost"]
52
+ out["cost"] = ("free" if c["free"] else
53
+ (f"{c['charged_yen']} yen charged" if c["settled"] else f"up to {c['reserved_yen']} yen reserved"))
54
+ out["artifacts"] = [a["name"] for a in j["artifacts"]][:50]
55
+ return out
@@ -185,6 +185,13 @@ class Client:
185
185
  body.update({k: v for k, v in params.items() if v is not None})
186
186
  return self._req("POST", "/v1/jobs", json=body)
187
187
 
188
+ def estimate(self, scene_id: Optional[str] = None, **params: Any) -> dict[str, Any]:
189
+ """入れずに見積もりだけ(GPU 秒・列の待ち・壁時計の目安・無料枠に収まるか)。"""
190
+ body: dict[str, Any] = {k: v for k, v in params.items() if v is not None}
191
+ if scene_id:
192
+ body["scene_id"] = scene_id
193
+ return self._req("POST", "/v1/estimate", json=body)
194
+
188
195
  def job(self, job_id: str) -> dict[str, Any]:
189
196
  return self._req("GET", f"/v1/jobs/{job_id}")
190
197
 
@@ -26,6 +26,7 @@ try:
26
26
  except ImportError: # mcp 1.x
27
27
  from mcp.server.fastmcp import FastMCP as MCPServer, Image # type: ignore
28
28
 
29
+ from janction_render.brief import brief as _brief, estimate_brief
29
30
  from janction_render.client import Client, ClientError, parse_frames
30
31
 
31
32
  PREVIEW_WAIT_S = 240.0
@@ -34,12 +35,13 @@ INFO_WAIT_S = 150.0
34
35
  mcp = MCPServer(
35
36
  name="janction-render",
36
37
  instructions=(
37
- "Render Blender scenes on JANCTION GPUs from the terminal. Use it when the user is "
38
- "building 3DCG with Blender (a .blend file or a bpy Python script) and has no GPU or "
39
- "rendering locally is slow. Flow: scene_info (cameras, frame range, missing files; no "
40
- "render) -> render_preview (1-4 fast frames in one image; look at it, fix the scene, "
41
- "repeat) -> ask the user 'is this OK?' -> render_final (frames or MP4) -> render_status / "
42
- "render_download. Inputs and results are deleted 24 hours after last use."
38
+ "Render Blender scenes on JANCTION GPUs (a cloud render farm for AI agents) from the terminal. Use it when the "
39
+ "user is building 3DCG with Blender (a .blend file or a bpy Python script) and has no GPU or rendering locally "
40
+ "is slow. Flow: scene_info (cameras, frame range, missing files; no render) -> render_preview (1-4 fast frames "
41
+ "in one image; look at it, fix the scene, repeat) -> ask the user 'is this OK?' -> render_estimate (tell the "
42
+ "user how long it takes and whether it fits today's free quota) -> render_final (frames or MP4) -> "
43
+ "render_status / render_download. Always tell the user the time estimate (estimate.human / eta.human). "
44
+ "Blender 5.0 with Cycles on GPU. Inputs and results are deleted 24 hours after last use."
43
45
  ),
44
46
  )
45
47
 
@@ -72,36 +74,6 @@ def _quota_block(exc: ClientError) -> Optional[dict[str, Any]]:
72
74
  "lower resolution or samples) may still fit"}
73
75
 
74
76
 
75
- def _brief(j: dict[str, Any]) -> dict[str, Any]:
76
- p = j["progress"]
77
- out = {
78
- "job_id": j["job_id"],
79
- "kind": j["kind"],
80
- "status": j["status"],
81
- "scene_id": j["scene_id"],
82
- "frames": j["frames"] if j.get("frames") else f"{j['frame_start']}-{j['frame_end']}",
83
- "progress": f"{p['frames_done']}/{p['frames_total']} frames, {p['chunks_done']}/{p['chunks_total']} chunks",
84
- "queue_ahead": p["queue_ahead"],
85
- "gpu_seconds": j["gpu_seconds"],
86
- "device": j["device"],
87
- "expires_at": j["expires_at"],
88
- }
89
- if j.get("error"):
90
- out["error"] = j["error"]
91
- if j.get("log_tail"):
92
- out["log_tail"] = j["log_tail"][-1500:]
93
- if j.get("warnings"):
94
- out["warnings"] = j["warnings"]
95
- if j.get("output"):
96
- out["output"] = j["output"]["name"]
97
- if j.get("cost"):
98
- c = j["cost"]
99
- out["cost"] = ("free" if c["free"] else
100
- (f"{c['charged_yen']} yen charged" if c["settled"] else f"up to {c['reserved_yen']} yen reserved"))
101
- out["artifacts"] = [a["name"] for a in j["artifacts"]][:50]
102
- return out
103
-
104
-
105
77
  def _payment_block(exc: ClientError) -> Optional[dict[str, Any]]:
106
78
  """残高不足(402)なら、決済ページのリンクと次の手順を返す。"""
107
79
  p = exc.payment()
@@ -218,6 +190,37 @@ def render_preview(
218
190
  return result
219
191
 
220
192
 
193
+ @mcp.tool()
194
+ def render_estimate(scene_id: str = "", kind: str = "final", frame_start: int = 1, frame_end: int = 1,
195
+ frames: str = "", width: int = 1920, height: int = 1080, samples: int = 128) -> str:
196
+ """Estimate how long a render will take BEFORE starting it (no GPU time used): GPU seconds, queue wait,
197
+ wall-clock time as a human-readable string ('about 3 minutes'), and whether it fits today's free quota and
198
+ the size limits. kind is 'final' (frame_start..frame_end at width x height, samples) or 'preview' (frames
199
+ like '1-24'). Pass scene_id when you have one: the estimate then uses this scene's own measured render
200
+ times. Tell the user the result before calling render_final."""
201
+ c = _client()
202
+ try:
203
+ params: dict[str, Any] = {"kind": kind, "width": width, "height": height, "samples": samples}
204
+ if kind == "preview":
205
+ params["frames"] = parse_frames(frames)
206
+ else:
207
+ params.update({"frame_start": frame_start, "frame_end": frame_end})
208
+ est = c.estimate(scene_id or None, **params)
209
+ except (ClientError, ValueError) as exc:
210
+ return _j({"ok": False, "error": str(exc)})
211
+ out = estimate_brief(est) or {}
212
+ out["kind"] = kind
213
+ q = est.get("quota") or {}
214
+ if q and not q.get("fits_today", True):
215
+ out["next"] = ("this does not fit today's remaining free GPU time; propose fewer frames, lower resolution or "
216
+ "samples, or wait until resets_at")
217
+ elif q and q.get("fits_size") is False:
218
+ out["next"] = f"too big for the free beta (max {q.get('max_frames_per_job')} frames and 1920x1080 per job); split it"
219
+ else:
220
+ out["next"] = "tell the user the estimate and ask before calling render_final"
221
+ return _j(out)
222
+
223
+
221
224
  @mcp.tool()
222
225
  def render_final(
223
226
  scene_path: str = "",
@@ -253,20 +256,26 @@ def render_final(
253
256
  except (ValueError, FileNotFoundError) as exc:
254
257
  return _j({"ok": False, "error": str(exc)})
255
258
  brief = _brief(j)
256
- brief["estimate"] = j.get("estimate")
257
- brief["next"] = "render_status(job_id) until status is done, then render_download(job_id)"
259
+ est = j.get("estimate") or {}
260
+ brief["next"] = (f"tell the user it will take {est.get('human', 'a few minutes')}; then render_status(job_id) "
261
+ "until status is done, then render_download(job_id)")
258
262
  return _j(brief)
259
263
 
260
264
 
261
265
  @mcp.tool()
262
266
  def render_status(job_id: str) -> str:
263
267
  """Check a JANCTION render job: status (queued/running/done/failed/canceled), frames done,
264
- how many chunks are queued ahead, artifacts ready, Blender warnings, and the error plus log
265
- tail if it failed. Use render_download once status is done."""
268
+ how many chunks are queued ahead, the ETA (eta.human = remaining time including queue wait),
269
+ artifacts ready, Blender warnings, and the error plus log tail if it failed. Use render_download
270
+ once status is done."""
266
271
  try:
267
- return _j(_brief(_client().job(job_id)))
272
+ j = _client().job(job_id)
268
273
  except ClientError as exc:
269
274
  return _j({"ok": False, "error": str(exc)})
275
+ b = _brief(j)
276
+ if j["status"] in ("queued", "running"):
277
+ b["next"] = f"tell the user: {((j.get('eta') or {}).get('human') or 'still working')}; check again in a while"
278
+ return _j(b)
270
279
 
271
280
 
272
281
  @mcp.tool()
@@ -346,7 +355,8 @@ def render_info() -> str:
346
355
  except (ClientError, Exception) as exc: # noqa: BLE001
347
356
  return _j({"ok": False, "server": c.server, "error": str(exc)})
348
357
  return _j({"ok": True, "server": c.server, "workers": health["workers"], "queue": health["queue"],
349
- "key": me, "downloads_go_to": str(_out_root())})
358
+ "key": me, "downloads_go_to": str(_out_root()),
359
+ "remote_mcp": f"{c.server}/mcp (Streamable HTTP; for Claude.ai, ChatGPT, Cursor: add this URL as a connector)"})
350
360
 
351
361
 
352
362
  def main() -> None:
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: janction-render
3
- Version: 0.1.1
4
- Summary: Render Blender scenes on JANCTION GPUs straight from terminal AI agents (Claude Code, Codex): MCP server + CLI
3
+ Version: 0.2.0
4
+ Summary: Cloud GPU render farm for Blender, for AI agents: MCP server (remote + stdio) and CLI. Render Blender without a GPU from Claude, ChatGPT, Claude Code, Codex, Cursor.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
7
7
  License-File: LICENSE
@@ -15,23 +15,47 @@ Dynamic: license-file
15
15
 
16
16
  # JANCTION Render
17
17
 
18
- Render Blender scenes on JANCTION GPUs straight from a terminal AI agent (Claude Code, Codex, or any MCP client).
19
- Use it when you are building 3DCG with Blender and have no GPU, or rendering locally is slow.
18
+ A cloud GPU render farm for Blender, built for AI agents. Render Blender scenes on JANCTION GPUs from **Claude, ChatGPT,
19
+ Claude Code, Codex, Cursor or any MCP client**: an MCP server (remote and stdio) plus a CLI. Use it to render Blender
20
+ without a GPU, or when rendering locally is slow.
20
21
 
21
22
  - Input: a `.blend` file, or a **bpy Python script that builds the scene** (no local Blender needed).
22
23
  - `scene_info` reads the scene without rendering (cameras, frame range, missing files).
23
24
  - `render_preview` returns 1-4 low-cost frames tiled in one image within seconds, so the agent can look, fix, and repeat.
24
- - `render_final` renders the frames on GPUs and joins them into an MP4.
25
+ - `render_estimate` says how long a render will take ("about 3 minutes") and whether it fits today's free quota.
26
+ - `render_final` renders the frames on GPUs and joins them into an MP4; `render_status` reports the remaining time.
25
27
  - Free beta: no charges. Each key gets 10 GPU-minutes per day; a final render is up to 240 frames at 1080p.
26
28
  Paid plans (per GPU second, prepaid credit) will be announced on the service page before they start.
27
29
  - Inputs and results are deleted 24 hours after last use and are never used for training.
28
30
 
29
31
  ## Status
30
32
 
31
- Free beta. The public endpoint is `https://render.janction.jp` (`/v1/health`, `/llms.txt`). Quotas and limits are on the
32
- service page; paid plans will be announced there before they start.
33
+ Free beta. Service page: `https://render.janction.jp` (`/v1/health`, `/llms.txt`). Blender 5.0, Cycles on GPU.
33
34
 
34
- ## Install
35
+ ## Connect (remote MCP, nothing to install)
36
+
37
+ MCP server URL: **`https://render.janction.jp/mcp`** (Streamable HTTP). Auth is OAuth 2.1 with dynamic client
38
+ registration: pressing "Connect" opens a page that creates a free API key (or takes one you already have). A raw API key
39
+ also works as `Authorization: Bearer jr_...`.
40
+
41
+ | client | how |
42
+ |---|---|
43
+ | Claude.ai (web, desktop, mobile) | Settings → Connectors → Add custom connector → paste the URL → Connect |
44
+ | ChatGPT | Settings → Connectors → Advanced → Developer mode → Create → paste the URL (OAuth) |
45
+ | Claude Code | `claude mcp add --transport http janction-render https://render.janction.jp/mcp`, then `/mcp` to authenticate |
46
+ | Cursor, Windsurf, other MCP clients | Streamable HTTP at the URL above (OAuth, or a Bearer API key header) |
47
+
48
+ Remote tools take `scene_script` (bpy code as text), `scene_url` (an https link to a `.blend` or `.py`) or `scene_id`;
49
+ results come back as an inline image plus download links that need no key and work for about 24 hours.
50
+
51
+ Claude Code plugin (the remote connector plus a skill with the workflow):
52
+
53
+ ```
54
+ /plugin marketplace add KJdayo/janction-render
55
+ /plugin install janction-render@janction-render
56
+ ```
57
+
58
+ ## Install (stdio MCP, sends local files)
35
59
 
36
60
  The package is on PyPI as `janction-render`.
37
61
 
@@ -54,7 +78,8 @@ env = { JANCTION_RENDER_SERVER = "https://render.janction.jp" }
54
78
  ```
55
79
 
56
80
  A temporary API key is issued automatically on first use and cached in `~/.janction-render.json`; set
57
- `JANCTION_RENDER_API_KEY` to pin one (quota and, later, credit belong to the key).
81
+ `JANCTION_RENDER_API_KEY` to pin one (quota and, later, credit belong to the key). The same key can be used from the
82
+ remote connector: paste it on the connect page.
58
83
 
59
84
  Then, in Claude Code:
60
85
 
@@ -64,12 +89,13 @@ Then, in Claude Code:
64
89
 
65
90
  | tool | what |
66
91
  |---|---|
67
- | `scene_info(scene_path | scene_script | scene_id)` | cameras, frame range, fps, resolution, objects, lights, missing files. No render. |
92
+ | `scene_info(scene_script | scene_url | scene_path | scene_id)` | cameras, frame range, fps, resolution, objects, lights, missing files. No render. |
68
93
  | `render_preview(..., frames="1-24")` | up to 4 frames (720p budget) tiled with frame labels; returns the image inline |
94
+ | `render_estimate(scene_id, frame_start, frame_end, width, height, samples)` | GPU seconds, queue wait, "about N minutes", fits today's free quota? No GPU time used |
69
95
  | `render_final(scene_id, frame_start, frame_end, width, height, samples, fps, output)` | PNG or MP4; returns job_id + estimate |
70
- | `render_status(job_id)` / `render_download(job_id)` / `render_cancel(job_id)` | progress, files, cancel |
71
- | `billing(topup_yen=0)` | free-beta quota (used today, daily limit, reset time); later balance and top-up link |
72
- | `render_info()` | server, workers online, queue |
96
+ | `render_status(job_id)` | progress and ETA (`eta.human`); `render_download(job_id)` files or links; `render_cancel(job_id)` |
97
+ | `billing()` | free-beta quota (used today, daily limit, reset time); later balance and top-up link |
98
+ | `render_info()` | workers online, queue and expected wait |
73
99
 
74
100
  CLI: `janction-render inspect|preview|render|status|download|cancel|jobs|balance|topup|info`.
75
101
 
@@ -97,11 +123,14 @@ Scripts run in an isolated container with no network. See `samples/cube_scene.py
97
123
  ```
98
124
  POST /v1/keys -> {api_key} (header X-API-Key afterwards)
99
125
  POST /v1/files multipart "file" (.blend|.py) -> {scene_id}
126
+ POST /v1/estimate {kind, frames|frame_start/frame_end, width, height, samples, scene_id?} -> seconds, wall_seconds, human, quota
100
127
  POST /v1/jobs {scene_id, kind: info|preview|final, frames|frame_start/frame_end, width, height, samples, camera, fps, output}
101
- GET /v1/jobs/{id} status, progress, artifacts[], cost, warnings, info DELETE /v1/jobs/{id} cancel
128
+ GET /v1/jobs/{id} status, progress, eta, artifacts[], cost, warnings, info DELETE /v1/jobs/{id} cancel
102
129
  GET /v1/jobs/{id}/artifacts/{name} PNG / MP4
130
+ POST /mcp remote MCP (Streamable HTTP; Bearer api key or OAuth)
131
+ GET /.well-known/oauth-protected-resource/mcp OAuth discovery
103
132
  POST /v1/billing/checkout {amount_yen} -> {checkout_url} POST /v1/billing/sync GET /v1/ledger GET /v1/me
104
- GET /llms.txt /terms /privacy /tokushoho
133
+ GET /llms.txt /terms /privacy /legal /security
105
134
  ```
106
135
 
107
136
  During the free beta a `429 quota_exceeded` response carries `resets_at`; a `400 beta_limit` means the job is too big
@@ -109,13 +138,13 @@ During the free beta a `429 quota_exceeded` response carries `resets_at`; a `400
109
138
 
110
139
  ## Self-hosting
111
140
 
112
- The server (FastAPI + SQLite) and the worker (Blender in disposable Docker containers, `--network none --cap-drop ALL`)
113
- live in the internal repository and are not part of this package yet. This repository holds the client side: MCP server, CLI,
114
- HTTP client and samples.
141
+ The server (FastAPI + SQLite, with the remote MCP endpoint) and the worker (Blender in disposable Docker containers,
142
+ `--network none --cap-drop ALL`) live in the internal repository and are not part of this package yet. This repository
143
+ holds the client side: stdio MCP server, CLI, HTTP client, samples and the Claude Code plugin.
115
144
 
116
145
  ## MCP registry
117
146
 
118
- This package is listed in the official MCP registry as `io.github.KJdayo/janction-render`.
147
+ This server is listed in the official MCP registry as `io.github.KJdayo/janction-render` (remote: `https://render.janction.jp/mcp`).
119
148
 
120
149
  mcp-name: io.github.KJdayo/janction-render
121
150
 
@@ -2,6 +2,7 @@ LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
4
  janction_render/__init__.py
5
+ janction_render/brief.py
5
6
  janction_render/cli.py
6
7
  janction_render/client.py
7
8
  janction_render/mcp_server.py
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "janction-render"
7
- version = "0.1.1"
8
- description = "Render Blender scenes on JANCTION GPUs straight from terminal AI agents (Claude Code, Codex): MCP server + CLI"
7
+ version = "0.2.0"
8
+ description = "Cloud GPU render farm for Blender, for AI agents: MCP server (remote + stdio) and CLI. Render Blender without a GPU from Claude, ChatGPT, Claude Code, Codex, Cursor."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
11
11
  dependencies = ["requests>=2.31", "mcp>=1.10"]
File without changes