Skip to content

Add Pulumi MCP server documentation page #15465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 4, 2025

This PR adds comprehensive documentation for Pulumi's Model Context Protocol (MCP) server, addressing the need for a dedicated docs page similar to other tools' MCP documentation.

What was added

  • New documentation page at /docs/iac/using-pulumi/mcp-server/ that provides:

    • Overview of what the MCP server is and how it enables AI-assisted IaC development
    • Installation instructions using @pulumi/mcp-server npm package
    • Setup configurations for popular AI assistants (Cursor, Claude Code, GitHub Copilot, Windsurf)
    • Complete reference of available tools (registry and CLI operations)
    • Step-by-step getting started guide with real-world examples
    • Troubleshooting section for common setup issues
    • Links to related resources including the GitHub repository and launch blog post
  • Navigation integration by adding the MCP server page to the "Using Pulumi" guides list

Key features covered

The documentation explains how developers can use the MCP server to:

  • Query the Pulumi Registry for resource information directly from their AI assistant
  • Execute Pulumi CLI commands (preview, up, destroy) through conversational interfaces
  • Access stack outputs and configuration values
  • Validate infrastructure code before deployment
  • Debug deployment issues with real-time feedback

Examples included

  • AKS cluster provisioning: Complete walkthrough showing natural language request → resource discovery → code generation → deployment
  • Adding monitoring: Example of iteratively enhancing existing infrastructure through AI assistance

This documentation enables developers to integrate AI assistants with their Pulumi workflow, reducing context switching and accelerating Infrastructure as Code development.

Fixes requirement to create MCP server documentation similar to Sentry's approach, referencing the @pulumi/mcp-server GitHub repository and launch blog post.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.cypress.io
    • Triggering command: /usr/local/bin/node index.js --exec install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Create a docs page for Pulumi's MCP server akin to Sentry's here: https://docs.sentry.io/product/sentry-mcp/. The GitHub repo for that server is @pulumi/mcp-server and our launch blog is here: https://www.pulumi.com/blog/mcp-server-ai-assistants/. Add Pulumi MCP server documentation page Jul 4, 2025
@Copilot Copilot AI requested a review from joeduffy July 4, 2025 01:21
Copilot finished work on behalf of joeduffy July 4, 2025 01:21
- **Execute Pulumi CLI commands** like `pulumi preview`, `pulumi up`, and `pulumi destroy`
- **Access stack outputs** and configuration values
- **Validate infrastructure code** before deployment
- **Debug deployment issues** with real-time feedback
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also mention the fact that it can be used to catch and autofix IaC policy violations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added mention of catching and autofixing IaC policy violations using Pulumi's policy-as-code capabilities to the list of MCP server features. Commit: d4c91f9

weight: 6
---

The Pulumi Model Context Protocol (MCP) server enables AI-powered coding assistants to seamlessly interact with Pulumi's CLI and registry, bringing real-time infrastructure knowledge and management directly into your development environment. This integration dramatically reduces context switching and accelerates Infrastructure as Code (IaC) development workflows.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not focus so much on the registry -- that's more of an implementation detail. Emphasize that this enables you to codify cloud architectures and get diffs for those right in your CLI much in the same way you already do for code changes thanks to Git. It also ensures that as you build cloud apps it's repeatable and following best practices and policies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the opening description to focus on the core value proposition of codifying cloud architectures and getting infrastructure diffs like Git, while emphasizing repeatability and best practices rather than registry details. Commit: 4c8f1c8


### Claude Code setup

For Claude Code, the MCP server configuration varies depending on your setup. Refer to the [Claude Code documentation](https://claude.ai/code) for specific instructions on configuring MCP servers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be more specific in all of these configurations, similar to https://docs.sentry.io/product/sentry-mcp/#verified-clients.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced vague configuration instructions with specific, detailed setup instructions for Claude Code (with platform-specific paths), GitHub Copilot (VS Code settings), and Windsurf, similar to the Sentry MCP documentation format. Commit: 4c8f1c8

Copilot finished work on behalf of joeduffy July 4, 2025 01:37
@Copilot Copilot AI requested a review from joeduffy July 4, 2025 01:37
Copy link
Contributor Author

Copilot AI commented Jul 4, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.cypress.io
    • Triggering command: node index.js --exec install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of joeduffy July 4, 2025 01:47
@joeduffy joeduffy marked this pull request as ready for review July 4, 2025 01:49
}
```

## Available tools
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot make sure you list all available tools and prompts. Here is the full of tools produced by the MCP inspector:

{
  "tools": [
    {
      "name": "pulumi-registry-get-type",
      "description": "Get the JSON schema for a specific JSON schema type reference",
      "inputSchema": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "description": "The cloud provider (e.g., 'aws', 'azure', 'gcp', 'random') or github.com/org/repo for Git-hosted components"
          },
          "module": {
            "type": "string",
            "description": "The module to query (e.g., 's3', 'ec2', 'lambda'). Optional for smaller providers, will be 'index by default."
          },
          "name": {
            "type": "string",
            "description": "The name of the type to query (e.g., 'BucketGrant', 'FunctionEnvironment', 'InstanceCpuOptions')"
          },
          "version": {
            "type": "string",
            "description": "The provider version to use (e.g., '6.0.0'). If not specified, uses the latest available version."
          }
        },
        "required": [
          "provider",
          "name"
        ],
        "additionalProperties": false,
        "$schema": "http://json-schema.org/draft-07/schema#"
      }
    },
    {
      "name": "pulumi-registry-get-resource",
      "description": "Returns information about a Pulumi Registry resource",
      "inputSchema": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "description": "The cloud provider (e.g., 'aws', 'azure', 'gcp', 'random') or github.com/org/repo for Git-hosted components"
          },
          "module": {
            "type": "string",
            "description": "The module to query (e.g., 's3', 'ec2', 'lambda'). Optional for smaller providers, will be 'index by default."
          },
          "resource": {
            "type": "string",
            "description": "The resource type to query (e.g., 'Bucket', 'Function', 'Instance')"
          },
          "version": {
            "type": "string",
            "description": "The provider version to use (e.g., '6.0.0'). If not specified, uses the latest available version."
          }
        },
        "required": [
          "provider",
          "resource"
        ],
        "additionalProperties": false,
        "$schema": "http://json-schema.org/draft-07/schema#"
      }
    },
    {
      "name": "pulumi-registry-list-resources",
      "description": "List all resource types for a given provider and module",
      "inputSchema": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "description": "The cloud provider (e.g., 'aws', 'azure', 'gcp', 'random') or github.com/org/repo for Git-hosted components"
          },
          "module": {
            "type": "string",
            "description": "Optional module to filter by (e.g., 's3', 'ec2', 'lambda')"
          },
          "version": {
            "type": "string",
            "description": "The provider version to use (e.g., '6.0.0'). If not specified, uses the latest available version."
          }
        },
        "required": [
          "provider"
        ],
        "additionalProperties": false,
        "$schema": "http://json-schema.org/draft-07/schema#"
      }
    },
    {
      "name": "pulumi-cli-preview",
      "description": "Run pulumi preview for a given project and stack",
      "inputSchema": {
        "type": "object",
        "properties": {
          "workDir": {
            "type": "string",
            "description": "The working directory of the program."
          },
          "stackName": {
            "type": "string",
            "description": "The associated stack name. Defaults to 'dev'."
          }
        },
        "required": [
          "workDir"
        ],
        "additionalProperties": false,
        "$schema": "http://json-schema.org/draft-07/schema#"
      }
    },
    {
      "name": "pulumi-cli-up",
      "description": "Run pulumi up for a given project and stack",
      "inputSchema": {
        "type": "object",
        "properties": {
          "workDir": {
            "type": "string",
            "description": "The working directory of the program."
          },
          "stackName": {
            "type": "string",
            "description": "The associated stack name. Defaults to 'dev'."
          }
        },
        "required": [
          "workDir"
        ],
        "additionalProperties": false,
        "$schema": "http://json-schema.org/draft-07/schema#"
      }
    },
    {
      "name": "pulumi-cli-stack-output",
      "description": "Get the output value(s) of a given stack",
      "inputSchema": {
        "type": "object",
        "properties": {
          "workDir": {
            "type": "string",
            "description": "The working directory of the program."
          },
          "stackName": {
            "type": "string",
            "description": "The associated stack name. Defaults to 'dev'."
          },
          "outputName": {
            "type": "string",
            "description": "The specific stack output name to retrieve."
          }
        },
        "required": [
          "workDir"
        ],
        "additionalProperties": false,
        "$schema": "http://json-schema.org/draft-07/schema#"
      }
    },
    {
      "name": "pulumi-cli-refresh",
      "description": "Run pulumi refresh for a given project and stack",
      "inputSchema": {
        "type": "object",
        "properties": {
          "workDir": {
            "type": "string",
            "description": "The working directory of the program."
          },
          "stackName": {
            "type": "string",
            "description": "The associated stack name. Defaults to 'dev'."
          }
        },
        "required": [
          "workDir"
        ],
        "additionalProperties": false,
        "$schema": "http://json-schema.org/draft-07/schema#"
      }
    },
    {
      "name": "deploy-to-aws",
      "description": "Deploy application code to AWS by generating Pulumi infrastructure. This tool automatically analyzes your application files and provisions the appropriate AWS resources (S3, Lambda, EC2, etc.) based on what it finds. No prior analysis needed -  just invoke directly.",
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "$schema": "http://json-schema.org/draft-07/schema#"
      }
    }
  ]
}

Here is the list of all available prompts:

{
  "prompts": [
    {
      "name": "deploy-to-aws",
      "description": "Deploy application code to AWS by generating Pulumi infrastructure"
    },
    {
      "name": "convert-terraform-to-typescript",
      "description": "Converts a Terraform file to TypeScript",
      "arguments": [
        {
          "name": "outputDir",
          "description": "The directory to output the TypeScript code to",
          "required": false
        }
      ]
    }
  ]
}

Keep the existing format, but make sure your list is up to date, based on the information in this comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the available tools and prompts section with the complete and accurate list from the MCP inspector output. Fixed tool naming conventions (hyphens instead of underscores), added parameter details, removed non-existent tools, and included the new prompts section. Commit: 707d4ea

Copy link
Contributor Author

Copilot AI commented Jul 4, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.cypress.io
    • Triggering command: node index.js --exec install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Copilot Copilot AI requested a review from arturl July 4, 2025 02:37
Copilot finished work on behalf of arturl July 4, 2025 02:37

### Deployment tools

- **`deploy-to-aws`** - Deploy application code to AWS by generating Pulumi infrastructure. This tool automatically analyzes your application files and provisions the appropriate AWS resources (S3, Lambda, EC2, etc.) based on what it finds. No prior analysis needed - just invoke directly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot make this shorter:

"Deploy application code to AWS by generating Pulumi infrastructure. This tool automatically analyzes your application files and provisions the appropriate AWS resources"

Also, remove the description of Required parameters from tools descriptions above, to make it more concise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made both requested changes - shortened the deploy-to-aws description and removed parameter details from all tool descriptions to make them more concise. Commit: 17eb4c9

Copy link
Contributor Author

Copilot AI commented Jul 4, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.cypress.io
    • Triggering command: node index.js --exec install (dns block)
    • Triggering command: /usr/local/bin/node index.js --exec install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Copilot Copilot AI requested a review from arturl July 4, 2025 02:51
Copilot finished work on behalf of arturl July 4, 2025 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants