---
title: "Install Spatial Compiler via MCP: hosted server and local npx server"
description: "Connect Claude Code, Cursor or CI to Spatial Compiler over MCP: the hosted server with an OAuth 2.1 browser login, or the local npx server with SPATIAL_API_KEY."
canonical: https://appliedmanifold.com/docs/mcp/
site: "Applied Manifold: The spatial compute cloud for 3D reality"
---

1.  [Home](https://appliedmanifold.com/)
2.  [Docs](https://appliedmanifold.com/docs/)
3.  Install via MCP

DOCS // SPATIAL.COMPILER

# Install via MCP

Point your MCP client at the hosted server, `https://mcp.spatialcompiler.dev`, which signs you in with an OAuth 2.1 browser login, or run the local server with `npx -y @spatial-compiler/mcp` and your API key in `SPATIAL_API_KEY`.

## Hosted MCP server

Add the server URL to your MCP client. The hosted server uses an OAuth 2.1 browser login to your Applied Manifold account, with PKCE (S256), so the config holds no key:

mcp.json

```json
{
  "mcpServers": {
    "spatial-compiler": {
      "type": "http",
      "url": "https://mcp.spatialcompiler.dev"
    }
  }
}
```

In Claude Code you can register it from the command line:

terminal

```sh
claude mcp add --transport http spatial-compiler https://mcp.spatialcompiler.dev
```

## Local MCP server

The local server, the npm package `@spatial-compiler/mcp`, runs over stdio through `npx`. It reads your API key from the `SPATIAL_API_KEY` environment variable and runs no login flow:

terminal

```sh
SPATIAL_API_KEY=spck_test_example npx -y @spatial-compiler/mcp
```

Most MCP clients (Claude Desktop, Cursor and others) accept the same JSON config block:

mcp.json

```json
{
  "//": "Local MCP server config (stdio via npx, credential in SPATIAL_API_KEY). Rendered at <!-- @mcp-json --> on /docs/mcp/ and returned by the WebMCP get_mcp_config tool. The hosted config is derived from site.config.json MCP_URL (build/site.mjs hostedMcpConfig).",
  "mcpServers": {
    "spatial-compiler": {
      "command": "npx",
      "args": [
        "-y",
        "@spatial-compiler/mcp"
      ],
      "env": {
        "SPATIAL_API_KEY": "spck_test_example"
      }
    }
  }
}
```

In Claude Code you can register it from the command line:

terminal

```sh
claude mcp add spatial-compiler -e SPATIAL_API_KEY=spck_test_example -- npx -y @spatial-compiler/mcp
```

Replace the example key `spck_test_example` with your own API key. New accounts start with $5 of usage. See [API keys](https://appliedmanifold.com/docs/api-keys/).

## Then

Restart the client and confirm the tools are listed: see [MCP tools](https://appliedmanifold.com/docs/mcp-tools/).
