Maya MCP (Model Context Protocol)
Maya integration through the Model Context Protocol for Windsurf connectivity.
Installation
- Drag
install.mel
into Maya viewport - Click "Install" in the dialog
- Important: Restart Maya after installation
- The plugin should now be loaded automatically and the MCP menu should appear in Maya's menu bar
Uninstallation
- Drag
install.mel
into Maya viewport - Click "Uninstall" in the dialog
- The plugin will be unloaded and removed from auto-load
Manual Loading
If the plugin doesn't load automatically, you can load it manually in the Script Editor:
import sys
sys.path.append(r"D:/Dev/Tools/MayaMCP")
import maya.cmds as cmds
cmds.loadPlugin("d:/Personal/Document/maya/scripts/Maya_MCP/maya_mcp_plugin.py")
If the MCP menu doesn't appear, you can create it manually:
source "d:/Personal/Document/maya/scripts/Maya_MCP/install.mel";
forceMCPMenu();
Troubleshooting
- If you encounter any issues after installation, try restarting Maya
- Make sure the plugin directory is correctly set in your system
- Check Maya's Script Editor for any error messages
- Verify that all required files are present in the plugin directory
- If the menu doesn't appear, use the
forceMCPMenu()
function as described above - If you get connection errors in Windsurf, check the configuration in
mcp_config.json
Windsurf Configuration
The Windsurf configuration file is located at:
C:\Users\<username>\.codeium\windsurf\mcp_config.json
Make sure it has the following settings:
{
"mcpServers": {
"MayaMCP": {
"serverUrl": "http://127.0.0.1:4550/",
"sseEndpoint": "http://127.0.0.1:4550/",
"timeout": 10000,
"retryInterval": 1000,
"maxRetries": 10,
"debug": true,
"autoConnect": true
}
}
}
Testing
You can test the server connection using the provided test scripts:
# Test the server binding address
python Debug/check_server_binding.py
# Test the SSE connection
python Debug/test_sse_connection.py
These tests will help verify that the server is correctly bound to 127.0.0.1 and that SSE events are being properly transmitted.
Features
- Windsurf connectivity via SSE
- Scene information retrieval
- Maya integration
- FastAPI or HTTP server modes (automatic fallback)
Server Modes
The MCP server can run in two modes:
- FastAPI Mode (Default): Uses FastAPI and UVicorn for better performance and stability
- HTTP Mode (Fallback): Uses Python's built-in HTTP server if FastAPI is not available
The server automatically selects the best available mode. If FastAPI is installed, it will use that; otherwise, it will fall back to the HTTP server.
Configuration
The MCP server runs on port 4550 by default. Make sure this port is available and not blocked by a firewall.
Advanced: Using UVicorn and FastAPI
FastAPI and UVicorn are now the recommended server backend. They have been successfully tested with Maya 2025 and provide better performance and stability.
Installing with Maya's Python (mayapy)
You can install FastAPI and UVicorn directly using Maya's Python interpreter:
# For Windows
"C:\Program Files\Autodesk\Maya2023\bin\mayapy.exe" -m pip install fastapi uvicorn
# For macOS
/Applications/Autodesk/maya2023/Maya.app/Contents/bin/mayapy -m pip install fastapi uvicorn
# For Linux
/usr/autodesk/maya2023/bin/mayapy -m pip install fastapi uvicorn
This will install the packages directly into Maya's Python environment, ensuring they are available when running the MCP server from within Maya.
Offline Installation
If you want to install FastAPI and UVicorn in an environment without internet access:
# In an environment with internet access, download dependencies
python -m pip download uvicorn fastapi -d ./packages
# In the target environment, install
python -m pip install --no-index --find-links=./packages uvicorn fastapi
License
Copyright (c) Jeffrey Tsai