@pulumi/mcp-server
v0.2.0
Published
A server implementing the Model Context Protocol for Pulumi.
Readme
Pulumi MCP Server
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
- Pulumi CLI must be installed on the client machine
- Docker (optional) - Required only for containerized deployment
Usage with Claude Code
For Claude Code, install the MCP server using:
claude mcp add -s user pulumi -- npx @pulumi/mcp-server@latest stdioUsage with Claude Desktop
For Claude Desktop, add the following configuration to your MCP config file:
{
"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:
{
"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):
{
"mcp": {
"servers": {
"pulumi": {
"command": "npx",
"args": ["@pulumi/mcp-server@latest", "stdio"]
}
}
}
}Devin
For Devin, you can set up the Pulumi MCP Server by:
- Navigating to https://app.devin.ai/settings/mcp-marketplace/setup/pulumi
- Providing your Pulumi access token, which can be obtained from the Access tokens section in the sidebar of the Pulumi dashboard
- Clicking "Enable"
More about using the MCP server with other popular clients: Pulumi MCP Server Documentation.
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:
docker pull mcp/pulumi:latestBuilding Locally
Or build the container with local changes:
docker build -t pulumi/mcp-server:latest .Usage With Agents
STDIO Mode
Run the server in basic STDIO configuration:
{
"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:
{
"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 to connect STDIO-based clients to HTTP servers.
Quick Start Script
Use the provided script to build and run the HTTP server:
./scripts/docker-run-http.shThis 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:
{
"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/projectin your MCP tool requests- Mount
~/.pulumito preserve Pulumi CLI configuration and credentials- Add cloud provider credential volumes and environment variables as needed for your deployments
