spline-mcp

spline-mcp

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

Category
访问服务器

README

spline-mcp

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

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 (Mahavishnu) and n8n workflow integration
  • 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.

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 3048

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 Mahavishnu WebSocket connection
subscribe_to_channel Subscribe to real-time updates
get_n8n_status Check n8n availability
generate_n8n_workflow Generate n8n workflow for Spline
trigger_n8n_webhook Trigger n8n webhook
get_integration_status Status of all integrations

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_CACHE_DIR ~/.spline-mcp/cache Cache directory
SPLINE_MAX_CACHE_SIZE_MB 500 Maximum cache size
SPLINE_WEBSOCKET_ENABLED true Enable WebSocket integration
SPLINE_WEBSOCKET_URL ws://localhost:8690 Mahavishnu WebSocket URL
SPLINE_N8N_ENABLED true Enable n8n integration
SPLINE_N8N_URL http://localhost:3044 n8n server URL
SPLINE_HTTP_PORT 3048 HTTP server port
SPLINE_LOG_LEVEL INFO Logging level

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    # Mahavishnu WebSocket (soft failover)
│   └── n8n.py          # n8n workflow integration
├── 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

Ecosystem Integration

Part of the Bodai Ecosystem:

Component Role Port
Mahavishnu Orchestrator 8680
Akosha Seer 8682
Dhara Curator 8683
Session-Buddy Builder 8678
Crackerjack Inspector 8676
spline-mcp 3D Orchestrator 3048

License

BSD-3-Clause

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选