thrixel-mcp 0.1.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.
- thrixel_mcp-0.1.0/.env.example +11 -0
- thrixel_mcp-0.1.0/.gitignore +51 -0
- thrixel_mcp-0.1.0/LICENSE +21 -0
- thrixel_mcp-0.1.0/PKG-INFO +288 -0
- thrixel_mcp-0.1.0/README.md +258 -0
- thrixel_mcp-0.1.0/environment.yml +8 -0
- thrixel_mcp-0.1.0/pyproject.toml +54 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/__init__.py +3 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/app.py +76 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/client.py +139 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/config.py +78 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/errors.py +144 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/files.py +119 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/jobs.py +341 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/server.py +38 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/tools/__init__.py +13 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/tools/account.py +76 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/tools/create.py +150 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/tools/detail.py +237 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/tools/download.py +110 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/tools/inspect.py +156 -0
- thrixel_mcp-0.1.0/src/thrixel_mcp/tools/refine.py +113 -0
- thrixel_mcp-0.1.0/tests/smoke_local.py +69 -0
- thrixel_mcp-0.1.0/tests/test_errors.py +87 -0
- thrixel_mcp-0.1.0/tests/test_files.py +116 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Copy to .env for local development. Never commit the real file.
|
|
2
|
+
THRIXEL_API_KEY=sk-thrixel-replace-me
|
|
3
|
+
|
|
4
|
+
# Production is the default; point at a local backend while developing.
|
|
5
|
+
# THRIXEL_API_BASE=http://localhost:8000
|
|
6
|
+
|
|
7
|
+
# Where generated models are written. Relative to the client's working directory.
|
|
8
|
+
# THRIXEL_OUTPUT_DIR=./thrixel_assets
|
|
9
|
+
|
|
10
|
+
# Ceiling in seconds for a single submit-and-wait cycle.
|
|
11
|
+
# THRIXEL_TIMEOUT_S=600
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
|
|
8
|
+
# Packaging / build — release artifacts are built on demand, never committed
|
|
9
|
+
build/
|
|
10
|
+
dist/
|
|
11
|
+
*.egg-info/
|
|
12
|
+
*.egg
|
|
13
|
+
pip-wheel-metadata/
|
|
14
|
+
uv.lock
|
|
15
|
+
|
|
16
|
+
# Environments — conda env lives outside the repo (see environment.yml)
|
|
17
|
+
.venv/
|
|
18
|
+
venv/
|
|
19
|
+
env/
|
|
20
|
+
.conda/
|
|
21
|
+
.python-version
|
|
22
|
+
|
|
23
|
+
# Test / lint caches
|
|
24
|
+
.pytest_cache/
|
|
25
|
+
.mypy_cache/
|
|
26
|
+
.ruff_cache/
|
|
27
|
+
.tox/
|
|
28
|
+
.nox/
|
|
29
|
+
.coverage
|
|
30
|
+
.coverage.*
|
|
31
|
+
htmlcov/
|
|
32
|
+
coverage.xml
|
|
33
|
+
|
|
34
|
+
# Editors / tooling
|
|
35
|
+
.vscode/
|
|
36
|
+
.idea/
|
|
37
|
+
*.swp
|
|
38
|
+
*.swo
|
|
39
|
+
.claude/
|
|
40
|
+
|
|
41
|
+
# OS
|
|
42
|
+
.DS_Store
|
|
43
|
+
Thumbs.db
|
|
44
|
+
|
|
45
|
+
# Secrets — THRIXEL_API_KEY must never be committed
|
|
46
|
+
.env
|
|
47
|
+
.env.*
|
|
48
|
+
!.env.example
|
|
49
|
+
|
|
50
|
+
# Generated assets land here by default
|
|
51
|
+
thrixel_assets/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Thrixel
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: thrixel-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Thrixel — text/image to editable, game-ready 3D assets.
|
|
5
|
+
Project-URL: Homepage, https://thrixel.com
|
|
6
|
+
Project-URL: Documentation, https://docs.thrixel.com
|
|
7
|
+
Project-URL: Repository, https://github.com/thrixel/thrixel_mcp
|
|
8
|
+
Author-email: Thrixel <support@thrixel.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: 3d,gamedev,glb,mcp,model-context-protocol,thrixel
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Requires-Dist: httpx>=0.27
|
|
22
|
+
Requires-Dist: mcp>=1.23.0
|
|
23
|
+
Requires-Dist: pillow>=10.0
|
|
24
|
+
Requires-Dist: pydantic>=2.7
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: respx>=0.21; extra == 'dev'
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# Thrixel MCP Server
|
|
32
|
+
|
|
33
|
+
[Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for the [Thrixel](https://thrixel.com) 3D generation platform. Enables AI agents to create, edit, detail, and download game-ready 3D models through natural conversation — and to *see* each result before building on it.
|
|
34
|
+
|
|
35
|
+
<!-- TODO(screenshot): hero demo GIF — agent prompted for a game prop, tool call runs,
|
|
36
|
+
GLB lands in the project, thumbnail comes back inline. Save as docs/demo.gif -->
|
|
37
|
+
> **TODO** — demo GIF goes here (`docs/demo.gif`).
|
|
38
|
+
|
|
39
|
+
## Features
|
|
40
|
+
|
|
41
|
+
12 tools covering the Thrixel generation pipeline:
|
|
42
|
+
|
|
43
|
+
| Category | Tools |
|
|
44
|
+
|----------|-------|
|
|
45
|
+
| **Create** | `thrixel_create_model`, `thrixel_sculpt_model` |
|
|
46
|
+
| **Refine** | `thrixel_edit_model`, `thrixel_autofix_model` |
|
|
47
|
+
| **Detail & Texture** | `thrixel_detail_model`, `thrixel_retexture_model` |
|
|
48
|
+
| **Optimize** | `thrixel_reduce_triangles` |
|
|
49
|
+
| **Inspect** | `thrixel_inspect_model`, `thrixel_list_assets` |
|
|
50
|
+
| **Jobs & Download** | `thrixel_job_status`, `thrixel_download` |
|
|
51
|
+
| **Account** | `thrixel_account_status` |
|
|
52
|
+
|
|
53
|
+
### Key Capabilities
|
|
54
|
+
|
|
55
|
+
- **Text to 3D**: `create_model` returns an *editable, multi-part* mesh — parts stay separate and named, so you can retexture or transform individual pieces later. The default for props, vehicles, buildings, weapons, furniture.
|
|
56
|
+
- **Image to 3D**: `sculpt_model` turns a photo or a description into a dense single organic mesh — creatures, characters, plants, food.
|
|
57
|
+
- **Natural-language editing**: `edit_model` changes one thing and leaves the rest alone, optionally scoped to named parts. Iterating beats regenerating.
|
|
58
|
+
- **Detail & retexture**: `detail_model` adds high-resolution geometry and PBR texture; `retexture_model` swaps materials without touching geometry — the cheap way to restyle a whole asset set.
|
|
59
|
+
- **Free triangle reduction**: `reduce_triangles` hits a game budget for zero cubes and routes to the right backend operation automatically. Never re-run a detail pass just to get a lighter mesh.
|
|
60
|
+
- **Visual feedback loop**: every finished job returns a rendered thumbnail as image content, so the agent can judge the result and retry rather than carrying a broken asset forward.
|
|
61
|
+
- **Waits for you**: job tools block until the model is finished and write the GLB straight into your project. One tool call equals one finished asset — no agent-authored polling loop to silently give up halfway.
|
|
62
|
+
- **Style consistency**: reuse one `reference_image_id` across many assets, or pass `style_reference_submission_id`, to keep a set looking like a set. Reusing a reference image is not re-charged.
|
|
63
|
+
|
|
64
|
+
## Prerequisites
|
|
65
|
+
|
|
66
|
+
- [uv](https://github.com/astral-sh/uv) — one binary, no Python setup needed:
|
|
67
|
+
```bash
|
|
68
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh # macOS / Linux
|
|
69
|
+
powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows
|
|
70
|
+
```
|
|
71
|
+
- A Thrixel API key ([get one here](https://thrixel.com/beta) — Account → API keys)
|
|
72
|
+
|
|
73
|
+
`uvx` fetches the server and a suitable Python into a throwaway environment on
|
|
74
|
+
first run. You do not need to clone anything, create a virtualenv, or install
|
|
75
|
+
Python yourself.
|
|
76
|
+
|
|
77
|
+
## Installation
|
|
78
|
+
|
|
79
|
+
### Option 1 · Claude Code · Recommended
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
claude mcp add-json thrixel '{"command":"uvx","args":["thrixel-mcp"],"env":{"THRIXEL_API_KEY":"sk-thrixel-YOUR_API_KEY"}}'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Option 2 · Install by Asking Your AI Agent
|
|
86
|
+
|
|
87
|
+
Already chatting with Cursor / Claude Code / Codex? Paste this prompt:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
Install the Thrixel MCP server for me. Docs: https://github.com/thrixel/thrixel_mcp
|
|
91
|
+
Run it with: uvx thrixel-mcp
|
|
92
|
+
Use this env var: THRIXEL_API_KEY=sk-thrixel-YOUR_API_KEY
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Option 3 · Manual Install
|
|
96
|
+
|
|
97
|
+
<details>
|
|
98
|
+
<summary><b>Cursor</b></summary>
|
|
99
|
+
|
|
100
|
+
Paste into `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global):
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"mcpServers": {
|
|
105
|
+
"thrixel": {
|
|
106
|
+
"command": "uvx",
|
|
107
|
+
"args": ["thrixel-mcp"],
|
|
108
|
+
"env": { "THRIXEL_API_KEY": "sk-thrixel-YOUR_API_KEY" }
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
> **Windows**: if `uvx` is not on `PATH` for GUI apps, use the absolute path, e.g. `"command": "C:\\Users\\you\\.local\\bin\\uvx.exe"`.
|
|
115
|
+
|
|
116
|
+
</details>
|
|
117
|
+
|
|
118
|
+
<details>
|
|
119
|
+
<summary><b>Claude Desktop</b></summary>
|
|
120
|
+
|
|
121
|
+
Add to `claude_desktop_config.json`:
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"mcpServers": {
|
|
126
|
+
"thrixel": {
|
|
127
|
+
"command": "uvx",
|
|
128
|
+
"args": ["thrixel-mcp"],
|
|
129
|
+
"env": { "THRIXEL_API_KEY": "sk-thrixel-YOUR_API_KEY" }
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
</details>
|
|
136
|
+
|
|
137
|
+
<details>
|
|
138
|
+
<summary><b>Codex / VS Code / Windsurf</b></summary>
|
|
139
|
+
|
|
140
|
+
Same shape as above — `command: "uvx"`, `args: ["thrixel-mcp"]`, and
|
|
141
|
+
`THRIXEL_API_KEY` in the `env` block.
|
|
142
|
+
|
|
143
|
+
</details>
|
|
144
|
+
|
|
145
|
+
<details>
|
|
146
|
+
<summary><b>Without uv (pip fallback)</b></summary>
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
pip install thrixel-mcp
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Then point the client at your interpreter:
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"mcpServers": {
|
|
157
|
+
"thrixel": {
|
|
158
|
+
"command": "python",
|
|
159
|
+
"args": ["-m", "thrixel_mcp.server"],
|
|
160
|
+
"env": { "THRIXEL_API_KEY": "sk-thrixel-YOUR_API_KEY" }
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Use an absolute path to `python` if the client cannot find it on `PATH`.
|
|
167
|
+
|
|
168
|
+
</details>
|
|
169
|
+
|
|
170
|
+
<details>
|
|
171
|
+
<summary><b>Pre-release / unpublished builds</b></summary>
|
|
172
|
+
|
|
173
|
+
`uvx` can run straight from the repository, no PyPI release needed:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# latest main — SSH, works while the repo is private (needs repo access)
|
|
177
|
+
uvx --from git+ssh://git@github.com/thrixel/thrixel_mcp thrixel-mcp
|
|
178
|
+
|
|
179
|
+
# a local checkout
|
|
180
|
+
uvx --from /path/to/thrixel_mcp thrixel-mcp
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Same shape in a client config — replace `args` with
|
|
184
|
+
`["--from", "git+ssh://git@github.com/thrixel/thrixel_mcp", "thrixel-mcp"]`.
|
|
185
|
+
|
|
186
|
+
> The `git+https://` form only works once the repository is public; until then
|
|
187
|
+
> `uvx` cannot authenticate and fails with `could not read Username`.
|
|
188
|
+
|
|
189
|
+
</details>
|
|
190
|
+
|
|
191
|
+
## Activate After Install
|
|
192
|
+
|
|
193
|
+
Most clients auto-load the new server, but **Cursor and VS Code require a manual toggle**:
|
|
194
|
+
|
|
195
|
+
| Client | What to do | Verify |
|
|
196
|
+
|---|---|---|
|
|
197
|
+
| **Claude Code** | Nothing — auto-loads on next message | `/mcp` shows `thrixel ✓ connected` |
|
|
198
|
+
| **Cursor** | Restart → `Settings` → `MCP & Integrations` → toggle `thrixel` **on** → wait for green dot ● → open a **new chat** | `List the thrixel tools available` |
|
|
199
|
+
| **Claude Desktop** | Quit & relaunch the app | `List the thrixel tools available` |
|
|
200
|
+
| **VS Code** | Run command `MCP: List Servers` → click `thrixel` → **Start** | `List the thrixel tools available` |
|
|
201
|
+
| **Codex** | Nothing — auto-loads on next session | `List the thrixel tools available` |
|
|
202
|
+
|
|
203
|
+
<!-- TODO(screenshot): connected-state screenshot (Cursor green dot / `/mcp` output).
|
|
204
|
+
Save as docs/connected.png -->
|
|
205
|
+
> **TODO** — connected-state screenshot goes here (`docs/connected.png`).
|
|
206
|
+
|
|
207
|
+
## Usage
|
|
208
|
+
|
|
209
|
+
Once connected, just ask:
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
Make me a low-poly wooden market stall for a game, under 5000 triangles.
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
The agent will chain `thrixel_create_model` → `thrixel_detail_model` → `thrixel_reduce_triangles`, save the GLB into `./thrixel_assets/`, and show you the render at each step.
|
|
216
|
+
|
|
217
|
+
<!-- TODO(screenshot): before/after — Architect blockout vs detailed result.
|
|
218
|
+
Save as docs/pipeline.png -->
|
|
219
|
+
> **TODO** — pipeline before/after image goes here (`docs/pipeline.png`).
|
|
220
|
+
|
|
221
|
+
## Troubleshooting
|
|
222
|
+
|
|
223
|
+
- **`spawn uvx ENOENT`** — the client cannot find `uvx` on `PATH`. Use the absolute path (`which uvx`, or `%USERPROFILE%\.local\bin\uvx.exe` on Windows).
|
|
224
|
+
- **`THRIXEL_API_KEY is not set`** — the key didn't reach the server. Make sure it sits inside an `"env": {...}` block in your MCP config, not in `args`.
|
|
225
|
+
- **Tool calls return "Thrixel rejected the API key"** — the key is invalid or revoked. Regenerate at https://thrixel.com/beta (Account → API keys).
|
|
226
|
+
- **First call is slow** — `uvx` is resolving and caching the package. Subsequent starts are fast.
|
|
227
|
+
- **"You have N jobs already running"** — you hit the per-plan concurrency cap (free 2, pro 5, studio 10). Run large batches in waves; `thrixel_account_status` shows what's in flight.
|
|
228
|
+
- **"Out of cubes"** — detail, sculpt and texture cost 40 cubes each. `thrixel_reduce_triangles` and rebakes are free.
|
|
229
|
+
- **Jobs time out** — GPU work can queue behind other jobs. Raise `THRIXEL_TIMEOUT_S`, or submit with `wait=false` and poll via `thrixel_job_status`.
|
|
230
|
+
- **Client doesn't list `thrixel`** — make sure the config file is valid JSON (no trailing commas), then fully restart the client.
|
|
231
|
+
- **Stuck on an old version** — `uvx` caches builds. Force a refresh with `uvx --refresh thrixel-mcp`.
|
|
232
|
+
|
|
233
|
+
## Configuration
|
|
234
|
+
|
|
235
|
+
| Environment Variable | Description | Default |
|
|
236
|
+
|---------------------|-------------|---------|
|
|
237
|
+
| `THRIXEL_API_KEY` | **Required.** Your Thrixel API key (starts with `sk-thrixel-`) | — |
|
|
238
|
+
| `THRIXEL_API_BASE` | API base URL | `https://api.thrixel.com` |
|
|
239
|
+
| `THRIXEL_OUTPUT_DIR` | Where generated models are written. Writes outside it are refused | `./thrixel_assets` |
|
|
240
|
+
| `THRIXEL_TIMEOUT_S` | Ceiling in seconds for a single submit-and-wait cycle | `600` |
|
|
241
|
+
| `THRIXEL_LOG_LEVEL` | Server log level, written to stderr | `INFO` |
|
|
242
|
+
|
|
243
|
+
## Development
|
|
244
|
+
|
|
245
|
+
End users need only `uvx`; contributors want a real environment. Either works:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
git clone https://github.com/thrixel/thrixel_mcp.git
|
|
249
|
+
cd thrixel_mcp
|
|
250
|
+
|
|
251
|
+
# uv
|
|
252
|
+
uv sync --extra dev
|
|
253
|
+
|
|
254
|
+
# or conda
|
|
255
|
+
conda env create -f environment.yml
|
|
256
|
+
conda activate thrixel-mcp
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Unit tests — no backend required
|
|
261
|
+
pytest
|
|
262
|
+
|
|
263
|
+
# End-to-end against a local backend
|
|
264
|
+
export THRIXEL_API_BASE=http://localhost:8000
|
|
265
|
+
export THRIXEL_API_KEY=sk-thrixel-...
|
|
266
|
+
|
|
267
|
+
python tests/smoke_local.py # list registered tools
|
|
268
|
+
python tests/smoke_local.py thrixel_account_status
|
|
269
|
+
python tests/smoke_local.py thrixel_create_model '{"prompt":"a rusted oil drum"}'
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Run the packaged entry point exactly as a user would:
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
uvx --from . thrixel-mcp
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
This server holds no state and no business logic — it is a client of the public Thrixel API. Anything it can do, a direct API caller can do too.
|
|
279
|
+
|
|
280
|
+
## HTTP Transport
|
|
281
|
+
|
|
282
|
+
<!-- TODO(phase-2): remote Streamable HTTP transport + OAuth 2.1, mounted into the
|
|
283
|
+
existing FastAPI service. Not implemented yet. -->
|
|
284
|
+
> **TODO** — remote HTTP transport is planned but not implemented. `stdio` only for now.
|
|
285
|
+
|
|
286
|
+
## License
|
|
287
|
+
|
|
288
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# Thrixel MCP Server
|
|
2
|
+
|
|
3
|
+
[Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for the [Thrixel](https://thrixel.com) 3D generation platform. Enables AI agents to create, edit, detail, and download game-ready 3D models through natural conversation — and to *see* each result before building on it.
|
|
4
|
+
|
|
5
|
+
<!-- TODO(screenshot): hero demo GIF — agent prompted for a game prop, tool call runs,
|
|
6
|
+
GLB lands in the project, thumbnail comes back inline. Save as docs/demo.gif -->
|
|
7
|
+
> **TODO** — demo GIF goes here (`docs/demo.gif`).
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
12 tools covering the Thrixel generation pipeline:
|
|
12
|
+
|
|
13
|
+
| Category | Tools |
|
|
14
|
+
|----------|-------|
|
|
15
|
+
| **Create** | `thrixel_create_model`, `thrixel_sculpt_model` |
|
|
16
|
+
| **Refine** | `thrixel_edit_model`, `thrixel_autofix_model` |
|
|
17
|
+
| **Detail & Texture** | `thrixel_detail_model`, `thrixel_retexture_model` |
|
|
18
|
+
| **Optimize** | `thrixel_reduce_triangles` |
|
|
19
|
+
| **Inspect** | `thrixel_inspect_model`, `thrixel_list_assets` |
|
|
20
|
+
| **Jobs & Download** | `thrixel_job_status`, `thrixel_download` |
|
|
21
|
+
| **Account** | `thrixel_account_status` |
|
|
22
|
+
|
|
23
|
+
### Key Capabilities
|
|
24
|
+
|
|
25
|
+
- **Text to 3D**: `create_model` returns an *editable, multi-part* mesh — parts stay separate and named, so you can retexture or transform individual pieces later. The default for props, vehicles, buildings, weapons, furniture.
|
|
26
|
+
- **Image to 3D**: `sculpt_model` turns a photo or a description into a dense single organic mesh — creatures, characters, plants, food.
|
|
27
|
+
- **Natural-language editing**: `edit_model` changes one thing and leaves the rest alone, optionally scoped to named parts. Iterating beats regenerating.
|
|
28
|
+
- **Detail & retexture**: `detail_model` adds high-resolution geometry and PBR texture; `retexture_model` swaps materials without touching geometry — the cheap way to restyle a whole asset set.
|
|
29
|
+
- **Free triangle reduction**: `reduce_triangles` hits a game budget for zero cubes and routes to the right backend operation automatically. Never re-run a detail pass just to get a lighter mesh.
|
|
30
|
+
- **Visual feedback loop**: every finished job returns a rendered thumbnail as image content, so the agent can judge the result and retry rather than carrying a broken asset forward.
|
|
31
|
+
- **Waits for you**: job tools block until the model is finished and write the GLB straight into your project. One tool call equals one finished asset — no agent-authored polling loop to silently give up halfway.
|
|
32
|
+
- **Style consistency**: reuse one `reference_image_id` across many assets, or pass `style_reference_submission_id`, to keep a set looking like a set. Reusing a reference image is not re-charged.
|
|
33
|
+
|
|
34
|
+
## Prerequisites
|
|
35
|
+
|
|
36
|
+
- [uv](https://github.com/astral-sh/uv) — one binary, no Python setup needed:
|
|
37
|
+
```bash
|
|
38
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh # macOS / Linux
|
|
39
|
+
powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows
|
|
40
|
+
```
|
|
41
|
+
- A Thrixel API key ([get one here](https://thrixel.com/beta) — Account → API keys)
|
|
42
|
+
|
|
43
|
+
`uvx` fetches the server and a suitable Python into a throwaway environment on
|
|
44
|
+
first run. You do not need to clone anything, create a virtualenv, or install
|
|
45
|
+
Python yourself.
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
### Option 1 · Claude Code · Recommended
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
claude mcp add-json thrixel '{"command":"uvx","args":["thrixel-mcp"],"env":{"THRIXEL_API_KEY":"sk-thrixel-YOUR_API_KEY"}}'
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Option 2 · Install by Asking Your AI Agent
|
|
56
|
+
|
|
57
|
+
Already chatting with Cursor / Claude Code / Codex? Paste this prompt:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
Install the Thrixel MCP server for me. Docs: https://github.com/thrixel/thrixel_mcp
|
|
61
|
+
Run it with: uvx thrixel-mcp
|
|
62
|
+
Use this env var: THRIXEL_API_KEY=sk-thrixel-YOUR_API_KEY
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Option 3 · Manual Install
|
|
66
|
+
|
|
67
|
+
<details>
|
|
68
|
+
<summary><b>Cursor</b></summary>
|
|
69
|
+
|
|
70
|
+
Paste into `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global):
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"mcpServers": {
|
|
75
|
+
"thrixel": {
|
|
76
|
+
"command": "uvx",
|
|
77
|
+
"args": ["thrixel-mcp"],
|
|
78
|
+
"env": { "THRIXEL_API_KEY": "sk-thrixel-YOUR_API_KEY" }
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
> **Windows**: if `uvx` is not on `PATH` for GUI apps, use the absolute path, e.g. `"command": "C:\\Users\\you\\.local\\bin\\uvx.exe"`.
|
|
85
|
+
|
|
86
|
+
</details>
|
|
87
|
+
|
|
88
|
+
<details>
|
|
89
|
+
<summary><b>Claude Desktop</b></summary>
|
|
90
|
+
|
|
91
|
+
Add to `claude_desktop_config.json`:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"mcpServers": {
|
|
96
|
+
"thrixel": {
|
|
97
|
+
"command": "uvx",
|
|
98
|
+
"args": ["thrixel-mcp"],
|
|
99
|
+
"env": { "THRIXEL_API_KEY": "sk-thrixel-YOUR_API_KEY" }
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
</details>
|
|
106
|
+
|
|
107
|
+
<details>
|
|
108
|
+
<summary><b>Codex / VS Code / Windsurf</b></summary>
|
|
109
|
+
|
|
110
|
+
Same shape as above — `command: "uvx"`, `args: ["thrixel-mcp"]`, and
|
|
111
|
+
`THRIXEL_API_KEY` in the `env` block.
|
|
112
|
+
|
|
113
|
+
</details>
|
|
114
|
+
|
|
115
|
+
<details>
|
|
116
|
+
<summary><b>Without uv (pip fallback)</b></summary>
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pip install thrixel-mcp
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Then point the client at your interpreter:
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"mcpServers": {
|
|
127
|
+
"thrixel": {
|
|
128
|
+
"command": "python",
|
|
129
|
+
"args": ["-m", "thrixel_mcp.server"],
|
|
130
|
+
"env": { "THRIXEL_API_KEY": "sk-thrixel-YOUR_API_KEY" }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Use an absolute path to `python` if the client cannot find it on `PATH`.
|
|
137
|
+
|
|
138
|
+
</details>
|
|
139
|
+
|
|
140
|
+
<details>
|
|
141
|
+
<summary><b>Pre-release / unpublished builds</b></summary>
|
|
142
|
+
|
|
143
|
+
`uvx` can run straight from the repository, no PyPI release needed:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# latest main — SSH, works while the repo is private (needs repo access)
|
|
147
|
+
uvx --from git+ssh://git@github.com/thrixel/thrixel_mcp thrixel-mcp
|
|
148
|
+
|
|
149
|
+
# a local checkout
|
|
150
|
+
uvx --from /path/to/thrixel_mcp thrixel-mcp
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Same shape in a client config — replace `args` with
|
|
154
|
+
`["--from", "git+ssh://git@github.com/thrixel/thrixel_mcp", "thrixel-mcp"]`.
|
|
155
|
+
|
|
156
|
+
> The `git+https://` form only works once the repository is public; until then
|
|
157
|
+
> `uvx` cannot authenticate and fails with `could not read Username`.
|
|
158
|
+
|
|
159
|
+
</details>
|
|
160
|
+
|
|
161
|
+
## Activate After Install
|
|
162
|
+
|
|
163
|
+
Most clients auto-load the new server, but **Cursor and VS Code require a manual toggle**:
|
|
164
|
+
|
|
165
|
+
| Client | What to do | Verify |
|
|
166
|
+
|---|---|---|
|
|
167
|
+
| **Claude Code** | Nothing — auto-loads on next message | `/mcp` shows `thrixel ✓ connected` |
|
|
168
|
+
| **Cursor** | Restart → `Settings` → `MCP & Integrations` → toggle `thrixel` **on** → wait for green dot ● → open a **new chat** | `List the thrixel tools available` |
|
|
169
|
+
| **Claude Desktop** | Quit & relaunch the app | `List the thrixel tools available` |
|
|
170
|
+
| **VS Code** | Run command `MCP: List Servers` → click `thrixel` → **Start** | `List the thrixel tools available` |
|
|
171
|
+
| **Codex** | Nothing — auto-loads on next session | `List the thrixel tools available` |
|
|
172
|
+
|
|
173
|
+
<!-- TODO(screenshot): connected-state screenshot (Cursor green dot / `/mcp` output).
|
|
174
|
+
Save as docs/connected.png -->
|
|
175
|
+
> **TODO** — connected-state screenshot goes here (`docs/connected.png`).
|
|
176
|
+
|
|
177
|
+
## Usage
|
|
178
|
+
|
|
179
|
+
Once connected, just ask:
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
Make me a low-poly wooden market stall for a game, under 5000 triangles.
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The agent will chain `thrixel_create_model` → `thrixel_detail_model` → `thrixel_reduce_triangles`, save the GLB into `./thrixel_assets/`, and show you the render at each step.
|
|
186
|
+
|
|
187
|
+
<!-- TODO(screenshot): before/after — Architect blockout vs detailed result.
|
|
188
|
+
Save as docs/pipeline.png -->
|
|
189
|
+
> **TODO** — pipeline before/after image goes here (`docs/pipeline.png`).
|
|
190
|
+
|
|
191
|
+
## Troubleshooting
|
|
192
|
+
|
|
193
|
+
- **`spawn uvx ENOENT`** — the client cannot find `uvx` on `PATH`. Use the absolute path (`which uvx`, or `%USERPROFILE%\.local\bin\uvx.exe` on Windows).
|
|
194
|
+
- **`THRIXEL_API_KEY is not set`** — the key didn't reach the server. Make sure it sits inside an `"env": {...}` block in your MCP config, not in `args`.
|
|
195
|
+
- **Tool calls return "Thrixel rejected the API key"** — the key is invalid or revoked. Regenerate at https://thrixel.com/beta (Account → API keys).
|
|
196
|
+
- **First call is slow** — `uvx` is resolving and caching the package. Subsequent starts are fast.
|
|
197
|
+
- **"You have N jobs already running"** — you hit the per-plan concurrency cap (free 2, pro 5, studio 10). Run large batches in waves; `thrixel_account_status` shows what's in flight.
|
|
198
|
+
- **"Out of cubes"** — detail, sculpt and texture cost 40 cubes each. `thrixel_reduce_triangles` and rebakes are free.
|
|
199
|
+
- **Jobs time out** — GPU work can queue behind other jobs. Raise `THRIXEL_TIMEOUT_S`, or submit with `wait=false` and poll via `thrixel_job_status`.
|
|
200
|
+
- **Client doesn't list `thrixel`** — make sure the config file is valid JSON (no trailing commas), then fully restart the client.
|
|
201
|
+
- **Stuck on an old version** — `uvx` caches builds. Force a refresh with `uvx --refresh thrixel-mcp`.
|
|
202
|
+
|
|
203
|
+
## Configuration
|
|
204
|
+
|
|
205
|
+
| Environment Variable | Description | Default |
|
|
206
|
+
|---------------------|-------------|---------|
|
|
207
|
+
| `THRIXEL_API_KEY` | **Required.** Your Thrixel API key (starts with `sk-thrixel-`) | — |
|
|
208
|
+
| `THRIXEL_API_BASE` | API base URL | `https://api.thrixel.com` |
|
|
209
|
+
| `THRIXEL_OUTPUT_DIR` | Where generated models are written. Writes outside it are refused | `./thrixel_assets` |
|
|
210
|
+
| `THRIXEL_TIMEOUT_S` | Ceiling in seconds for a single submit-and-wait cycle | `600` |
|
|
211
|
+
| `THRIXEL_LOG_LEVEL` | Server log level, written to stderr | `INFO` |
|
|
212
|
+
|
|
213
|
+
## Development
|
|
214
|
+
|
|
215
|
+
End users need only `uvx`; contributors want a real environment. Either works:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
git clone https://github.com/thrixel/thrixel_mcp.git
|
|
219
|
+
cd thrixel_mcp
|
|
220
|
+
|
|
221
|
+
# uv
|
|
222
|
+
uv sync --extra dev
|
|
223
|
+
|
|
224
|
+
# or conda
|
|
225
|
+
conda env create -f environment.yml
|
|
226
|
+
conda activate thrixel-mcp
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
# Unit tests — no backend required
|
|
231
|
+
pytest
|
|
232
|
+
|
|
233
|
+
# End-to-end against a local backend
|
|
234
|
+
export THRIXEL_API_BASE=http://localhost:8000
|
|
235
|
+
export THRIXEL_API_KEY=sk-thrixel-...
|
|
236
|
+
|
|
237
|
+
python tests/smoke_local.py # list registered tools
|
|
238
|
+
python tests/smoke_local.py thrixel_account_status
|
|
239
|
+
python tests/smoke_local.py thrixel_create_model '{"prompt":"a rusted oil drum"}'
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Run the packaged entry point exactly as a user would:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
uvx --from . thrixel-mcp
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
This server holds no state and no business logic — it is a client of the public Thrixel API. Anything it can do, a direct API caller can do too.
|
|
249
|
+
|
|
250
|
+
## HTTP Transport
|
|
251
|
+
|
|
252
|
+
<!-- TODO(phase-2): remote Streamable HTTP transport + OAuth 2.1, mounted into the
|
|
253
|
+
existing FastAPI service. Not implemented yet. -->
|
|
254
|
+
> **TODO** — remote HTTP transport is planned but not implemented. `stdio` only for now.
|
|
255
|
+
|
|
256
|
+
## License
|
|
257
|
+
|
|
258
|
+
[MIT](LICENSE)
|