webcomic-toolkit 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1 @@
1
+ """webcomic-toolkit: every MCP server in the toolkit, in one install."""
@@ -0,0 +1,149 @@
1
+ """
2
+ webcomic-toolkit -- install every server in the toolkit at once, then register
3
+ them with an AI client.
4
+
5
+ `pip install webcomic-toolkit` pulls in the seven server packages as ordinary
6
+ dependencies; this module is only the command that wires them up afterward,
7
+ because installing an MCP server never registers it with a client by itself.
8
+
9
+ webcomic-toolkit list what is installed, and the command each runs
10
+ webcomic-toolkit setup register them all with Claude Code (claude mcp add)
11
+ webcomic-toolkit setup --dry-run print the claude commands instead of running them
12
+ webcomic-toolkit setup --only speech-bubble,music-generation
13
+ webcomic-toolkit json an "mcpServers" block for clients configured by
14
+ JSON (Claude Desktop, Cursor, and others)
15
+
16
+ setup never overwrites: a name Claude Code already has is left alone and
17
+ reported, so running it twice is harmless.
18
+ """
19
+
20
+ from __future__ import annotations
21
+
22
+ import argparse
23
+ import json
24
+ import os
25
+ import shutil
26
+ import subprocess
27
+ import sys
28
+ import sysconfig
29
+
30
+ # name to register under, PyPI package, the command that package installs, and
31
+ # what it needs beyond Python. The four GPU servers drive a local ComfyUI; the
32
+ # package can't install that or its models, so setup says so.
33
+ SERVERS = [
34
+ ("speech-bubble", "speech-bubble-mcp", "ffmpeg for video (optional)"),
35
+ ("novel-translation", "novel-translation-mcp", ""),
36
+ ("visual-novel", "visual-novel-mcp", "Ren'Py for the games it builds"),
37
+ ("character-panel", "character-panel-mcp", "ComfyUI and the models in its README"),
38
+ ("webcomic-background", "webcomic-background-mcp", "ComfyUI and the models in its README"),
39
+ ("anime-production", "anime-production-mcp", "ComfyUI and the models in its README"),
40
+ ("music-generation", "music-generation-mcp", "ComfyUI and the models in its README"),
41
+ ]
42
+
43
+
44
+ def _exe(name: str) -> str:
45
+ return name + (".exe" if os.name == "nt" else "")
46
+
47
+
48
+ def command_for(dist: str) -> list[str] | None:
49
+ """The command that starts one server: the script installed next to this
50
+ one first (same environment), then anything on PATH, then uvx, which
51
+ fetches the package on demand."""
52
+ local = os.path.join(sysconfig.get_path("scripts"), _exe(dist))
53
+ if os.path.isfile(local):
54
+ return [local]
55
+ found = shutil.which(dist)
56
+ if found:
57
+ return [found]
58
+ if shutil.which("uvx"):
59
+ return ["uvx", dist]
60
+ return None
61
+
62
+
63
+ def _pick(only: str | None) -> list[tuple[str, str, str]]:
64
+ if not only:
65
+ return SERVERS
66
+ want = {w.strip() for w in only.split(",") if w.strip()}
67
+ unknown = want - {s[0] for s in SERVERS}
68
+ if unknown:
69
+ sys.exit(f"Unknown server(s): {', '.join(sorted(unknown))}. "
70
+ f"Choose from: {', '.join(s[0] for s in SERVERS)}")
71
+ return [s for s in SERVERS if s[0] in want]
72
+
73
+
74
+ def cmd_list(args) -> int:
75
+ for name, dist, needs in SERVERS:
76
+ cmd = command_for(dist)
77
+ state = " ".join(cmd) if cmd else "NOT INSTALLED"
78
+ print(f"{name:20} {state}")
79
+ if needs:
80
+ print(f"{'':20} needs: {needs}")
81
+ return 0
82
+
83
+
84
+ def cmd_json(args) -> int:
85
+ block = {}
86
+ for name, dist, _ in _pick(args.only):
87
+ cmd = command_for(dist)
88
+ if cmd:
89
+ block[name] = {"command": cmd[0], "args": cmd[1:]}
90
+ print(json.dumps({"mcpServers": block}, indent=2))
91
+ return 0
92
+
93
+
94
+ def cmd_setup(args) -> int:
95
+ chosen = _pick(args.only)
96
+ claude = shutil.which("claude")
97
+ if not claude and not args.dry_run:
98
+ print("The Claude Code command line (`claude`) isn't on PATH, so nothing was registered.\n"
99
+ "Install Claude Code, or use `webcomic-toolkit json` to configure another client.")
100
+ return 1
101
+ added, skipped, missing = [], [], []
102
+ for name, dist, needs in chosen:
103
+ cmd = command_for(dist)
104
+ if not cmd:
105
+ missing.append(name)
106
+ continue
107
+ if claude and not args.dry_run:
108
+ have = subprocess.run([claude, "mcp", "get", name], capture_output=True, text=True)
109
+ if have.returncode == 0:
110
+ skipped.append(name)
111
+ continue
112
+ line = ["claude", "mcp", "add", "-s", args.scope, name, "--", *cmd]
113
+ if args.dry_run:
114
+ print(subprocess.list2cmdline(line))
115
+ continue
116
+ r = subprocess.run([claude, *line[1:]], capture_output=True, text=True)
117
+ if r.returncode == 0:
118
+ added.append((name, needs))
119
+ else:
120
+ print(f"{name}: claude mcp add failed:\n{(r.stderr or r.stdout).strip()}")
121
+ for name, needs in added:
122
+ print(f"added {name}" + (f" (needs {needs})" if needs else ""))
123
+ for name in skipped:
124
+ print(f"skipped {name} (Claude Code already has a server by this name)")
125
+ for name in missing:
126
+ print(f"missing {name} (not installed; pip install webcomic-toolkit, or install uv)")
127
+ if added and not args.dry_run:
128
+ print("\nRestart Claude Code to load them. Servers that drive ComfyUI need it running.")
129
+ return 0
130
+
131
+
132
+ def main() -> None:
133
+ p = argparse.ArgumentParser(prog="webcomic-toolkit",
134
+ description="Install and register the webcomic toolkit's MCP servers.")
135
+ sub = p.add_subparsers(dest="cmd", required=True)
136
+ sub.add_parser("list", help="what is installed, and the command each server runs")
137
+ s = sub.add_parser("setup", help="register the servers with Claude Code")
138
+ s.add_argument("--scope", default="user", choices=["user", "project", "local"],
139
+ help="Claude Code scope (default: user, i.e. every project)")
140
+ s.add_argument("--only", help="comma-separated names, e.g. speech-bubble,music-generation")
141
+ s.add_argument("--dry-run", action="store_true", help="print the commands instead of running them")
142
+ j = sub.add_parser("json", help='print an "mcpServers" block for JSON-configured clients')
143
+ j.add_argument("--only", help="comma-separated names")
144
+ args = p.parse_args()
145
+ sys.exit({"list": cmd_list, "setup": cmd_setup, "json": cmd_json}[args.cmd](args))
146
+
147
+
148
+ if __name__ == "__main__":
149
+ main()
@@ -0,0 +1,74 @@
1
+ Metadata-Version: 2.4
2
+ Name: webcomic-toolkit
3
+ Version: 0.1.0
4
+ Summary: Every MCP server in the webcomic toolkit in one install, plus a command that registers them with your AI client.
5
+ Author: Tobias Fong
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://tobiasfong.github.io/
8
+ Project-URL: Repository, https://github.com/tobiasfong/webcomic-toolkit
9
+ Keywords: mcp,webcomic,manga,comics,visual-novel,anime
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: speech-bubble-mcp>=0.2.0
13
+ Requires-Dist: novel-translation-mcp>=0.1.0
14
+ Requires-Dist: visual-novel-mcp>=0.1.0
15
+ Requires-Dist: character-panel-mcp>=2.3.0
16
+ Requires-Dist: webcomic-background-mcp>=3.1.0
17
+ Requires-Dist: anime-production-mcp>=3.6.0
18
+ Requires-Dist: music-generation-mcp>=0.4.0
19
+
20
+ # webcomic-toolkit
21
+
22
+ Every MCP server in the [webcomic toolkit](https://github.com/tobiasfong/webcomic-toolkit),
23
+ in one install: backgrounds, consistent characters and panels, animation,
24
+ music, lettering, novel translation and visual novels, all driven from a single
25
+ AI client and running on your own machine.
26
+
27
+ ```bash
28
+ pip install webcomic-toolkit
29
+ webcomic-toolkit setup
30
+ ```
31
+
32
+ The first line installs the seven servers. The second registers them with
33
+ Claude Code, because installing an MCP server never registers it with a client
34
+ by itself. Restart Claude Code afterward.
35
+
36
+ | server | what it does | needs beyond Python |
37
+ |---|---|---|
38
+ | `speech-bubble` | speech bubbles, thought balloons and captions on stills or video | ffmpeg, for video only |
39
+ | `novel-translation` | chapter-by-chapter EN⇄JA novel translation | |
40
+ | `visual-novel` | branching visual novels in Ren'Py | Ren'Py |
41
+ | `character-panel` | characters that stay on-model, poses and panels | ComfyUI and models |
42
+ | `webcomic-background` | comic backgrounds in any style | ComfyUI and models |
43
+ | `anime-production` | animated shots and music videos | ComfyUI and models |
44
+ | `music-generation` | theme songs and background music | ComfyUI and models |
45
+
46
+ The four GPU servers drive a local ComfyUI. A Python package can't install
47
+ ComfyUI or the model weights, so each server's README walks through that part.
48
+
49
+ ## Commands
50
+
51
+ ```bash
52
+ webcomic-toolkit list # what is installed, and the command each server runs
53
+ webcomic-toolkit setup # register them all with Claude Code
54
+ webcomic-toolkit setup --dry-run # print the claude commands instead of running them
55
+ webcomic-toolkit setup --only speech-bubble,music-generation
56
+ webcomic-toolkit json # an "mcpServers" block for Claude Desktop, Cursor and
57
+ # other clients configured by JSON
58
+ ```
59
+
60
+ `setup` never overwrites a server Claude Code already has under the same name,
61
+ so running it twice is harmless.
62
+
63
+ ## Just one server
64
+
65
+ Each server is also its own package, with its own version:
66
+
67
+ ```bash
68
+ pip install speech-bubble-mcp
69
+ ```
70
+
71
+ or, with [uv](https://docs.astral.sh/uv/), nothing to install at all:
72
+ `claude mcp add -s user speech-bubble -- uvx speech-bubble-mcp`.
73
+
74
+ MIT licensed. Made by Tobias Fong: https://tobiasfong.github.io/
@@ -0,0 +1,7 @@
1
+ webcomic_toolkit/__init__.py,sha256=zBCe_FcT91_rK9-2bZbDw_Ria2aMOkVtRmxnly_zf-U,73
2
+ webcomic_toolkit/cli.py,sha256=r2JarS2bAkjmIBIKQbC4__cFIyreYakioLUEB7xgemo,6179
3
+ webcomic_toolkit-0.1.0.dist-info/METADATA,sha256=GDG-Qz27c3pFL3mU1YSOHxUgyoQzQumZ0Ul-iTK2hzQ,3068
4
+ webcomic_toolkit-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
5
+ webcomic_toolkit-0.1.0.dist-info/entry_points.txt,sha256=o1R25ySpQb52wUP3OCEiNxCtUqPD0uAhQYFPNiAFIGs,63
6
+ webcomic_toolkit-0.1.0.dist-info/top_level.txt,sha256=o82HjZk6JgBjRb_z8kIMbjoPa5k1djIShhFmNeAp3rA,17
7
+ webcomic_toolkit-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ webcomic-toolkit = webcomic_toolkit.cli:main
@@ -0,0 +1 @@
1
+ webcomic_toolkit