> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-xsiam/configure-cortex-xsiam/cortex-mcp-server/configure-the-mcp-client.md).

# Configure the MCP client

Configure a local MCP client to connect to the Cortex XSIAM MCP Server using Docker or a Poetry virtual environment.

After you have downloaded and installed the Cortex MCP server, you need to configure your local MCP client to communicate with the Cortex MCP server. The instructions below use Claude Desktop, but any MCP client can be used.

1. In the Claude Desktop app, navigate to **Settings** → **Developer** → **Edit Config**. The configuration file opens in your default text editor.

   For reference, the file is located at:

   * macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
   * Windows: `%APPDATA%\Claude\claude_desktop_config.json`
2. Add the `mcpServers` configuration to the file. The examples below are provided for container (Docker) and local client (Poetry virtual environment). The exact details of your `mcpServers` configuration depend on your specific installation.

   **Docker Container**

   ```programlisting
   {
     "mcpServers": {
       "Cortex MCP Server": {
         "command": "docker",
         "args": [
           "run",
           "--env-file",
           "/path/to/.env",
           "-i",
           "--rm",
           "cortex-mcp"
         ]
       }
     }
   }
   ```

   **Poetry virtual environment**

   ```programlisting
   {
     "mcpServers": {
       "Cortex MCP Server": {
         "command": "python",
         "args": [
           "/path/to/cortex-mcp/src/main.py"
         ],
          "env": {
             "CORTEX_MCP_PAPI_URL": "https://api.cortex.example.com",
             "CORTEX_MCP_PAPI_AUTH_HEADER": "<your_api_key>", 
             "CORTEX_MCP_PAPI_AUTH_ID": "<your_api_key_id",
             "MCP_TRANSPORT": "stdio/streamable-http"
      }
       }
     }
   }
   ```
3. Save the changes to the configuration file and restart Claude Desktop for the changes to take effect.
4. Verify the connection to the Cortex MCP server. You should see the Cortex MCP server running in the Developer settings and a hammer icon may appear in the input box, indicating the MCP tools are available.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-xsiam/configure-cortex-xsiam/cortex-mcp-server/configure-the-mcp-client.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
