Skip to main content
Glama
chadrik

maya-mcp-server

by chadrik

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{
  "tasks": {
    "list": {},
    "cancel": {},
    "requests": {
      "tools": {
        "call": {}
      },
      "prompts": {
        "get": {}
      },
      "resources": {
        "read": {}
      }
    }
  }
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_sessionsA

List all active Maya sessions.

Returns a list of session information including:

  • session_key: Session key used to interact with tools and resources

  • host: Session host address

  • port: Session port number

  • pid: Maya process ID

  • user: Logged-in user

  • maya_version: Maya version string

  • scene_name: Current scene filename

  • scene_path: Full path to current scene

Note: To detect new or removed sessions, clients should call this tool periodically (e.g., every 10-30 seconds) and compare results. The SessionManager automatically scans for new Maya sessions in the background.

write_moduleA

Create a virtual Python module in a Maya session.

Args: name: Module name. Can be a dotted path (e.g., 'mypackage.utils') in which case parent packages are created automatically. code: Python source code for the module. overwrite: If True, replace existing module. If False, raise error if module already exists. session_key: Session key (optional if only one session exists)

Returns: Success message

Example: write_module("mytools", ''' import maya.cmds as cmds

def create_cube(name="cube1"):
    return cmds.polyCube(name=name)[0]
''')

# Then use it:
execute_code("import mytools; mytools.create_cube('myCube')")
execute_codeA

Execute Python code in a Maya session.

Args: code: Python code to execute. result_type: How to handle the result: - "NONE": Execute statements, don't capture result - "JSON": Evaluate expression, JSON encode result - "RAW": Evaluate expression, return string representation session_key: Session key (optional if only one session exists)

Returns: Captured result (None if result_type is NONE)

Note: stdout and stderr are delivered in real-time via MCP Resource subscriptions (maya://sessions/{session_key}/stdout and /stderr). Call get_output() to retrieve buffered output.

Example: # Execute statements execute_code("import maya.cmds as cmds; cmds.polyCube()")

# Get JSON result
execute_code("cmds.ls(type='mesh')", result_type="JSON")
add_sessionA

Manually add a Maya session at a specific host and port.

Use this when auto-discovery doesn't find your Maya session, or to connect to a Maya instance on a specific port.

Args: host: The session host (default: "127.0.0.1") port: The session port number (default: 7001)

Returns: Session information for the added session

Before using this, ensure Maya has a Python command port open. In Maya's Script Editor (Python), run: import maya.cmds as cmds cmds.commandPort(name=':7001', sourceType='python')

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

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/chadrik/maya-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server