# cuda4cpu

> cuda4cpu is an open-source MCP server for developer tools. Compile, run and check CUDA and HIP kernels on a CPU so agents can test GPU code. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** Linux, CLI, Self-hosted
- **Repository:** https://github.com/javier-cabezas/cuda4cpu
- **MCP Registry name:** io.github.javier-cabezas/cuda4cpu
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-15

## About

A coding agent on a machine without a GPU can write CUDA but cannot run it. cuda4cpu-mcp closes that gap: it compiles .cu files with GCC or Clang and runs the kernels as native code on every core, then reports problems at their source lines.

Beyond wrong results, the checks flag bugs that a GPU can hide: a missing __syncthreads(), threads of a block reaching different barriers, reads of unwritten memory, races and leaks. It reruns threads in reverse or random order, and uses AddressSanitizer and UBSan, to expose order-dependent bugs. The README says 140 of 166 programs from NVIDIA's cuda-samples, Rodinia and AMD's rocm-examples build unmodified and pass.

The server speaks MCP over stdio and runs locally, either from a release install or the Docker image, where it sees only directories you mount. It needs Linux or WSL 2 on x86-64.

## Features

- **Compile without nvcc:** Builds CUDA and HIP with a regular C++ compiler and no GPU.
- **Order-dependence checks:** Reruns thread order to expose missing barriers and races.
- **Sanitizer findings:** Reports memory errors and undefined behaviour at source lines.
- **Single-kernel testing:** Tests one kernel from a launch configuration against expected values or a C++ reference.
- **Capability report:** Tells the agent what is implemented so it can separate bugs from missing features.

## Good for

- Let an agent verify a kernel it just wrote
- Run CUDA tests in CI on hosted runners without GPUs
- Find a missing __syncthreads() before it reaches hardware
- Teach CUDA in a classroom with no GPUs

## Install

### Claude Code (Terminal)

```sh
claude mcp add cuda4cpu -- docker run -i --rm ghcr.io/javier-cabezas/cuda4cpu:0.6.1
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "cuda4cpu": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/javier-cabezas/cuda4cpu:0.6.1"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "cuda4cpu": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/javier-cabezas/cuda4cpu:0.6.1"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "cuda4cpu": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/javier-cabezas/cuda4cpu:0.6.1"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "cuda4cpu": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/javier-cabezas/cuda4cpu:0.6.1"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "cuda4cpu": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/javier-cabezas/cuda4cpu:0.6.1"
      ]
    }
  }
}
```

## Tools

- `compile`: Returns nvcc or hipcc diagnostics at source lines and unsupported features used.
- `run`: Returns the exit code, output and warnings.
- `check`: Returns a verdict and findings such as memory errors, races and divergent barriers.
- `test_kernel`: Tests one kernel from a launch configuration and expected values.
- `capabilities`: Lists what is and is not implemented.

## FAQ

### Does cuda4cpu need a GPU or the CUDA toolkit?

No. GCC or Clang compile the .cu files and kernels run on the CPU.

### What platform does cuda4cpu need?

Linux or WSL 2 on x86-64 with GCC 14 or later and Python 3, or the Docker image.

### Is HIP supported?

Yes, HIP code compiles too.

### How is cuda4cpu registered with Claude Code?

Run claude mcp add cuda4cpu -- cuda4cpu-mcp, or use the Docker command from the README.

### Is cuda4cpu free?

Yes. cuda4cpu is open source, so you can use and self-host it for free.

### How do I add cuda4cpu to Claude Code?

Run this command in your terminal: claude mcp add cuda4cpu -- docker run -i --rm ghcr.io/javier-cabezas/cuda4cpu:0.6.1

### What are the best alternatives to cuda4cpu?

The closest alternatives to cuda4cpu are NEPHIS MCP Server, Chrome DevTools MCP, stackcheck, MCP Test Utils and fleet.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [NEPHIS MCP Server](https://ai-powered.com/mcp/nephis-mcp-server): NEPHIS MCP Server is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-4): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [stackcheck](https://ai-powered.com/mcp/stackcheck): stackcheck is an open-source MCP server for developer tools.
- [MCP Test Utils](https://ai-powered.com/mcp/mcp-test-utils): MCP Test Utils is a free MCP server for developer tools.
- [fleet](https://ai-powered.com/mcp/fleet-2): fleet is an open-source MCP server for cloud and infrastructure.
- [Hotline Computer](https://ai-powered.com/mcp/hotline-computer): Hotline Computer is an MCP server for developer tools.
- [Linux MCP](https://ai-powered.com/mcp/linux-mcp): Linux MCP is an open-source MCP server for cloud and infrastructure.
- [mcp-debugger](https://ai-powered.com/mcp/mcp-debugger-2): mcp-debugger is an MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/cuda4cpu
