Skip to main content
Glama
README.md
# nim-audit-mcp

MCP (Model Context Protocol) server for NVIDIA NIM container auditing. Enables AI assistants like Claude to audit NIM containers directly.

## Features

- **11 audit tools** exposed via MCP
- **Risk assessment** with severity scoring
- **Claude Desktop** integration ready
- **Self-contained** - minimal dependencies (nim-audit + mcp)
- **Zero configuration** - just install and use

## Dependencies

```
nim-audit-mcp
├── nim-audit    # Core NIM auditing library
├── mcp          # Model Context Protocol SDK
└── pydantic     # Data validation
```

That's it! No heavyweight frameworks or agents required.

## Installation

```bash
pip install nim-audit-mcp
```

Or from source:
```bash
git clone https://github.com/ashzak/nim-audit-mcp.git
cd nim-audit-mcp
pip install -e .
```

## Claude Desktop Setup

Add to your Claude Desktop config:

**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`  
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "nim-audit": {
      "command": "nim-audit-mcp",
      "args": []
    }
  }
}
```

Restart Claude Desktop.

## Available Tools

| Tool | Description |
|------|-------------|
| `gpu_compat` | Check GPU compatibility (A100, H100, etc.) |
| `diff_images` | Compare two container versions |
| `analyze_env` | Analyze environment variables |
| `lint_config` | Lint against security policies |
| `fingerprint` | Generate behavioral fingerprint |
| `fingerprint_compare` | Compare fingerprints |
| `cluster_scan` | Scan K8s cluster for compatibility |
| `env_lint` | Lint .env files |
| `env_diff` | Compare .env files |
| `env_describe` | Describe env variable |
| `env_registry` | List known NIM variables |

## Example Usage with Claude

**You:** Check if nvcr.io/nim/meta/llama3:latest is compatible with A100 GPUs

**Claude:** *executes gpu_compat tool and returns:*

```
## gpu_compat Results

**Risk Level:** LOW (Score: 0/100)

### Findings

🟢 **[INFO]** GPU A100 is compatible
   All compatibility checks passed for A100

### Recommendations

1. Safe to deploy with standard monitoring
```

## Other Examples

- "Compare nvcr.io/nim/meta/llama3:1.0 to :1.1"
- "Run security lint on nvcr.io/nim/meta/llama3:latest"
- "What does NIM_MAX_BATCH_SIZE do?"
- "List all NIM environment variables"

## Prerequisites

- Python 3.11+
- Docker (for container inspection)
- Claude Desktop (for Claude integration)

## Running Standalone

```bash
# Test the server
nim-audit-mcp
```

## Related

- [nim-audit-agent](https://github.com/ashzak/nim-audit-agent) - Full agent with CLI, API, and Web UI
- [nim-audit](https://github.com/ashzak/nim-audit) - Core auditing library
- [MCP Protocol](https://modelcontextprotocol.io/) - Model Context Protocol docs

## License

MIT