x3d-mcp
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., "@x3d-mcpcreate a simple X3D scene with a sphere"
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.
x3d-mcp
This project has been adopted by the Web3D Consortium. Development continues at Web3DConsortium/x3d_mcp, the official MCP server for X3D under the AI with X3D Special Interest Group. This repository is preserved as the origin implementation and for publication credit.
An MCP server that gives AI models the ability to validate, look up, generate, analyze, and render X3D content.
X3D (Extensible 3D Graphics) is the ISO standard (ISO/IEC 19775) for representing 3D scenes and objects in XML. The Model Context Protocol (MCP) is a standard that lets AI models call external tools. This server bridges the two: it exposes 24 tools and 4 workflow prompts that let an AI work with X3D using authoritative spec data rather than training-data guesses, produce schema-valid output, animate it, and render it in a browser.
Features
Validation -- Validate X3D content against the official X3D 4.0 XML Schema (26,000+ line XSD), catching invalid nodes, wrong attribute types, and hierarchy violations
Semantic Checks -- Catch real-world authoring bugs that XSD can't: missing geometry on shapes, empty grouping nodes, broken DEF/USE references, duplicate DEF names, ROUTEs with invalid fields or mismatched types, and missing viewpoints
Spec Lookup -- Query the full X3D Unified Object Model: 200+ concrete nodes, field types with constraints, inheritance chains, component/profile browsing, and parent-child hierarchy checking. Node and field descriptions are enriched at startup with human-readable authoring guidance — Hints and Warnings — sourced from the official X3D-Edit tooltip profile (
x3d-4.0.profile.xml)Scene Generation -- Programmatically create X3D content via the official x3d.py library (X3DPSAIL), manipulate scenes with targeted node insertion, and convert to standalone X3DOM HTML pages for browser rendering
Scene Manipulation -- Complete CRUD on existing scenes: modify field values on DEF'd nodes, remove nodes by DEF or type+index, and reparent nodes with cycle detection
Animation & Interaction -- Auto-generate full TimeSensor + Interpolator + ROUTE chains from a target DEF and field name (the correct interpolator is selected based on the field's type), validate and insert individual ROUTEs with full type/access-type checking, and look up animation reference docs
File Operations -- Parse existing X3D scenes into readable tree views, get node statistics by type and component, list all named (DEF'd) nodes, and extract specific node subtrees
Guided Workflows -- MCP prompts for common multi-step tasks: building a scene from scratch, auditing an existing file, animating a scene, and converting to X3DOM
Related MCP server: Rodin Gen-2 MCP Server
Quickstart
Prerequisites: Python 3.12+, uv
git clone <repo-url>
cd x3d-mcp
uv syncThe server uses stdio transport and is designed to be launched by an MCP client (see configuration below), not run standalone. To verify it starts correctly:
uv run python server.pyMCP Inspector
You can test the server interactively using the MCP Inspector, which is bundled with the mcp[cli] dependency:
uv run mcp dev server.pyThis opens a web UI where you can call each tool, see input schemas, and inspect responses.
MCP Client Configuration
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"x3d": {
"command": "uv",
"args": ["run", "python", "server.py"],
"cwd": "/absolute/path/to/x3d-mcp"
}
}
}Cursor
Add to .cursor/mcp.json in your project root. Use uv run --directory to point at the x3d-mcp project (this is more reliable than cwd, especially with paths containing spaces):
{
"mcpServers": {
"x3d": {
"command": "uv",
"args": ["run", "--directory", "/absolute/path/to/x3d-mcp", "python", "server.py"]
}
}
}Replace /absolute/path/to/x3d-mcp with the actual path to this repository. If Cursor can't find uv, use the full path (e.g., /opt/homebrew/bin/uv on macOS).
Tools
Validation
Tool | Parameters | Description |
|
| Validate an X3D XML string against the X3D 4.0 schema |
|
| Validate a |
Spec Lookup
Tool | Parameters | Description |
|
| Get full spec info for a node: fields, types, defaults, constraints, inheritance |
|
| Search nodes by name or description |
|
| List all components, or all nodes in a specific component |
| -- | List all X3D profiles with descriptions |
|
| Explain a field type (e.g. |
|
| Check if a parent-child node relationship is valid |
Scene Generation
Tool | Parameters | Description |
|
| Generate a complete, valid X3D scene template |
|
| Generate a single X3D node XML fragment |
|
| Insert a node into an existing scene |
|
| Wrap X3D content in a standalone X3DOM HTML page |
| -- | Generate a ready-to-open X3DOM page with an example scene |
File Operations
Tool | Parameters | Description |
|
| Parse and display the scene graph as an indented tree |
|
| Get statistics: node counts by type and X3D component |
|
| List all DEF'd (named) nodes with parent/children context |
|
| Extract a specific node subtree as XML |
Scene Manipulation
Tool | Parameters | Description |
|
| Update attribute values on a DEF'd node |
|
| Remove a node (and its children) by DEF or by type+index |
|
| Reparent a node to a new parent (or to |
Semantic Validation
Tool | Parameters | Description |
|
| Run authoring checks beyond XSD: shape completeness, empty groups, duplicate DEFs, broken USE refs, ROUTE validity (DEF refs + field names + access types + type matching), missing viewpoint |
Animation & Interaction
Tool | Parameters | Description |
|
| Generate a complete animation chain (TimeSensor + correct Interpolator + 2 ROUTEs) for a target field and insert it into the scene |
|
| Validate (DEF existence, field existence, accessType compatibility, type matching) and insert a ROUTE statement |
|
| Reference documentation for X3D's event-driven animation system |
Prompts
Prompt | Parameters | Description |
|
| Step-by-step guide to build an X3D scene from scratch |
|
| Guide to analyze and audit an existing X3D file (now includes semantic check step) |
| -- | Guide to convert X3D content into a browser-viewable HTML page |
|
| Step-by-step guide to add animation to an X3D scene |
Common Workflows
Build a 3D scene
1. x3d_scene_template(profile="Interchange", title="My Scene")
2. x3d_node_info("Sphere") -- check available fields
3. x3d_generate_node("Sphere", '{"radius": 2.5}') -- create geometry
4. x3d_add_node(scene_xml, node_xml) -- insert into scene
5. validate_x3d(scene_xml) -- verify against schema
6. x3dom_page(scene_xml, title="My Scene") -- render in browserAudit an existing X3D file
1. x3d_parse_scene("/path/to/model.x3d") -- see the scene graph tree
2. x3d_scene_stats("/path/to/model.x3d") -- get node counts by type/component
3. x3d_list_defs("/path/to/model.x3d") -- list all named nodes
4. validate_x3d_file_tool("/path/to/model.x3d") -- check schema compliance
5. x3d_semantic_check("/path/to/model.x3d") -- catch authoring bugs (broken ROUTEs, etc.)
6. x3d_extract_node("/path/to/model.x3d", def_name="SomeNode") -- inspect specific nodesModify and animate an existing scene
1. x3d_list_defs(scene_xml) -- find DEF names to target
2. x3d_modify_node(scene_xml, "RedMat",
'{"diffuseColor": "0 1 0"}') -- recolor a material
3. x3d_animation_info("interpolators") -- reference: which interp matches the field
4. x3d_animate(scene_xml, target_def="MyTransform",
field_name="rotation",
from_value="0 1 0 0",
to_value="0 1 0 6.283",
duration=4.0, loop=True) -- spin a transform around Y
5. x3d_semantic_check(scene_xml) -- verify ROUTEs are correctly wired
6. x3dom_page(scene_xml, title="Animated") -- render in browserExample: X3D input/output
A minimal X3D scene with a red sphere:
<?xml version="1.0" encoding="UTF-8"?>
<X3D profile="Interchange" version="4.0">
<Scene>
<Viewpoint description="Front" position="0 0 10"/>
<Shape>
<Appearance>
<Material diffuseColor="1 0 0"/>
</Appearance>
<Sphere radius="2"/>
</Shape>
</Scene>
</X3D>Key X3D patterns:
Shape = Appearance (Material + optional Texture) + Geometry (Box, Sphere, Cylinder, etc.)
Transform wraps children with translation, rotation, and scale
DEF/USE names let you define a node once and reuse it
SFColor is 3 floats in [0,1] range (e.g.,
1 0 0= red)SFRotation is axis-angle:
x y z angle_in_radians
Architecture
flowchart TD
Server["server.py\n24 MCP tools + 4 prompts"] --> Validation["src/validation.py\nxmlschema"]
Server --> SpecLookup["src/spec_lookup.py\nquery functions"]
Server --> Generation["src/generation.py\nx3d.py + lxml"]
Server --> FileOps["src/file_ops.py\nparse + analyze"]
Server --> SceneOps["src/scene_manipulation.py\nmodify / remove / move"]
Server --> Semantic["src/semantic_check.py\nauthoring checks"]
Server --> Animation["src/animation.py\nTimeSensor + Interp + ROUTE"]
SpecLookup --> X3DUOM["src/x3duom_loader.py\nin-memory index"]
FileOps --> X3DUOM
Semantic --> X3DUOM
Animation --> X3DUOM
SceneOps --> FileOps
Semantic --> FileOps
Animation --> FileOps
Validation --> XSD["spec/x3d-4.0.xsd"]
X3DUOM --> UOM["spec/X3dUnifiedObjectModel-4.0.xml"]
X3DUOM --> Tooltips["src/tooltip_loader.py\ntooltip enrichment"]
Tooltips --> Profile["wiki/x3d-4.0.profile.xml\nX3D-Edit authoring profile"]
Generation --> ValidationFile | Role |
| MCP entry point. Registers all 24 tools and 4 prompts with |
| Loads the X3D 4.0 XSD via |
| Parses the 43,000-line X3DUOM XML into in-memory dictionaries. Resolves full inheritance chains to collect all fields for any node. At load time calls |
| Parses |
| Query layer over the X3DUOM index: node info, search, component/profile listing, field type documentation, hierarchy checking with inheritance-aware type matching. |
| Constructs X3D nodes via the official x3d.py (X3DPSAIL) library, manipulates scene trees with lxml, and converts X3D XML to X3DOM-compatible HTML (lowercase tags, explicit closing tags, namespace stripping). |
| Reads and analyzes existing X3D content: scene graph tree view, statistics by type/component, DEF node listing, and node extraction. Exposes |
| Completes the CRUD cycle for X3D scenes: modify field values on DEF'd nodes, remove nodes by DEF or type+index, and reparent nodes with cycle detection. |
| Authoring-level checks beyond XSD: shape completeness, empty grouping nodes, duplicate DEFs, DEF/USE consistency, ROUTE validity (DEF refs + field names + access types + type matching), and missing viewpoints. |
| Auto-generates TimeSensor + Interpolator + ROUTE chains for animations (the correct interpolator is selected from the target field's type via X3DUOM lookup), validates and inserts individual ROUTEs, and provides reference documentation for X3D's event-driven animation system. |
| Bundled official spec files: X3D 4.0 XSD (with Web3D extension schemas) and the X3D Unified Object Model XML. |
| X3D-Edit authoring profile from the Web3D Consortium (Don Brutzman). Contains rich tooltip text for every X3D 4.0 node and attribute — used by |
Development
Install all dependencies including dev tools:
uv sync --group devRun the test suite:
uv run pytestThere are currently 171 tests across seven test files:
Test file | Count | Covers |
| 8 | Schema validation of valid/invalid documents, XSI attribute stripping, file handling, edge cases |
| 31 | X3DUOM loading, node info, search, components, profiles, field types, hierarchy checking |
| 26 | Scene templates, node generation, scene composition, X3DOM page output, HTML escaping |
| 36 | Scene parsing, statistics, DEF listing, node extraction, file path handling |
| 26 | Modify, remove, and move nodes; cycle detection; round-trip schema validation |
| 19 | Shape completeness, empty groups, duplicate DEFs, DEF/USE consistency, ROUTE validity, missing viewpoint |
| 25 | Animation chain generation for rotation/translation/color/scalar fields, ROUTE validation, animation reference docs |
Adding a New Tool
Implement the function in the appropriate
src/moduleRegister it in
server.pywith the@mcp.tool()decoratorWrite a detailed docstring -- the AI model sees this as the tool description
Add tests in the corresponding
tests/test_*.pyfile
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.
Latest Blog Posts
- 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/niknarra/x3d-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server