---
title: "MCP or REST API for 3D assets | Spatial Compiler"
description: "Use MCP when an agent makes the calls and reads each result. Use the REST API when your own script or backend does. Both reach the same service and prices."
canonical: https://appliedmanifold.com/mcp/mcp-vs-rest/
site: "Applied Manifold: The spatial compute cloud for 3D reality"
---

1.  [Home](https://appliedmanifold.com/)
2.  [Engine MCP](https://appliedmanifold.com/mcp/)
3.  MCP or REST

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.

[Get Free API Key](https://console.appliedmanifold.com/sign-in?next=/api-keys) [See the examples →](https://appliedmanifold.com/docs/pyrofx/examples/)

A draft compile is from $0.05, and new accounts start with $5 of usage.

**AT A GLANCE**

-   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 `wire` after the compile.
-   You want to price a job first. Either works: `estimate` over MCP and `POST /v1/estimate` both 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.

mcp.json · hosted server

```json
{
  "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](https://appliedmanifold.com/docs/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.

estimate.js

```
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](https://appliedmanifold.com/docs/rest-api/) and [API keys](https://appliedmanifold.com/docs/api-keys/).

04 // RELATED

## Related pages

-   [Hosted vs local MCPHosted MCP servers run at a URL with a browser sign-in, and local ones are commands your client starts with a key.](https://appliedmanifold.com/learn/hosted-vs-local-mcp/)
-   [MCP transportsAn MCP transport carries messages between client and server: stdio for a local process, Streamable HTTP for a server at a URL.](https://appliedmanifold.com/learn/mcp-transport/)
-   [What MCP isMCP is the open protocol your agent uses to discover and call tools on servers, from scene editors to effect bakers.](https://appliedmanifold.com/learn/mcp/)
-   [Game assets over MCPAn MCP server creates game assets when its tools write files. Spatial Compiler's server makes effect sprite sheets today, and meshfx measures and reduces models, with hosted runs available.](https://appliedmanifold.com/mcp/game-assets/)
-   [Godot MCP Godot 4Connect your agent to Spatial Compiler's hosted MCP server to compile fire, smoke, explosion and dust effects into Godot 4 scenes.](https://appliedmanifold.com/mcp/godot/)
-   [REST APISend a POST to `https://api.spatialcompiler.dev/v1/estimate` or `/v1/jobs` with your API key as a bearer token and a JSON body naming a module, an operation and a spec. To report a bug, a crash, a missing capability or an idea, send `POST /v1/feedback`. The OpenAPI description is at /openapi/spatial-compiler.json.](https://appliedmanifold.com/docs/rest-api/)

[All pages in Engine MCP →](https://appliedmanifold.com/mcp/)

[← MCP for game VFX](https://appliedmanifold.com/mcp/vfx/)

05 // FAQ

## MCP and REST questions

[All questions →](https://appliedmanifold.com/faq/)

**README.MCP\_VS\_REST**

### 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.

[Get Free API Key](https://console.appliedmanifold.com/sign-in?next=/api-keys) [REST API →](https://appliedmanifold.com/docs/rest-api/)

[All effects, guides and explainers →](https://appliedmanifold.com/effects/)
