You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **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](https://github.com/pulumi/mcp-server/issues) if you encounter bugs or need support for additional Pulumi commands.
7
+
The Pulumi Model Context Protocol Server enables advaced Infrastructure as Code development capabilities for connected agents.
8
8
9
-
A server implementing the [Model Context Protocol](https://modelcontextprotocol.io) (MCP) for interacting with Pulumi CLI using the Pulumi Automation API and Pulumi Cloud API.
9
+
## Features
10
10
11
-
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.
11
+
### Available Tools
12
12
13
-
## Usage
13
+
| Tool | Description |
14
+
|------|-------------|
15
+
|`pulumi-registry-list-resources`| Browse available cloud resources to discover what infrastructure components can be deployed |
16
+
|`pulumi-registry-list-functions`| Explore available provider functions for interacting with cloud resources |
17
+
|`pulumi-registry-get-resource`| Get code examples and documentation for specific resources that can be deployed |
18
+
|`pulumi-registry-get-function`| Access examples of provider functions for usage in your Pulumi program |
19
+
|`pulumi-registry-get-type`| Get schema definitions needed to properly set up complex resource properties and types |
20
+
|`pulumi-cli-preview`| Preview infrastructure changes before deployment, showing what resources will be created, updated, or deleted |
21
+
|`pulumi-cli-up`| Deploy infrastructure changes to the cloud, creating and updating resources as defined in your Pulumi program |
22
+
|`pulumi-cli-stack-output`| Retrieve deployment outputs like URLs and resource IDs from your infrastructure stacks |
23
+
|`pulumi-cli-refresh`| Sync your Pulumi state with actual cloud resources to detect drift and manual changes |
24
+
|`pulumi-resource-search`| Discover, count, and analyze your deployed infrastructure across all cloud providers. |
14
25
15
-
The Pulumi CLI has to be installed on you machine.
26
+
### Available Prompts
16
27
17
-
This package is primarily intended to be integrated into applications that can use MCP servers as AI tools.
28
+
| Prompt | Description |
29
+
|--------|-------------|
30
+
|`deploy-to-aws`| Get step-by-step guidance for deploying already written applications to the cloud with Pulumi, including security and cost optimization tips |
18
31
19
-
### Claude Code
32
+
##Installation
20
33
21
-
For [Claude Code](https://claude.ai/code), you can install this MCP server using:
34
+
### Requirements
35
+
36
+
1.**[Pulumi CLI](https://www.pulumi.com/docs/cli/)** must be installed on the client machine
37
+
2.**[Docker](https://www.docker.com/)** (optional) - Required only for containerized deployment
38
+
39
+
### Usage with Claude Code
40
+
41
+
For [Claude Code](https://claude.ai/code), install the MCP server using:
22
42
23
43
```bash
24
44
claude mcp add -s user pulumi -- npx @pulumi/mcp-server@latest stdio
25
45
```
26
46
27
-
### Claude Desktop
47
+
### Usage with Claude Desktop
28
48
29
-
For Claude Desktop, you can include Pulumi MCP Server in the MCP configuration file:
49
+
For Claude Desktop, add the following configuration to your MCP config file:
30
50
31
51
```json
32
52
{
33
53
"mcpServers": {
34
54
"pulumi": {
35
55
"command": "npx",
36
-
"args": ["@pulumi/mcp-server@latest","stdio"]
56
+
"args": ["@pulumi/mcp-server@latest","stdio"]
37
57
}
38
58
}
39
59
}
40
60
```
41
61
42
-
Or if you prefer HTTP with Server-Sent Events (SSE) instead of `stdio`:
62
+
### Usage with VSCode
63
+
64
+
Create a file called `.vscode/mcp.json` in your workspace. Add the following section, and the MCP will become accessible to your assistant:
43
65
44
66
```json
45
67
{
46
-
"mcpServers": {
68
+
"servers": {
47
69
"pulumi": {
48
70
"command": "npx",
49
-
"args": ["@pulumi/mcp-server@latest","sse"]
71
+
"args": ["@pulumi/mcp-server@latest", "stdio"]
72
+
}
73
+
}
74
+
}
75
+
```
76
+
77
+
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)`:
78
+
79
+
```json
80
+
{
81
+
"mcp": {
82
+
"servers": {
83
+
"pulumi": {
84
+
"command": "npx",
85
+
"args": ["@pulumi/mcp-server@latest", "stdio"]
86
+
}
50
87
}
51
88
}
52
89
}
@@ -56,105 +93,117 @@ Or if you prefer HTTP with Server-Sent Events (SSE) instead of `stdio`:
56
93
57
94
For [Devin](https://app.devin.ai), you can set up the Pulumi MCP Server by:
58
95
59
-
1. Navigate to https://app.devin.ai/settings/mcp-marketplace/setup/pulumi
60
-
2. Provide your Pulumi access token, which can be obtained from the Access tokens section in the sidebar of the Pulumi dashboard
61
-
3. Click "Enable"
96
+
1. Navigating to https://app.devin.ai/settings/mcp-marketplace/setup/pulumi
97
+
2. Providing your Pulumi access token, which can be obtained from the Access tokens section in the sidebar of the Pulumi dashboard
98
+
3. Clicking "Enable"
99
+
100
+
More about using the MCP server with other popular clients: [Pulumi MCP Server Documentation](https://www.pulumi.com/docs/iac/using-pulumi/mcp-server/).
62
101
63
-
## Docker Container
102
+
## Docker Installation
64
103
65
-
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.
104
+
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.
105
+
106
+
### Using the Official Image
107
+
108
+
Pull the official image built by Docker:
109
+
110
+
```bash
111
+
docker pull mcp/pulumi:latest
112
+
```
66
113
67
-
### Building the Container
114
+
### Building Locally
68
115
69
-
To build the container:
116
+
Or build the container with local changes:
70
117
71
118
```bash
72
119
docker build -t pulumi/mcp-server:latest .
73
120
```
74
121
75
-
### Using with MCP Clients
122
+
### Usage With Agents
123
+
124
+
**STDIO Mode**
76
125
77
-
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:
Run as a standalone SSE server for real-time communication:
106
166
107
-
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`:
The server exposes handlers for the following Pulumi operations, callable via MCP requests:
180
+
> **Notes:**
181
+
> - When mounting local directories, reference the project as `/app/project` in your MCP tool requests
182
+
> - Mount `~/.pulumi` to preserve Pulumi CLI configuration and credentials
183
+
> - Add cloud provider credential volumes and environment variables as needed for your deployments
125
184
126
-
***`preview`**: Runs `pulumi preview` on a specified stack.
127
-
*`workDir` (string, required): The working directory containing the `Pulumi.yaml` project file.
128
-
*`stackName` (string, optional): The stack name to operate on (defaults to 'dev').
129
-
***`up`**: Runs `pulumi up` to deploy changes for a specified stack.
130
-
*`workDir` (string, required): The working directory containing the `Pulumi.yaml` project file.
131
-
*`stackName` (string, optional): The stack name to operate on (defaults to 'dev').
132
-
***`stack-output`**: Retrieves outputs from a specified stack after a successful deployment.
133
-
*`workDir` (string, required): The working directory containing the `Pulumi.yaml` project file.
134
-
*`stackName` (string, optional): The stack name to retrieve outputs from (defaults to 'dev').
135
-
*`outputName` (string, optional): The specific stack output name to retrieve. If omitted, all outputs for the stack are returned.
136
-
***`get-resource`**: Returns information about a specific Pulumi Registry resource, including its inputs and outputs.
137
-
*`provider` (string, required): The cloud provider (e.g., 'aws', 'azure', 'gcp', 'random') or `github.com/org/repo` for Git-hosted components.
138
-
*`module` (string, optional): The module to query (e.g., 's3', 'ec2', 'lambda').
139
-
*`resource` (string, required): The resource type name (e.g., 'Bucket', 'Function', 'Instance').
140
-
***`list-resources`**: Lists available resources within a Pulumi provider package, optionally filtered by module.
141
-
*`provider` (string, required): The cloud provider (e.g., 'aws', 'azure', 'gcp', 'random') or `github.com/org/repo` for Git-hosted components.
142
-
*`module` (string, optional): The module to filter by (e.g., 's3', 'ec2', 'lambda').
143
-
***`deploy-to-aws`**: Deploy application code to AWS by generating Pulumi infrastructure. Automatically provisions AWS resources (S3, Lambda, EC2, etc.) based on application type.
144
-
* No parameters required - the tool analyzes the current working directory to understand the application structure and generate appropriate infrastructure code.
185
+
## Development
145
186
146
-
## Available Prompts
187
+
### Requirements
188
+
- Node.js and npm
189
+
- Pulumi CLI
147
190
148
-
The server also provides prompts that can be used by MCP clients:
191
+
### Build Commands
149
192
150
-
***`deploy-to-aws`**: AWS deployment guidance prompt that provides comprehensive instructions for analyzing application code and generating Pulumi infrastructure-as-code for AWS deployments. Includes best practices for security, cost optimization, and multi-environment setups.
193
+
| Command | Description |
194
+
|---------|-------------|
195
+
|`make ensure`| Install dependencies |
196
+
|`make build`| Build the project |
197
+
|`make test`| Run all tests |
198
+
|`npm run build`| Build using npm |
199
+
|`npm run lint:fix`| Find and fix lint errors |
151
200
152
-
##Development
201
+
### Quick Start
153
202
154
-
1.Clone the repository.
155
-
2.Install dependencies: `make ensure`
156
-
3.Build the project: `make build`
157
-
4.Test the project: `make test`
203
+
1. Clone the repository
204
+
2. Install dependencies: `make ensure`
205
+
3. Build the project: `make build`
206
+
4. Test the project: `make test`
158
207
159
208
### How to Install Locally
160
209
@@ -194,18 +243,18 @@ Replace `/path/to/your/mcp-server` with the absolute path to your local reposito
194
243
195
244
### List existing tools
196
245
197
-
Use MCP Inspector to list the existing tools and their metadata:
246
+
Use MCP Inspector to list the capabilities:
198
247
199
248
```bash
249
+
# List tools and their metadata
200
250
npm run inspector -- --method tools/list
201
-
```
202
-
203
-
Use MCP Inspector to list the existing prompts and their metadata:
204
251
205
-
```bash
252
+
# List prompts and their metadata
206
253
npm run inspector -- --method prompts/list
207
254
```
208
255
256
+
> **Note:** This MCP server is actively evolving with new features being added regularly. While we strive to maintain compatibility, some API changes may occur as we improve it. Please file an issue on [GitHub](https://github.com/pulumi/mcp-server/issues) if you encounter bugs or would like to request support for additional Pulumi commands.
257
+
209
258
## License
210
259
211
260
This project is licensed under the Apache-2.0 License. See the [LICENSE](LICENSE) file for details.
0 commit comments