Skip to main content

Set Up MCP Server with Cursor

This guide covers how to setup the Palette MCP server with Cursor.

Prerequisites​

  • Ensure the following software is installed locally on your workstation:

  • A Palette account.

  • A Palette API key. Check out the Create API Key guide for more information.

Setup​

  1. Open a terminal session on your local machine.

  2. (Optional) To save the secrets you need to configure the Palette MCP server in a file rather than pass them directly as variables, create an .env-mcp file. The file approach is more secure and manageable.

    1. Issue the following command to create the .env-mcp file in your home directory under the .palette folder.

      mkdir -p ~/.palette
      touch ~/.palette/.env-mcp
    2. Populate the .env-mcp file with the following required values. Refer to the Server Configuration section for further details on the MCP server configuration values.

      cat << EOF > ~/.palette/.env-mcp
      PALETTE_HOST=<palette-api-endpoint>
      PALETTE_API_KEY=<palette-api-key>
      EOF
      chmod 600 ~/.palette/.env-mcp
      info

      By default, the server operates at the tenant scope. Every call sees results across every project that your credentials can access. To scope a request to a single project, mention the project by name or UID in your prompt instead of setting an environment variable; the assistant passes it as that call's project_uid argument.

  3. Issue the following command to create a folder to store kubeconfig files.

    Replace <local-path> with any folder on your machine.

    mkdir -p /<local-path>/kubeconfig
  1. Open Cursor on your local machine. Navigate to Settings > Cursor Settings > Tools & MCP.

  2. Select Add Custom MCP. The mcp.json file opens.

  3. Paste the following snippet in the file, replacing the placeholders with your local path values. Ensure that you provide full filepaths for the kubeconfig folder and .env-mcp file, if you have configured one.

    If you want to use Podman, replace the command "docker" with "podman".

    "mcpServers": {
    "palette": {
    "command": "docker",
    "args": [
    "run",
    "--rm",
    "-i",
    "--pull",
    "always",
    "--mount",
    "type=bind,source=/<local-path>/kubeconfig,target=/tmp/kubeconfig",
    "--env-file",
    "/<local-path>/.palette/.env-mcp",
    "public.ecr.aws/palette-ai/palette-mcp-server:latest"
    ]
    }
    }
    info

    To enable write operations, such as create, update, or delete tools, append "--allow-write" to the args array after the image name. By default, the server starts in read-only mode.

    warning

    A kubeconfig contains cluster credentials. When you retrieve one with read_cluster_kubeconfig, pass write_path (requires --allow-write) to have the server save it locally with 0600 permissions, and treat the saved file as sensitive.

  4. Save the mcp.json file and close it.

  5. Navigate to Settings > Cursor Settings > Tools & MCP. Ensure that the palette MCP server is set up and enabled.

    Palette MCP setup success cursor

  6. Install the four Palette diagnostic skills (diagnose-cluster, diagnose-edge, health-overview, and access-review) from the Palette Agent Toolkit repository.

    npx skills add github.com/spectrocloud/palette-agent-toolkit/skills
  7. (Optional) We recommend adding an Agent Skill to enable Cursor to use kubeconfig files retrieved with read_cluster_kubeconfig to access clusters, if you plan to use the files in ad-hoc kubectl workflows.

    Issue the following command to create a new file for your Palette skill.

    touch ~/.cursor/skills/palette-mcp-guidance.md

    Open the file in your preferred editor and paste the following snippet into it. Replace the <local-path> placeholder with a directory where you want to store kubeconfig files.

    # Palette MCP Server

    The Palette MCP server is a tool that you can use to interact with the Palette platform and its API. The MCP server is active as a container or a native binary and is accessible via the MCP protocol. A few things to keep in mind:

    - When you retrieve a cluster kubeconfig with the `read_cluster_kubeconfig` tool, save the file to a local directory on your machine located at `<local-path>/kubeconfig`.

    Set the KUBECONFIG environment variable to the local filesystem path or use the `kubectl` command with the `--kubeconfig` flag, but ensure the path is correct.

You can now use the Palette MCP server with Cursor.

Validation​

  1. Open Cursor on your local machine.

  2. Open the Cursor Chat sidebar using the shortcut CMD + L or CTRL + L. Send a query about your Palette environment to check if your MCP server is connected to Palette.

    For example, you can ask "How many clusters do I have in Palette?" to learn more about your Palette clusters.

    Example Output
    ❯ How many clusters do I have in Palette?

    From your Palette account (via the Palette MCP read_clusters call), you currently have 1 cluster.

    | Name | State |
    | aws-cluster-test | Running |
info

To enable write tools, such as create, update, and delete, append "--allow-write" to the args array in mcp.json after the image name. By default, the server starts in read-only mode.

Next Steps​

Refer to the Palette MCP Server Operations page for further examples on how to leverage the functionality of the MCP server.