Skip to main content

spline-mcp

Code style: crackerjack Runtime: oneiric Framework: FastMCP uv Python: 3.14+

MCP server for Spline.design code generation and asset management.

Overview

Spline.design is a 3D design tool that exports interactive scenes for the web. This MCP server provides:

  • Code Generation: Generate React, Next.js, and vanilla JS integration code
  • Asset Management: Download, cache, and validate .splinecode files
  • Integration Support: WebSocket event sink
  • Helper Utilities: URL building, event documentation, code snippets

Note: Spline does not have a traditional REST API. Scenes are created in the Spline editor and exported as .splinecode files for runtime use.

Spline V2 Compatibility

Spline V2 (released August 20, 2026) ships its own MCP server inside the rebuilt Spline desktop app that lets AI agents drive the editor directly — creating and modifying objects, materials, lights, cameras, booleans, particles, cloners, lathes, sky, variables, events, and states. See the Spline V2 launch announcement for details.

This server fills a different, complementary niche:

Workflow stage Tool
Authoring — building / editing the scene in the editor Spline V2 MCP (bundled with the Spline desktop app)
Embedding — putting the exported scene into your React / Next.js / vanilla app This server (spline-mcp)
Runtime control — manipulating variables / events from your app at runtime Both cooperate: V2 MCP builds the scene; this server emits the JS that drives setNumberVariable() / emitEvent() from the host app

Concretely, this server does not edit scenes — it operates strictly on already-exported .splinecode URLs. If you need an agent to author a new scene from scratch, install the Spline desktop app and use its built-in MCP server. Use this server when you have a published .splinecode URL and want to scaffold the React / Next.js / vanilla integration, cache the scene asset, wire up runtime event handlers, or pipe events into the external WebSocket event sink.

Installation

uv pip install -e .

Quick Start

Generate a React Component

spline-mcp generate react https://prod.spline.design/6Wq1Q7YGyM-iab9i/scene.splinecode

Download a Scene

spline-mcp download https://prod.spline.design/6Wq1Q7YGyM-iab9i/scene.splinecode

MCP Server Usage

Stdio Mode (default)

spline-mcp serve

HTTP Mode

spline-mcp serve --http --port 3052

Available Tools

Code Generation

Tool Description
generate_react_component Generate React component with TypeScript
generate_vanilla_js Generate standalone HTML/JS
generate_nextjs_component Generate Next.js component with SSR support
generate_event_handler Generate event handler code
generate_variable_binding Generate runtime variable bindings
generate_full_integration Complete integration with all features

Asset Management

Tool Description
download_scene Download and cache a .splinecode file
validate_scene Validate a .splinecode file
list_cached_scenes List all cached scenes
clear_cache Clear cached scenes
get_cache_stats Get cache statistics

Helper Utilities

Tool Description
build_export_url Build export URL from scene ID
parse_scene_url Parse URL to extract scene ID
list_event_types List supported Spline event types
get_event_documentation Get docs for specific event
generate_snippet Generate common code snippets

Integration

Tool Description
get_websocket_status Check external WebSocket event-sink connection
subscribe_to_channel Subscribe to real-time updates
get_integration_status Status of all integrations
get_integration_status Status of all integrations

Documentation

Tool Description
get_runtime_api_docs Get documentation for the @splinetool/runtime API by topic
get_installation_guide Get installation guide for the Spline runtime
get_troubleshooting_guide Get troubleshooting guide for common Spline issues

Configuration

Set via environment variables with SPLINE_ prefix:

Variable Default Description
SPLINE_DEFAULT_FRAMEWORK react Default framework (react/vanilla/nextjs)
SPLINE_TYPESCRIPT true Generate TypeScript code
SPLINE_LAZY_LOAD true Use lazy loading with Suspense
SPLINE_SSR_PLACEHOLDER false Generate SSR placeholder for Next.js
SPLINE_INDENT_SPACES 2 Indentation spaces for generated code (2-8)
SPLINE_SEMICOLONS true Use semicolons in generated JavaScript
SPLINE_CACHE_DIR ~/.spline-mcp/cache Cache directory
SPLINE_MAX_CACHE_SIZE_MB 500 Maximum cache size
SPLINE_AUTO_VALIDATE true Automatically validate downloaded scenes
SPLINE_WEBSOCKET_ENABLED true Enable WebSocket integration
SPLINE_WEBSOCKET_URL ws://localhost:8690 External WebSocket event-sink URL
SPLINE_WEBSOCKET_AUTO_RECONNECT true Automatically reconnect on disconnect
SPLINE_ENABLE_HTTP_TRANSPORT true Enable HTTP transport
SPLINE_HTTP_HOST 127.0.0.1 HTTP server host
SPLINE_HTTP_PORT 3052 HTTP server port
SPLINE_LOG_LEVEL INFO Logging level
SPLINE_LOG_JSON true Use JSON logging format

Generated Code Examples

React Component

import { Suspense, useRef, useCallback } from 'react';
import Spline from '@splinetool/react-spline';

interface HeroSceneProps {
  className?: string;
}

export function HeroScene({ className }: HeroSceneProps) {
  return (
    <Suspense fallback={<div>Loading 3D scene...</div>}>
      <Spline
        scene="https://prod.spline.design/xxx/scene.splinecode"
        className={className}
      />
    </Suspense>
  );
}

With WebSocket Integration

// Auto-generated WebSocket integration with soft failover
const { subscribe, isConnected } = useWebSocket('ws://localhost:8690');

useEffect(() => {
  if (!isConnected) return;

  const unsubscribe = subscribe('spline:variables', (data) => {
    splineRef.current?.setVariables(data);
  });

  return unsubscribe;
}, [isConnected]);

Architecture

spline_mcp/
├── generators/         # Code generation (React, Vanilla, Next.js)
│   ├── base.py         # Base classes and types
│   ├── react.py        # React generator with FastBlocks patterns
│   ├── vanilla.py      # Vanilla JS/HTML generator
│   └── nextjs.py       # Next.js SSR generator
├── assets/             # Asset management
│   ├── manager.py      # Download, cache, validate
│   └── validator.py    # Scene file validation
├── integrations/       # External integrations
│   └── websocket.py    # External WebSocket event sink (soft failover)
├── tools/              # MCP tool definitions
│   ├── generation.py   # Code generation tools
│   ├── assets.py       # Asset management tools
│   ├── helpers.py      # Utility tools
│   └── integration.py  # Integration tools
├── config.py           # Oneiric-based configuration
└── server.py           # FastMCP application

Installation via Claude Code marketplace

This repo ships a Claude Code plugin manifest (.claude-plugin/plugin.json) plus a colocated .mcp.json and three slash commands in commands/. To install, register the www-mcp-servers marketplace with Claude Code, then install the plugin by name. Once installed, the slash commands /spline-generate, /spline-assets, and /spline-websocket become available alongside the mcp__spline__* tools. Make sure the spline-mcp HTTP server is running on its configured port before invoking the slash commands.

License

BSD-3-Clause

Built on Oneiric for runtime configuration and mcp-common for the FastMCP baseline. Crackerjack gates every commit.

Metadata

Release files for spline-mcp 0.5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spline-mcp 0.5.4
File Size Uploaded
spline_mcp-0.5.4.tar.gz 82.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spline-mcp 0.5.4
File Interpreter ABI Platform
spline_mcp-0.5.4-py3-none-any.whl Python 3 none any Details

Total release size: 125.4 kB

Release files / spline_mcp-0.5.4.tar.gz

Download URL spline_mcp-0.5.4.tar.gz
Size 82.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1574718ef460d66cb0e10bef63dcb3555fbb53f3fff764aa11486d4858c6a928
BLAKE2b-256 checksum
How to use checksums
8833e158d1ab1cda63d2792a82ea8008be33847f1c47a7a6017724af5d695f3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / spline_mcp-0.5.4-py3-none-any.whl

Download URL spline_mcp-0.5.4-py3-none-any.whl
Size 43.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3aa5aa9539019c9359a81e877d0012479beb0f75eed27f54e4407c45005e8dd
BLAKE2b-256 checksum
How to use checksums
0a7c8ed5a50e2cf886d6db658937534e055f988dae9c1ed8830841773adb1179
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.5.4 This release

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page