mcp-server
The Pulumi MCP Server is a server implementing the Model Context Protocol (MCP) for interacting with the Pulumi CLI. It allows MCP clients to perform operations such as retrieving package information, previewing changes, deploying updates, and fetching stack outputs programmatically without needing the Pulumi CLI installed directly in the client environment. The server is currently under active development, and its API is experimental.
GitHub Stars
63
User Rating
Not Rated
Favorites
0
Views
8
Forks
14
Issues
15
Installation
Difficulty
IntermediateEstimated Time
10-20 minutes
Requirements
Node.js: 18.0.0以上
npm: 8.0.0以上
+1 more
Installation
Installation
Prerequisites
Please specify required software and versions:Node.js: 18.0.0 or higher
npm: 8.0.0 or higher
Claude Desktop: Latest version
Installation Steps
1. Clone Repository
bash
git clone https://github.com/pulumi/mcp-server.git
cd mcp-server
2. Install Dependencies
bash
npm install
3. Start MCP Server
bash
npx @pulumi/mcp-server@latest stdio
Troubleshooting
Common Issues
Issue: Server won't start Solution: Check Node.js version and reinstall dependencies. Issue: Not recognized by Claude Desktop Solution: Verify configuration file path and syntax.Configuration
Configuration
Basic Configuration
Claude Desktop Setup
Edit~/.config/claude-desktop/claude_desktop_config.json
(macOS/Linux) or
%APPDATA%\Claude\claude_desktop_config.json
(Windows):
json
{
"mcpServers": {
"pulumi": {
"command": "npx",
"args": ["@pulumi/mcp-server@latest","stdio"]
}
}
}
Configuration Examples
Basic Configuration
json
{
"mcpServers": {
"pulumi": {
"command": "npx",
"args": ["@pulumi/mcp-server@latest","stdio"]
}
}
}
Docker Container Configuration
json
{
"mcpServers": {
"pulumi": {
"command": "docker",
"args": ["run", "-i", "--rm", "pulumi/mcp-server:latest", "stdio"]
}
}
}
Examples
Examples
Basic Usage
Using with Claude Desktop
1Verify MCP Server Startup
Open Claude Desktop and confirm that the configuration has been loaded correctly.
2Execute Basic Commands
Available tools from this MCP server:
- tool1: Description of tool1
- tool2: Description of tool2
Programmatic Usage
javascript
// JavaScript example (Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');
const client = new MCPClient();
await client.connect();
// Execute tool
const result = await client.callTool('toolName', {
parameter1: 'value1',
parameter2: 'value2'
});
console.log(result);
Advanced Examples
Automation Script
bash
#!/bin/bash
Batch processing example
for file in *.txt; do
mcp-tool process "$file"
done
API Integration
python
Python example
import requests
import json
def call_mcp_tool(tool_name, params):
response = requests.post(
'http://localhost:3000/mcp/call',
json={
'tool': tool_name,
'parameters': params
}
)
return response.json()
Usage example
result = call_mcp_tool('analyze', {
'input': 'sample data',
'options': {'format': 'json'}
})
Use Cases
Integrate the MCP server as an AI tool to automate Pulumi operations
Create scripts to manage multiple Pulumi projects
Use Pulumi in CI/CD pipelines to deploy infrastructure
Fetch stack outputs in real-time in development environments