Three.js MCP Triangle
Provides tools to control a Three.js triangle rendered in the browser, including setting solid color, per-vertex colors, and transform (position, rotation, scale).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Three.js MCP TriangleMake the triangle solid orange."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Three.js MCP Triangle
A colored Three.js triangle rendered in the browser that you control through an MCP (Model Context Protocol) server. The server exposes tools to change the triangle's color and transform (position, rotation, scale). State changes are pushed live to the browser over a WebSocket.
MCP client (Claude / VS Code Copilot)
│ stdio (MCP protocol)
▼
MCP server (src/index.js) ── thin proxy
│ HTTP POST /api/state
▼
Web server (src/web-server.js) ── owns the state
│ WebSocket push (state changes)
▼
Browser → http://localhost:3000 → Three.js triangleTwo processes, one shared state. The web server owns the triangle state and
serves the browser; the MCP server is a thin proxy that POSTs to it. This is why
the MCP tools and the browser stay in sync even though your MCP client spawns
the MCP server in a separate process from npm start.
Where do I type prompts? In your MCP client's chat (e.g. VS Code Copilot Chat in Agent mode) — not in the terminal. The terminal running
npm startis the web server; the terminal is not a prompt box.
Project structure
Path | Purpose |
| Standalone server: owns state, serves viewer, WS + HTTP API |
| MCP server — thin proxy that calls the web server's HTTP API |
| Shared triangle state + change subscriptions |
| Three.js scene that renders and live-updates the triangle |
| VS Code MCP server configuration |
Related MCP server: threlte-mcp
Requirements
Node.js 18+
Install
npm installRun
Step 1 — start the web server (leave it running):
npm startThen open http://localhost:3000 to see the triangle. Change the web port with
the PORT environment variable (default 3000).
Step 2 — connect an MCP client (see below). The MCP server is launched by
your client, not by npm start. It proxies to the web server via the WEB_URL
environment variable (default http://localhost:3000).
Type your prompts in the MCP client's chat, not in the terminal.
Using it as an MCP server
VS Code (GitHub Copilot)
The included .vscode/mcp.json registers the server. First
run npm start in a terminal, then open the Copilot Chat view, switch to
Agent mode, and the threejs-triangle tools become available. Open
http://localhost:3000 in a browser to watch changes apply in real time.
Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"threejs-triangle": {
"command": "node",
"args": ["src/index.js"],
"cwd": "d:/Learning/ThreeJs_MCP",
"env": { "WEB_URL": "http://localhost:3000" }
}
}
}Run npm start first, restart Claude Desktop, then open
http://localhost:3000 in a browser.
Exposed tools (the API)
set_color
Set one solid color for the whole triangle.
Param | Type | Description |
| string | Hex color, e.g. |
set_vertex_colors
Set the three vertex colors individually to create a gradient.
Param | Type | Description |
| string | Top vertex color |
| string | Bottom-left vertex color |
| string | Bottom-right vertex color |
set_transform
Set position, rotation (degrees), and/or scale. Any omitted axis keeps its current value.
Param | Type | Description |
|
| World position |
|
| Rotation in degrees |
|
| Uniform scale, or per-axis scale |
get_state
Returns the current triangle state (vertex colors + transform).
reset
Resets to defaults: red/green/blue vertices and identity transform.
Example prompts
Once the server is connected in your MCP client, try:
"Make the triangle solid orange."
"Set the vertex colors to red, green and blue."
"Rotate the triangle 45 degrees on the Z axis and scale it to 1.5."
"Move the triangle to x: 1, y: -0.5."
"Reset the triangle."
How it works
state.jsholds a singleTriangleStateobject and a set of subscribers.web-server.js(run vianpm start) owns the state, servespublic/index.html, exposes the HTTP API (GET/POST /api/state,POST /api/reset), and broadcasts every change to connected browsers over WebSocket. New tabs receive the current state on connect.index.jsis the MCP server your client spawns. Each tool calls the web server's HTTP API — it holds no state itself. This keeps the browser and the tools in sync across the two processes.public/index.htmlbuilds aBufferGeometrytriangle with per-vertex colors and applies incoming state to the mesh's color attribute and transform.
Note: MCP uses stdout for its protocol, so the MCP server writes all logs to stderr (
console.error). The web server is a normal process and logs to stdout.
Troubleshooting: If tools report "Could not reach the triangle web server", make sure
npm startis running. If you seeEADDRINUSEon port 3000, another process already holds it — stop it or set a differentPORT(and matchingWEB_URL).
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseBqualityCmaintenanceAn MCP server that bridges AI clients with a frontend 3D visualization application to control model properties, lighting, and camera settings via WebSocket. It enables real-time manipulation of 3D scenes through natural language commands for scaling, rotating, and coloring models.Last updated61
- Alicense-qualityDmaintenanceAn MCP server for inspecting and manipulating Three.js/Threlte scenes in real-time.Last updated338MIT
- AlicenseAqualityBmaintenanceMCP server for inspecting and modifying Three.js scenes in real time — 59 tools for objects, materials, shaders, textures, animations, performance monitoring, memory diagnostics, and code generation.Last updated6014881MIT
- Flicense-qualityBmaintenanceEnables remote desktop control with screen capture and mouse/keyboard simulation through an MCP server exposed via a WebSocket tunnel.Last updated
Related MCP Connectors
Generate, edit, and deploy immersive 3D/WebGL web projects from any MCP assistant.
Educational MCP server with 17 math/stats tools, visualizations, and persistent workspace
Build, deploy, and operate hosted web apps on VibeKit (vibekit.bot) from any MCP client.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/MithunTagde/Three.js-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server