The @pulumi/mcp-server
provides a Model Context Protocol (MCP) interface for programmatic interaction with Pulumi operations. With this server, you can:
- Preview infrastructure changes: Run
pulumi preview
on a specific stack using thepulumi-cli-preview
command - Deploy infrastructure: Execute
pulumi up
to deploy changes using thepulumi-cli-up
command - Retrieve stack outputs: Get output values from a specified stack
- Access resource information: Get detailed information about specific Pulumi Registry resources
- List available resources: View all resource types for a given provider and module
- Docker support: Run as a container to avoid direct dependency installation
- MCP client integration: Use with MCP clients like Claude desktop via
stdio
or HTTP with Server-Sent Events
Supports running the MCP server in a Docker container, with the ability to mount local Pulumi project directories to perform operations on containerized Pulumi projects.
Allows retrieving information about Git-hosted Pulumi component resources from GitHub repositories, accessible through the get-resource and list-resources commands.
Enables programmatic interaction with Pulumi infrastructure as code, allowing operations like retrieving package information, previewing infrastructure changes, deploying stack updates, and retrieving stack outputs without requiring the Pulumi CLI in the client environment.
Pulumi MCP Server
Note: This MCP server is currently under active development. Its API (including available commands and their arguments) is experimental and may introduce breaking changes without notice. Please file an issue on GitHub if you encounter bugs or need support for additional Pulumi commands.
A server implementing the Model Context Protocol (MCP) for interacting with Pulumi CLI using the Pulumi Automation API and Pulumi Cloud API.
This package allows MCP clients to perform Pulumi operations like retrieving package information, previewing changes, deploying updates, and retrieving stack outputs programmatically without needing the Pulumi CLI installed directly in the client environment.
Usage
The Pulumi CLI has to be installed on you machine.
This package is primarily intended to be integrated into applications that can use MCP servers as AI tools. For example, here is how you can include Pulumi MCP Server in Claude desktop's MCP configuration file:
Or if you prefer HTTP with Server-Sent Events (SSE) instead of stdio
:
Docker Container
You can also run the Pulumi MCP Server as a Docker container. This approach eliminates the need to install Node.js and the package dependencies directly on your host machine.
Building the Container
To build the container:
Using with MCP Clients
To use the containerized server with MCP clients, you'll need to configure the client to use the Docker container. For example, in Claude desktop's MCP configuration:
Using with MCP Clients over HTTP (SSE)
To use the containerized server with MCP clients over HTTP (SSE), you can run the container with the following command:
For Pulumi operations that require access to local Pulumi projects, you'll need to mount the appropriate directories. For example, if your Pulumi project is in ~/projects/my-pulumi-app
:
Then when using the MCP tools, you would reference the project directory as /app/project
in your requests.
Available Commands
The server exposes handlers for the following Pulumi operations, callable via MCP requests:
preview
: Runspulumi preview
on a specified stack.workDir
(string, required): The working directory containing thePulumi.yaml
project file.stackName
(string, optional): The stack name to operate on (defaults to 'dev').
up
: Runspulumi up
to deploy changes for a specified stack.workDir
(string, required): The working directory containing thePulumi.yaml
project file.stackName
(string, optional): The stack name to operate on (defaults to 'dev').
stack-output
: Retrieves outputs from a specified stack after a successful deployment.workDir
(string, required): The working directory containing thePulumi.yaml
project file.stackName
(string, optional): The stack name to retrieve outputs from (defaults to 'dev').outputName
(string, optional): The specific stack output name to retrieve. If omitted, all outputs for the stack are returned.
get-resource
: Returns information about a specific Pulumi Registry resource, including its inputs and outputs.provider
(string, required): The cloud provider (e.g., 'aws', 'azure', 'gcp', 'random') orgithub.com/org/repo
for Git-hosted components.module
(string, optional): The module to query (e.g., 's3', 'ec2', 'lambda').resource
(string, required): The resource type name (e.g., 'Bucket', 'Function', 'Instance').
list-resources
: Lists available resources within a Pulumi provider package, optionally filtered by module.provider
(string, required): The cloud provider (e.g., 'aws', 'azure', 'gcp', 'random') orgithub.com/org/repo
for Git-hosted components.module
(string, optional): The module to filter by (e.g., 's3', 'ec2', 'lambda').
Development
- Clone the repository.
- Install dependencies:
make ensure
- Build the project:
make build
- Test the project:
make test
License
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.
You must be authenticated.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
@pulumi/mcp-server
Related MCP Servers
- Python
- JavaScriptMIT License
- PythonMIT License
- PythonMIT License