Skip to main content
Glama
maya-mcp-server.py3.39 kB
#!/usr/bin/env python """ Maya MCP Server - uvx entry point Python script for starting the Maya MCP Server via uvx """ import sys import os import argparse from pathlib import Path # Add the src directory to Python path script_dir = Path(__file__).parent.absolute() project_root = script_dir.parent src_dir = project_root / "src" sys.path.insert(0, str(src_dir)) def main(): """Main entry point for uvx execution""" parser = argparse.ArgumentParser( description="Maya MCP Server - Connect AI assistants to Autodesk Maya", formatter_class=argparse.RawDescriptionHelpFormatter, epilog=""" Examples: maya-mcp-server # Start with default settings maya-mcp-server --debug # Start in debug mode maya-mcp-server --port 8766 # Start on custom port maya-mcp-server --maya-port 7023 # Connect to Maya on custom port For more information, visit: https://github.com/Jeffreytsai1004/maya-mcp """ ) parser.add_argument( "--host", default="localhost", help="Host to bind the server to (default: localhost)" ) parser.add_argument( "--port", type=int, default=8765, help="Port to run the server on (default: 8765)" ) parser.add_argument( "--maya-port", type=int, default=7022, help="Maya command port to connect to (default: 7022)" ) parser.add_argument( "--debug", action="store_true", help="Enable debug mode with verbose logging" ) parser.add_argument( "--log-level", choices=["DEBUG", "INFO", "WARNING", "ERROR"], default="INFO", help="Set logging level (default: INFO)" ) parser.add_argument( "--config", help="Path to configuration file" ) parser.add_argument( "--version", action="version", version="Maya MCP Server 1.1.2" ) args = parser.parse_args() try: # Import and run the server from server import main as server_main # Convert args to sys.argv format for server compatibility sys.argv = ["maya-mcp-server"] if args.host != "localhost": sys.argv.extend(["--host", args.host]) if args.port != 8765: sys.argv.extend(["--port", str(args.port)]) if args.maya_port != 7022: sys.argv.extend(["--maya-port", str(args.maya_port)]) if args.debug: sys.argv.append("--debug") if args.log_level != "INFO": sys.argv.extend(["--log-level", args.log_level]) if args.config: sys.argv.extend(["--config", args.config]) # Run the server import asyncio asyncio.run(server_main()) except KeyboardInterrupt: print("\nMaya MCP Server stopped by user") sys.exit(0) except ImportError as e: print(f"Error: Could not import server module: {e}") print("Please ensure all dependencies are installed: pip install -r requirements.txt") sys.exit(1) except Exception as e: print(f"Error starting Maya MCP Server: {e}") if args.debug: import traceback traceback.print_exc() sys.exit(1) if __name__ == "__main__": main()

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

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