maya-mcp
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"maya": {
"args": [
"maya-mcp-server"
],
"command": "npx",
"env": {}
}
}
}
服务介绍
Maya MCP Server
A Model Context Protocol (MCP) server that enables AI assistants to connect to and control Autodesk Maya for 3D modeling, animation, and rendering operations. Built for seamless integration with AI systems through the standardized MCP protocol.
Features
- ** MCP Protocol Integration**: Full implementation of Model Context Protocol for seamless AI assistant integration
- ** Maya Command Port Communication**: Direct connection to Maya via command port (default port 7022)
- ** NPX Distribution**: Easy installation and startup via
npx maya-mcp-server - ** Auto-loading Maya Plugin**: Plugin automatically loads when Maya starts
- ** Comprehensive API**: Support for object creation, selection, transformation, scene queries, and Python execution
- ** Security**: Built-in command validation and filtering to prevent dangerous operations
- ** Multi-version Support**: Compatible with Maya 2023, 2024, and 2025
- ** Hot Reload**: Dynamic script loading and debugging capabilities
- ** Monitoring**: Health checks, performance metrics, and detailed logging
- ** Configuration**: Flexible configuration via files, environment variables, or CLI arguments
Quick Start
1. Install and Run via NPX (Recommended)
# Start the MCP server
npx maya-mcp-server
# Or with custom configuration
npx maya-mcp-server --host localhost --port 8765 --debug
2. Install Maya Plugin
Automatic Installation:
# Use the built-in installer
npx maya-mcp-server --install-plugin
# or
npm run install-plugin
Manual Installation:
# Windows
copy plug-ins/maya_mcp.py "%USERPROFILE%\Documents\maya\plug-ins\"
# macOS
cp plug-ins/maya_mcp.py ~/Library/Preferences/Autodesk/maya/plug-ins/
# Linux
cp plug-ins/maya_mcp.py ~/maya/plug-ins/
3. Start Maya
Launch Maya (2023-2025 supported). The MCP plugin will automatically load and start listening on port 7022.
Verify Plugin Loading:
- Check Maya's Script Editor for "Maya MCP Plugin loaded successfully"
- Or manually load via Window Settings/Preferences Plug-in Manager
4. Connect AI Assistant
Configure your AI assistant to connect to the MCP server:
For Smithery.ai:
{
"mcpServers": {
"maya": {
"command": "npx",
"args": ["maya-mcp-server"],
"env": {}
}
}
}
For other MCP clients:
- Server URL:
localhost:8765 - Protocol: MCP over stdio/WebSocket
- Available tools: 9 Maya operations
Installation
Via NPX (Recommended)
npx maya-mcp-server
Manual Installation
git clone https://github.com/your-username/maya-mcp-server.git
cd maya-mcp-server
pip install -r requirements.txt
python src/server.py
Configuration
Configuration File
Create a config.yaml file:
host: localhost
port: 8765
maya_port: 7022
debug: false
log_level: INFO
timeout: 30
Environment Variables
export MAYA_MCP_HOST=localhost
export MAYA_MCP_PORT=8765
export MAYA_MCP_MAYA_PORT=7022
export MAYA_MCP_DEBUG=true
Command Line Options
python src/server.py --host localhost --port 8765 --debug
Available Tools
maya_create
Create Maya objects (cubes, spheres, etc.)
{
"object_type": "polyCube",
"name": "myCube"
}
maya_select
Select objects by name
{
"objects": ["pCube1", "pSphere1"]
}
maya_execute
Execute Python commands in Maya
{
"command": "import maya.cmds as cmds; cmds.polyCube(name='scriptCube')"
}
maya_get_selection
Get currently selected objects
{}
maya_get_scene_info
Get detailed scene information
{}
Maya Plugin
The Maya plugin (plug-ins/maya_mcp.py) provides:
- Automatic loading when Maya starts
- Command port server on port 7022
- Safe Python command execution
- Scene state management
- Error handling and logging
Manual Plugin Loading
If the plugin doesn't auto-load:
import maya.cmds as cmds
cmds.loadPlugin("path/to/maya_mcp.py")
Development
Running Tests
pytest tests/
Debug Mode
python src/server.py --debug
Hot Reload
The server supports hot reloading of configuration and scripts without restart.
Supported Maya Versions
- Maya 2023
- Maya 2024
- Maya 2025
Requirements
- Python 3.8+
- Autodesk Maya 2023-2025
- MCP SDK
- aiohttp
- websockets
Security
The server includes security measures:
- Command validation and filtering
- Blocked dangerous operations
- Safe Python execution environment
- Connection authentication (optional)
Documentation
- Installation Guide - Detailed installation instructions for all platforms
- API Documentation - Complete API reference with examples
- Troubleshooting Guide - Solutions for common issues
- Examples - Code examples and use cases
Troubleshooting
For detailed troubleshooting information, see the Troubleshooting Guide.
Quick Fixes
- Maya Not Connecting: Ensure Maya is running and plugin is loaded
- Plugin Not Loading: Check plugin directory and Maya version compatibility
- Port Issues: Try alternative ports (7023, 7024, etc.)
- Server Won't Start: Verify Python 3.8+ and install dependencies
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
- GitHub Issues: Report bugs and request features
- Documentation: Full documentation
- Community: Discussions