npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

maige-3d-mcp

v0.1.0

Published

Multi-framework 3D MCP server for controlling Three.js, A-Frame, Babylon.js, and React Three Fiber scenes with AI. Features in-world chat, 9 AI providers, 33 MCP tools, and WebXR VR support.

Readme

maige-3d-mcp

Multi-framework 3D MCP server for AI-powered scene control

Control live Three.js, A-Frame, Babylon.js, and React Three Fiber scenes with AI — featuring in-world chat, WebXR VR support, and 9 AI providers.

Features

  • 🎨 4 Framework Clients — Three.js, A-Frame, Babylon.js, React Three Fiber (all included)
  • 🤖 9 AI Providers — OpenAI, Anthropic, Google Gemini, Mistral, Groq, xAI, Cohere, Together.ai, Ollama
  • 🛠️ 33 MCP Tools — Complete scene control (objects, lights, camera, animation, behaviors, particles, environment)
  • 💬 In-World Chat — Type messages from inside the 3D viewport (press ~)
  • 🥽 WebXR VR Support — Full immersive mode with floating 3D chat panels
  • 🎭 Creative AI System — Teaches lighting, composition, color theory, and atmospheric design
  • 30 Passing Tests — Comprehensive test coverage with 100% TypeScript type safety

Quick Start

npx maige-3d-mcp

That's it! The server starts and opens the Three.js client at http://localhost:5173.

Press ~ (backtick) to open the chat overlay and start talking to AI from inside the scene.

Installation

Option 1: npx (Recommended)

npx maige-3d-mcp

No installation needed. Always runs the latest version.

Option 2: Global Install

npm install -g maige-3d-mcp
maige-3d-mcp

Option 3: From Source

git clone https://github.com/m-ai-geXR/maigeXR.git
cd maigeXR/mcp-webgpu
pnpm install
pnpm build:server
pnpm dev

Configuration

Create a .env file in your working directory:

# At least one API key required for in-world chat

# OpenAI (GPT-4, o1, etc.)
OPENAI_API_KEY=sk-...

# Anthropic (Claude Opus, Sonnet, Haiku)
ANTHROPIC_API_KEY=sk-ant-...

# Google AI (Gemini Pro, Flash)
GOOGLE_API_KEY=...

# Together.ai (FREE DeepSeek R1, Llama 3.3)
TOGETHER_API_KEY=...

# Groq (Fast inference)
GROQ_API_KEY=...

# Mistral
MISTRAL_API_KEY=...

# xAI / Grok
XAI_API_KEY=...

# Cohere
COHERE_API_KEY=...

# Ollama (local, no API key needed)
OLLAMA_BASE_URL=http://localhost:11434

Get Free API Keys:

Usage

MCP Host Integration (GitHub Copilot, Claude Desktop, Cursor)

Add to your MCP config (mcp.json or claude_desktop_config.json):

{
  "mcpServers": {
    "maige-3d-mcp": {
      "command": "npx",
      "args": ["maige-3d-mcp"]
    }
  }
}

The AI can now use all 33 MCP tools to control the scene.

Standalone Mode

Run without MCP host:

npx maige-3d-mcp

Use in-world chat (press ~) to talk to AI directly from the 3D viewport.

Available Clients

All four clients auto-start and connect to the server:

  • Three.js — http://localhost:5173 (vanilla JS, full control)
  • A-Frame — http://localhost:5174 (declarative HTML, VR-native)
  • Babylon.js — http://localhost:5175 (PBR materials, enterprise rendering)
  • React Three Fiber — http://localhost:5176 (React components, Zustand state)

Same prompt, same scene, any engine.

MCP Tools (33 Total)

Objects (18 Geometry Types)

  • createObject — box, sphere, cylinder, cone, torus, plane, capsule, torusKnot, ring, circle, dodecahedron, icosahedron, octahedron, tetrahedron, tube, line, gltf
  • updateObject, deleteObject, cloneObject, getObject, getSceneState

Lights

  • createLight, updateLight, deleteLight — ambient, directional, point, spot, hemisphere

Camera

  • setCamera, flyToObject — smooth camera animations

Animation & Behaviors

  • animateObject, stopAnimation — timed A→B transitions
  • addBehavior, removeBehavior — continuous effects (spin, bob, orbit, lookAt, pulse)

Particles

  • createParticles, updateParticles, deleteParticles — GPU particle systems with twinkle/additive blending

Environment

  • setEnvironment — background, fog, shadows, bloom, vignette, chromatic aberration, HDRI maps

Scripting

  • executeScript — run arbitrary JavaScript in the client (access to scene, camera, renderer, THREE)

Scene Management

  • clearScene, loadScene, exportScene — full scene state I/O
  • saveScene, listScenes, loadSceneFromFile — persistent file storage
  • exportStandaloneScene — export as single self-contained HTML
  • undo, redo — 20-deep snapshot stack
  • takeScreenshot — export as base64 PNG

In-World Chat

  • getPendingUserMessages — retrieve messages from 3D canvas overlay
  • sendChatMessage — display AI replies in floating panel
  • clearPendingMessages — flush message queue

Example: Create a Glowing Portal

From any MCP-capable AI (Copilot, Claude, Cursor):

// AI calls these tools automatically:
await createObject({
  id: 'portal',
  type: 'torus',
  position: {x: 0, y: 1.5, z: 0},
  scale: {x: 2, y: 2, z: 0.3},
  rotation: {x: 90, y: 0, z: 0},
  material: {
    color: '#1a1a1a',
    emissive: '#ff00ff',
    emissiveIntensity: 2.0,
    metalness: 0.9
  }
});

await createLight({
  id: 'neon',
  lightType: 'point',
  color: '#ff00ff',
  intensity: 3,
  position: {x: 0, y: 1.5, z: 0}
});

await addBehavior({
  id: 'spin',
  objectId: 'portal',
  type: 'spin',
  params: {speedY: 1}
});

await setEnvironment({
  background: '#0a0a1e',
  fog: {color: '#6600ff', near: 8, far: 25},
  bloom: {strength: 0.8, threshold: 0.5, radius: 0.4}
});

All four clients render the same scene instantly.

WebXR / VR Mode

Click the 🥽 Enter VR button in any client to step inside the scene. The chat panel becomes a floating 3D canvas in front of you.

Requires:

  • WebXR-capable browser (Chrome 79+, Edge 79+, Meta Quest Browser)
  • VR headset (or use WebXR API Emulator)

Creative AI System

The AI is taught to think like a visual artist:

  • Lighting creates emotion — Warm (#ff9966) vs cool (#66ccff) vs neon
  • Composition creates interest — Rule of thirds, depth layers, varied sizes
  • Color theory matters — Complementary, analogous, accent colors
  • Atmosphere is everything — Fog, dark backgrounds, emissive materials

When you ask for "something cool," the AI suggests themed experiences:

  • "A neon cyberpunk alley with fog and glowing signs?"
  • "A serene Japanese garden with cherry blossoms and lanterns?"
  • "An abstract art installation with floating geometric shapes?"

Architecture

MCP Host (Copilot/Claude/Cursor)
  ↓ stdio / JSON-RPC
MCP Server (Node.js, port :8083 WebSocket)
  ├─ handlers/ — 33 MCP tool definitions
  ├─ state/    — Canonical scene state + undo stack
  ├─ chat/     — 9 AI provider integrations
  └─ ws/       — WebSocket broadcast + per-framework adapters
       ↓
  WebSocket broadcast to all connected clients
       ↓
┌────────┬────────┬────────┬────────┐
│Three.js│A-Frame │Babylon │ R3F    │
│:5173   │:5174   │:5175   │:5176   │
└────────┴────────┴────────┴────────┘

Key insight: Server maintains a single source of truth. Clients are views of that state, transformed per-framework.

Testing

Run the comprehensive test suite:

cd packages/server
pnpm test

30 tests across:

  • dispatch.test.ts — Command routing (13 tests)
  • scene.test.ts — Utility functions (11 tests)
  • integration.test.ts — Full pipeline (6 tests)

100% TypeScript type safety. Zero type errors.

Documentation

Contributing

We welcome contributions! See CONTRIBUTING.md.

  • Add framework support (PlayCanvas, Wonderland Engine, etc.)
  • Integrate additional AI providers
  • Improve tests and documentation
  • Share your 3D creations

License

MIT © Brendon Smith

Links


Made with ❤️ by the m{ai}geXR community

Talk to AI from inside your 3D world. 🚀✨