New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@infatoshi/gpu-mcp-server

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@infatoshi/gpu-mcp-server

Pure Node.js Model Context Protocol server for GPU CUDA compilation via Modal. No Python dependency - just install and run CUDA code on Modal GPUs.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

@infatoshi/gpu-mcp-server

Pure Node.js MCP server for compiling and running CUDA code on Modal's cloud GPUs. No Python dependencies - just install via NPM and run CUDA code on B200/H100 GPUs directly from Cursor or any MCP-compatible editor.

Features

  • Zero Python dependency - Pure Node.js implementation
  • Smart defaults - Auto-detects GPU architecture, entry files, and compilation flags
  • One command install - npm install -g @infatoshi/gpu-mcp-server
  • Minimal config - Only requires files_glob parameter
  • Auto-deployment - Deploys Modal app automatically on first use
  • Fast iteration - Modal caching speeds up repeated compilations

Prerequisites

  • Modal account with GPU access (sign up)
  • Modal CLI authenticated:
    pip install modal
    modal token new
    

Installation

npm install -g @infatoshi/gpu-mcp-server

Configuration

Add to your ~/.cursor/mcp.json or VS Code MCP config:

{
  "mcpServers": {
    "gpu-cuda": {
      "command": "gpu-mcp",
      "args": []
    }
  }
}

That's it! No environment variables needed - the server uses smart defaults.

Usage

Basic Usage

In Cursor, just ask the AI to compile your CUDA code:

"Compile and run vector_add.cu"

The MCP tool only requires one parameter:

  • files_glob: Pattern to match CUDA files (e.g., "*.cu", "src/**/*.cu")

Advanced Usage

Optional parameters for fine-tuned control:

{
  "files_glob": "kernels/*.cu",
  "project_root": "/path/to/project",  // Auto-detected if omitted
  "entry": "main.cu",                  // Auto-detected if omitted
  "arch": "sm_90",                     // Auto-detected from MODAL_GPU if omitted
  "extra_flags": ["-O3", "--use_fast_math"],
  "run_args": ["1000000"]
}

Environment Variables (Optional)

# GPU type (default: B200)
export MODAL_GPU=B200  # or H100, H200, A100

# Modal app name (default: cuda-kernel-runner)
export MODAL_APP=my-cuda-app

GPU Support

GPU TypeArchitectureCompute Capability
B200 (default)sm_10010.0
H100/H200sm_909.0
A100sm_808.0

How It Works

  • Smart Detection: Auto-detects entry file, GPU architecture, and compilation flags
  • File Collection: Gathers all CUDA files matching your glob pattern
  • Modal Deployment: Deploys the Modal app if not already deployed
  • GPU Compilation: Compiles on Modal's cloud GPUs with nvcc
  • Execution: Runs the compiled binary and returns output

Example

Create vector_add.cu:

#include <stdio.h>

__global__ void vectorAdd(float *a, float *b, float *c, int n) {
    int i = blockDim.x * blockIdx.x + threadIdx.x;
    if (i < n) c[i] = a[i] + b[i];
}

int main() {
    const int N = 1000000;
    // ... CUDA setup code ...
    vectorAdd<<<(N+255)/256, 256>>>(d_a, d_b, d_c, N);
    printf("Vector addition successful!\n");
    return 0;
}

In Cursor:

"Run vector_add.cu on GPU"

The server automatically:

  • Detects B200 GPU (sm_100 architecture)
  • Uses vector_add.cu as entry file
  • Compiles with -O3 --use_fast_math
  • Runs on Modal's B200 GPU
  • Returns compilation and execution logs

Troubleshooting

"Not authenticated with Modal"

modal token new

"Function not found"

  • The server will auto-deploy on first use
  • Check modal app list to verify deployment

Want to see what's happening?

  • Check stderr output for compilation and deployment logs
  • Modal dashboard shows function invocations

License

MIT

Author

infatoshi

Keywords

mcp

FAQs

Package last updated on 08 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts