MCP // REST API
MCP or REST API for 3D assets
Use MCP when an agent does the work, because it can find the tools, read each result and decide the next step. Use the REST API when your own code makes the calls, such as a build script or your backend. Both reach the same service, and each job costs the same listed price.
A draft compile is from $0.05, and new accounts start with $5 of usage.
- Hosted MCP server:
https://spatialcompiler.dev/mcp, browser sign-in - REST API:
https://api.spatialcompiler.dev/v1/jobs, API key as a bearer token - Both are in early access
- An estimate costs $0 either way
01 // COMPARE
Which one fits your setup
MCP is the protocol your agent uses to call tools. REST is plain HTTP that any language can send.
- Your agent works on the project in an editor or a terminal. Pick MCP: add the hosted server, sign in in the browser, and the agent sees the tools and their inputs.
- A build script, CI job or backend compiles effects without an agent. Pick REST and send JSON with your API key.
- You want a Godot 4 scene written for you. Pick MCP, where your agent calls
wireafter the compile. - You want to price a job first. Either works:
estimateover MCP andPOST /v1/estimateboth cost $0.
02 // MCP
Connect over MCP
Add the hosted server to your MCP client. Sign-in is an OAuth 2.1 browser login, so the config holds no key.
{
"mcpServers": {
"spatial-compiler": {
"type": "http",
"url": "https://spatialcompiler.dev/mcp"
}
}
}
The local server, npx -y @applied-manifold/spatial-compiler, reads an API key from SPATIAL_API_KEY and sends each call to the hosted API, so nothing runs on your machine. See Install via MCP.
03 // REST
Call the REST API
Send a POST to /v1/estimate or /v1/jobs with your API key as a bearer token and a JSON body that names a module, an operation and a spec. A 401 means a missing or bad key, and a 429 means the key reached its hourly limit.
const res = await fetch("https://api.spatialcompiler.dev/v1/estimate", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SPATIAL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
module: "pyro",
operation: "bake",
quality: "draft",
spec_name: "fire_whirl.pyro.toml",
spec: { meta: { name: "fire_whirl" }, export: { loop: true } },
}),
});
console.log(await res.json());
The OpenAPI description lives at /openapi/spatial-compiler.json. See REST API and API keys.
Why use MCP instead of the REST API for 3D assets?
Use MCP when an agent calls tools and inspects results and use the REST API when your own scripts or backend make direct calls.
Why is an MCP server needed for AI agents?
An MCP server turns the Spatial Compiler service into discoverable tools for an agent without custom glue code, whereas scripts call REST directly.
Should I use the local MCP server or the hosted MCP server?
Use the hosted server for browser login without stored keys and use the local server when you need an API key in CI.
What transport should I use for Spatial Compiler MCP?
Use HTTP for the hosted server, while the local server communicates over stdio with your client and forwards calls to the hosted API.
How do I configure authentication for Spatial Compiler MCP and REST?
The hosted MCP server uses OAuth browser login with no config token, while the local server and REST API use an account API key.
Compile your first effect
You pay per compile and see the price before it runs. New accounts start with $5 of usage.