spz-mcp
MCP server that lets an LLM agent drive StableProjectorz, a 3D modeling app, by inspecting the loaded model, app state, viewport screenshots, and triggering UI actions via a loopback socket bridge.
README
spz-mcp
An MCP server that lets an LLM agent drive StableProjectorz — inspect the loaded 3D model, read the app's state, look at the viewport, and trigger UI actions.
It talks to the agent bridge built into the app: a loopback-only JSON socket.
Claude Code / Claude Desktop ──MCP(stdio)──► spz-mcp ──TCP 127.0.0.1:8765──► StableProjectorz
The server knows nothing about StableProjectorz
On every tools/list, it asks the running app for its catalogue via the bridge's
describe command and republishes it as MCP tools, building each JSON Schema from the
parameter descriptions the app supplies.
Nothing is hard-coded here. Adding a tool to the app does not require a new release of this server — which is exactly what allows the app and this server to live in separate repositories without drifting apart.
Setup
1. Enable the bridge in StableProjectorz
Add this to spz.config, next to the executable (or at the project root when running
from the Unity Editor), then restart the app:
--agent-bridge
Optional:
--agent-bridge-port=8765
--agent-bridge-token=some-secret
The Unity console should log [SPZ_Agent_Bridge] listening on 127.0.0.1:8765.
2. Register the server
Claude Code:
claude mcp add spz -- uvx --from git+https://github.com/redDwarf03/spz-mcp spz-mcp
Claude Desktop — in claude_desktop_config.json:
{
"mcpServers": {
"spz": {
"command": "uvx",
"args": ["--from", "git+https://github.com/redDwarf03/spz-mcp", "spz-mcp"]
}
}
}
With a token or a non-default port, add "env": {"SPZ_TOKEN": "some-secret", "SPZ_PORT": "8765"}.
From a local checkout
pip install -e ".[dev]"
spz-mcp --port 8765
Tools
The list comes from the app at runtime. With the current bridge you get:
| Tool | What it does |
|---|---|
describe |
Protocol version and tool catalogue |
get_app_state |
Version, WebUI connections, loaded model, UDIM tiles, selection, generation status |
get_viewport_screenshot |
Viewport capture, returned as a real MCP image the agent can see |
list_generations |
Stored generation counts per kind, and the latest GUID |
list_events |
Every registered StaticEvents id and its parameter types |
invoke_event |
Fire a StaticEvents id, as the matching UI control would |
Plus one tool this server adds itself:
| Tool | What it does |
|---|---|
spz_bridge_status |
Whether the app is reachable, and how to enable the bridge if not |
spz_bridge_status is also the only tool published while the app is down, so an agent can
diagnose the situation instead of finding an unexplained empty toolbox.
Options
| Flag | Env | Default |
|---|---|---|
--host |
SPZ_HOST |
127.0.0.1 |
--port |
SPZ_PORT |
8765 |
--token |
SPZ_TOKEN |
none |
Protocol
One JSON object per line over TCP:
-> {"id":"1","tool":"get_app_state","params":{}}
<- {"id":"1","ok":true,"result":{"app_version":"2.4.5","sd_connected":true, ...}}
<- {"id":"1","ok":false,"error":"unknown tool 'foo'. Call 'describe' for the catalogue."}
The app serves one request at a time per connection, so this client serialises calls
behind a lock rather than multiplexing on id.
Notes and limits
- The bridge is opt-in and loopback-only, but it is an unauthenticated local control channel unless you set a token. Any process on the machine can connect. Enable it only while you are using it.
- Screenshots wait on an async GPU readback, so they can take a moment; overlapping captures are rejected rather than left hanging.
- Managers in the app live in additively-loaded scenes, so calls made during startup may report that a subsystem is not ready yet.
Tests
pip install -e ".[dev]"
pytest
The suite runs a fake bridge over a real TCP socket, so the client is exercised end to end without needing StableProjectorz running. Each test has a 30 s timeout: these all talk to a local socket and finish in milliseconds, so a hang is a bug and should fail rather than block the suite.
Linting and formatting use ruff:
ruff check .
ruff format .
CI/CD
ci.yml runs on every push to main and every pull request:
- lint —
ruff checkandruff format --check - test — Python 3.10 through 3.14 on Linux, plus one Windows leg (the app this server drives is Windows-first)
- build — builds the wheel and sdist and validates the metadata with
twine check
release.yml runs on a v* tag. It refuses to proceed if the tag does not match the
version in pyproject.toml, then builds and attaches the distributions to a GitHub
release with generated notes.
Publishing to PyPI is off by default, since the server installs fine straight from git. To enable it:
- claim the
spz-mcpname on PyPI - add a trusted publisher for this repo,
workflow
release.yml, environmentpypi - set the repository variable
PUBLISH_TO_PYPItotrue
No token is stored anywhere — publishing authenticates over OIDC.
License
MIT — see LICENSE.
The StableProjectorz app itself is AGPL-3.0. This server is a separate program that communicates with it over a socket, and is deliberately kept in its own repository so it can be reused and relicensed independently.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。