Skip to main content

Set Up MCP Server with Antigravity

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

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. Start the Antigravity CLI in a terminal. Ensure that you trust the folder that the .env-mcp file is located in and authenticate with the Antigravity CLI by following the prompts.

    agy
  2. Open the ~/.gemini/config/mcp_config.json file in your preferred text editor. If the file does not exist, create it.

  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_config.json file and close it.

  5. Return to the Antigravity CLI and type the /mcp slash command to open the MCP Manager overlay and confirm that the palette MCP server is listed and connected.

    /mcp
    Example Output
    Configured MCP servers:

    ✓ palette: docker run --rm -i --pull always --mount type=bind,source=/Users/test-user/.palette/kubeconfig,target=/tmp/kubeconfig --env-file /Users/test-user/.palette/.env-mcp public.ecr.aws/palette-ai/palette-mcp-server:latest (stdio) - Connected
  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 Antigravity 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 the ANTIGRAVITY.md file on your machine if it does not exist.

    touch ~/.antigravity/ANTIGRAVITY.md

    Open the file in your preferred text editor and paste the following snippet into the file. 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 Antigravity.

Validation​

  1. Start the Antigravity CLI in a terminal. Ensure that you trust the folder that the .env-mcp file is located in and authenticate with the Antigravity CLI by following the prompts.

    agy
    Example Output
    Antigravity CLI

    Type your prompt or press Ctrl+C to exit.
    >
  2. 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
    ✦ I will list the active clusters in Palette to determine how many you have.
    read_clusters (palette MCP Server) {"filters":{"states":["Running"]}}

    ✦ You have 1 active cluster in Palette: aws-cluster-test.
info

To enable write tools, such as create, update, and delete, append "--allow-write" to the args array in settings.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.