Skip to content

jph2/USDcodeNIM_MCP

Repository files navigation

arys_schema_version id title type status trust_level created last_modified
1.2
b1c4c143-c78e-405f-9e99-40eec1d23dc2
USDcodeNIM_MCP
TECHNICAL
active
2
2026-02-17T09:42:16Z
2026-02-17T09:42:16Z

Version: 1.0.0 | Date: 16.02.2026 | Time: 12:00 | GlobalID: 20260216_1200_USDcodeNIM_MCP_batch

Tag block: #framework_integration #stage #v_model #aas_integration #cursor #vscode #validation #specializes #mcp_protocol #usd_core #opencode #openusd #semantic_governance #export #workflow_automation #ai_coding_agents #quality_assurance #deterministic_workflows #best_practices

USDcodeNIM_MCP

NVIDIA NIM (NVIDIA Intelligent Model) integration for Cursor IDE, specifically configured for USD (Universal Scene Description) code generation and validation.

Overview

This repository provides tools and configurations to integrate NVIDIA's specialized USD code model into Cursor IDE through the Model Context Protocol (MCP). It enables:

  • USD Code Generation using NVIDIA's specialized USD code model
  • Automated Code Validation with structured feedback
  • USD-Specific Suggestions and best practices
  • Double-Checking generated code for errors and improvements

Quick Start

  1. Get your API key

    1. from build.nvidia.com/nvidia/usdcode

    Navigate to the NVIDIA NIM platform and search for "USD code" or "usdcode" in the model catalog. Once you find the USD code model, sign in or create an account to access your API key. The API key will be displayed on the model's page after authentication.

    1. Set environment variable:
    $env:NIM_API_KEY = "your_api_key_here"  # Windows PowerShell
    set NIM_API_KEY=your_api_key_here  # Windows CMD
    export NIM_API_KEY=your_api_key_here  # Linux/Mac
    1. Install dependencies:
    pip install -r scripts/requirements_nim.txt
    1. Test the integration:
    python scripts/nim_mcp_server.py test

2. Configure Cursor

Open Cursor and click the cog wheel icon in the upper right corner to access settings. Select Cursor Settings, then navigate to Tools & MCP. Click Add a new MCP server and paste the following JSON configuration into the file:

{
  "mcpServers": {
    "nvidia-nim": {
      "command": "python",
      "args": ["C:\\path\\to\\USDcodeNIM_MCP\\scripts\\nim_mcp_server.py"],
      "env": {
        "NIM_API_KEY": "your_api_key_here",
        "NIM_MODEL": "nvidia/usdcode-llama-3.1-70b-instruct"
      }
    }
  }
}

Make sure to update the path to match your repository location and replace your_api_key_here with your actual API key.

  1. Restart Cursor Close and reopen Cursor completely.

  2. Verify Connection Settings → Tools & MCP → Check nvidia-nim is green

💡 Documentation Hierarchy:


Repository Structure

USDcodeNIM_MCP/
├── scripts/
│   ├── nim_mcp_server.py      # MCP server wrapper for Cursor integration
│   ├── nim_direct_client.py    # Direct client for standalone use
│   ├── validate_with_nim.py   # Validation script for USD Python files
│   ├── requirements_nim.txt    # Python dependencies
│   └── README_NIM.md          # Quick reference guide
├── config/
│   └── cursor_mcp_config.json  # Cursor MCP configuration template
├── docs/
│   └── NVIDIA_NIM_Integration_Guide.md  # Complete setup documentation
└── README.md                  # This file

Features

1. MCP Server Integration

Full Cursor IDE integration through Model Context Protocol, providing USD code generation and validation tools.

2. Direct Client

Standalone Python client for use in scripts, CI/CD pipelines, or other tools.

3. Code Validation

Automated validation of USD Python code with structured feedback (errors, warnings, suggestions).

4. Code Generation

Generate USD code from natural language prompts using NVIDIA's specialized model.

Usage

Using in Cursor (Recommended) ✨

Once configured, use NVIDIA NIM directly in Cursor's chat:

Generate USD Code:

Generate a USD Python script that creates a red cube mesh

Validate USD Code:

Validate this USD script using NVIDIA NIM

(With a USD file open)

Ask USD Questions:

What's the best way to create a USD stage?

Standalone Validation

python scripts/validate_with_nim.py path/to/usd_script.py
python scripts/validate_with_nim.py path/to/usd_script.py --context "Asset validation script"

Code Generation

python scripts/nim_direct_client.py "Create a USD stage with a cube mesh"

Programmatic Use

from scripts.nim_direct_client import NIMDirectClient
import asyncio

async def main():
    client = NIMDirectClient()
    
    # Generate code
    code = await client.generate_code("Create a USD stage")
    print(code)
    
    # Validate code
    result = await client.validate_code(code)
    print(result)
    
    await client.close()

asyncio.run(main())

Cursor MCP Configuration

To integrate with Cursor IDE:

  1. Get your API key from build.nvidia.com/nvidia/usdcode
  2. Edit your MCP config: C:\Users\<username>\.cursor\mcp.json
  3. Add the NVIDIA NIM server configuration from config/cursor_mcp_config.json
  4. Update the path in the config to match your repository location
  5. Set your API key in the env.NIM_API_KEY field
  6. Set model name: nvidia/usdcode-llama-3.1-70b-instruct
  7. Restart Cursor completely

Quick Setup:

{
  "mcpServers": {
    "nvidia-nim": {
      "command": "python",
      "args": ["C:\\path\\to\\USDcodeNIM_MCP\\scripts\\nim_mcp_server.py"],
      "env": {
        "NIM_API_KEY": "your_api_key_here",
        "NIM_MODEL": "nvidia/usdcode-llama-3.1-70b-instruct"
      }
    }
  }
}

Need more help?

Requirements

  • Python 3.10+
  • httpx library (install via pip install -r scripts/requirements_nim.txt)
  • NVIDIA NIM API key from build.nvidia.com
  • Cursor IDE (for MCP integration)

Documentation

Documentation Hierarchy:

  1. README.md (you are here) → Quick Start with basic setup instructions
  2. QUICK_REFERENCE.md → More depth, troubleshooting, examples, and common commands
  3. Complete Guide → Comprehensive documentation with everything described in detail

Additional Resources:

Resources

License

This project is provided as-is for integration with NVIDIA NIM services.


Version: 1.0.0
Last Updated: 2025-11-21

About

An MCP for Cursor from the NVIDIA USDcodeNIM | https://build.nvidia.com/nvidia/usdcode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages