npm package: @pulumi/mcp-server
Description: A server implementing the Model Context Protocol for Pulumi.
Author: Pulumi Corporation
Latest version: 0.2.0

# Pulumi MCP Server

<a href="https://glama.ai/mcp/servers/@pulumi/mcp-server">
  <img width="380" height="200" src="https://glama.ai/mcp/servers/@pulumi/mcp-server/badge" />
</a>

The Pulumi MCP Server enables advanced Infrastructure as Code development capabilities for connected agents.

## Features

### Available Tools

| Tool | Description |
|------|-------------|
| `pulumi-registry-list-resources` | Browse available cloud resources to discover what infrastructure components can be deployed |
| `pulumi-registry-list-functions` | Explore available provider functions for interacting with cloud resources |
| `pulumi-registry-get-resource` | Get code examples and documentation for specific resources that can be deployed |
| `pulumi-registry-get-function` | Access examples of provider functions for usage in your Pulumi program |
| `pulumi-registry-get-type` | Get schema definitions needed to properly set up complex resource properties and types |
| `pulumi-cli-preview` | Preview infrastructure changes before deployment, showing what resources will be created, updated, or deleted |
| `pulumi-cli-up` | Deploy infrastructure changes to the cloud, creating and updating resources as defined in your Pulumi program |
| `pulumi-cli-stack-output` | Retrieve deployment outputs like URLs and resource IDs from your infrastructure stacks |
| `pulumi-cli-refresh` | Sync your Pulumi state with actual cloud resources to detect drift and manual changes |
| `pulumi-resource-search` | Discover, count, and analyze your deployed infrastructure across all cloud providers. |
| `neo-task-launcher` | Interact with Pulumi Neo for advanced infrastructure tasks |

### Available Prompts

| Prompt | Description |
|--------|-------------|
| `deploy-to-aws` | Get step-by-step guidance for deploying already written applications to the cloud with Pulumi, including security and cost optimization tips |

## Installation

### Requirements

1. **[Pulumi CLI](https://www.pulumi.com/docs/cli/)** must be installed on the client machine
2. **[Docker](https://www.docker.com/)** (optional) - Required only for containerized deployment

### Usage with Claude Code

For [Claude Code](https://claude.ai/code), install the MCP server using:

```bash
claude mcp add -s user pulumi -- npx @pulumi/mcp-server@latest stdio
```

### Usage with Claude Desktop

For Claude Desktop, add the following configuration to your MCP config file:

```json
{
  "mcpServers": {
    "pulumi": {
      "command": "npx",
      "args": ["@pulumi/mcp-server@latest", "stdio"]
    }
  }
}
```

### Usage with VSCode

Create a file called `.vscode/mcp.json` in your workspace. Add the following section, and the MCP will become accessible to your assistant:

```json
{
  "servers": {
    "pulumi": {
      "command": "npx",
      "args": ["@pulumi/mcp-server@latest", "stdio"]
    }
  }
}
```

Alternatively, you can add the following to your user configuration and be able to use the MCP server everywhere. You can open the configuration by pressing `Ctrl + Shift + P` and typing `Preferences: Open User Settings (JSON)`:

```json
{
  "mcp": {
    "servers": {
      "pulumi": {
        "command": "npx",
        "args": ["@pulumi/mcp-server@latest", "stdio"]
      }
    }
  }
}
```

### Devin

For [Devin](https://app.devin.ai), you can set up the Pulumi MCP Server by:

1. Navigating to https://app.devin.ai/settings/mcp-marketplace/setup/pulumi
2. Providing your Pulumi access token, which can be obtained from the Access tokens section in the sidebar of the Pulumi dashboard
3. Clicking "Enable"

More about using the MCP server with other popular clients: [Pulumi MCP Server Documentation](https://www.pulumi.com/docs/iac/using-pulumi/mcp-server/).

## Docker Installation

The Pulumi MCP Server can additionally be run as a Docker container, eliminating the need to install Node.js and package dependencies directly on your host machine.

### Using the Official Image

Pull the official image built by Docker:

```bash
docker pull mcp/pulumi:latest
```

### Building Locally

Or build the container with local changes:

```bash
docker build -t pulumi/mcp-server:latest .
```

### Usage With Agents

**STDIO Mode**

Run the server in basic STDIO configuration:

```json
{
  "mcpServers": {
    "pulumi": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "PULUMI_ACCESS_TOKEN=your-access-token",
        "mcp/pulumi:latest", "stdio"
      ]
    }
  }
}
```

**With Local Project Access**

For Pulumi CLI operations that require access to local projects and their files, mount the project directory:

```json
{
  "mcpServers": {
    "pulumi": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-v", "~/projects/my-pulumi-app:/app/project",
        "-e", "PULUMI_ACCESS_TOKEN=your-access-token",
        "mcp/pulumi:latest", "stdio"
      ]
    }
  }
}
```

### Using with MCP Clients over HTTP

The Pulumi MCP server supports HTTP transport for web-based integrations. Since most MCP clients expect STDIO communication, you can use a transport bridge like [supergateway](https://github.com/supercorp-ai/supergateway) to connect STDIO-based clients to HTTP servers.

#### Quick Start Script

Use the provided script to build and run the HTTP server:

```bash
./scripts/docker-run-http.sh
```

This script builds the Docker image and starts the container in HTTP mode on port 3000.

#### Bridge Configuration for Claude Desktop

To connect Claude Desktop (which uses STDIO) to the HTTP server, copy the following configuration:

```json
{
  "mcpServers": {
    "pulumi": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "supercorp/supergateway",
        "--streamableHttp",
        "http://host.docker.internal:3000/mcp"
      ]
    }
  }
}
```

This configuration:
- Runs the MCP bridge in a Docker container
- Connects to your HTTP server using `host.docker.internal` (Docker's host machine reference)
- Bridges STDIO ↔ HTTP communication
- Handles session management automatically

### Environment Variables

| Variable | Description | Default | Required |
|----------|-------------|---------|----------|
| `PULUMI_ACCESS_TOKEN` | Pulumi Cloud access token | `""` | For resource deployment & insights |

> **Notes:**
> - When mounting local directories, reference the project as `/app/project` in your MCP tool requests
> - Mount `~/.pulumi` to preserve Pulumi CLI configuration and credentials
> - Add cloud provider credential volumes and environment variables as needed for your deployments