Try to install the Cortex MCP server

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Try to install the Cortex MCP server

L1 Bithead

Hi all,

 

I try to use "Cortex MCP server" for testing purposes.

https://docs-cortex.paloaltonetworks.com/r/Cortex/Cortex-MCP-server/Install-the-Cortex-MCP-server

 

I use a Docker installation on Windows 11.

What I've done so far:

 

- Created and copied the API URL, API key, and API key ID.

 

- Downloaded and extracted the MCP zip file:

Screenshot 2026-03-20 112535.png

 

- I created the .env file with the following content (name: cortex-xdr.env):Screenshot 2026-03-20 103758.png

- Run

docker build -t cortex-mcp .

to build the Docker image.

 

So far so good.

However, as soon as I try to create the container:

docker run --env-file .\cortex-xdr.env -it cortex-mcp

 

The following appears

PS C:\_source\cortex-mcp> docker run --env-file .\cortex-xdr.env -it cortex-mcp
Cortex MCP | Starting Cortex MCP Server
usecase.base_module | Added tool: get_issues
usecase.base_module | Added resource: issues_response.json
usecase.base_module | Added tool: get_cases
usecase.base_module | Added resource: cases_response.json
pkg.openapi.openapi | Loading main template from '/app/src/pkg/openapi/openapi.yaml'...
pkg.openapi.openapi | Discovering and merging specs from '/app/src/usecase/builtin_components/openapi'...
pkg.openapi.openapi | Merging '/app/src/usecase/builtin_components/openapi/get_vulnerabilities.yaml'
pkg.openapi.openapi | Merging '/app/src/usecase/builtin_components/openapi/get_assets.yaml'
pkg.openapi.openapi | Merging '/app/src/usecase/builtin_components/openapi/get_filtered_endpoints.yaml'
pkg.openapi.openapi | Merging '/app/src/usecase/builtin_components/openapi/get_assessment_results.yaml'
pkg.openapi.openapi | Merging '/app/src/usecase/builtin_components/openapi/get_asset_by_id.yaml'
pkg.openapi.openapi | Merging '/app/src/usecase/builtin_components/openapi/get_tenant_info.yaml'
pkg.openapi.openapi | Successfully merged 6 specification files from '/app/src/usecase/builtin_components/openapi'
pkg.openapi.openapi | Discovering and merging specs from '/app/src/usecase/custom_components/openapi'...
pkg.openapi.openapi | Successfully merged 0 specification files from '/app/src/usecase/custom_components/openapi'
pkg.openapi.openapi | Discovering and merging specs from '/app/src/usecase/remote_components/openapi'...
pkg.openapi.openapi | Successfully merged 0 specification files from '/app/src/usecase/remote_components/openapi'
pkg.openapi.openapi | Total: Successfully merged 6 specification files from 3 directories
Cortex MCP | Main loop stopped: No public API URL provided
Traceback (most recent call last):
File "/app/src/main.py", line 146, in main
asyncio.run(async_main(get_config().mcp_transport))
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/asyncio/runners.py", line 195, in run
return runner.run(main)
~~~~~~~~~~^^^^^^
File "/usr/local/lib/python3.13/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/usr/local/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "/app/src/main.py", line 98, in async_main
mcp = await initialize_mcp_server(api_key, api_key_id, papi_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/src/main.py", line 123, in initialize_mcp_server
PAPIClient(get_papi_url(papi_url), get_papi_auth_headers(api_key, api_key_id)))
~~~~~~~~~~~~^^^^^^^^^^
File "/app/src/pkg/util.py", line 157, in get_papi_url
raise ValueError("No public API URL provided")
ValueError: No public API URL provided
Cortex MCP | Cortex MCP Server has shut down.

 

I've been trying to figure out exactly what a “public API URL” means in the context of this error message, but unfortunately I haven't found anything yet.

 

Maybe someone here can help me out?

 

Thank you in advance!

1 accepted solution

Accepted Solutions

L1 Bithead

Dear all,

 

I found the mistake...

It was a copy-and-paste error. I copied from a Markdown and during the copy/paste, a "\" was added before each "_" to escape it. This can be seen in the screenshot of the .env file above.
So now it looks like this (as it should):

CORTEX_MCP_PAPI_URL=https://<your-tenant-url>
CORTEX_MCP_PAPI_AUTH_HEADER=<your_api_key>
CORTEX_MCP_PAPI_AUTH_ID=<your_api_key_id>

 

Perhaps documenting the error will help someone else solve the problem a few minutes faster.

View solution in original post

1 REPLY 1

L1 Bithead

Dear all,

 

I found the mistake...

It was a copy-and-paste error. I copied from a Markdown and during the copy/paste, a "\" was added before each "_" to escape it. This can be seen in the screenshot of the .env file above.
So now it looks like this (as it should):

CORTEX_MCP_PAPI_URL=https://<your-tenant-url>
CORTEX_MCP_PAPI_AUTH_HEADER=<your_api_key>
CORTEX_MCP_PAPI_AUTH_ID=<your_api_key_id>

 

Perhaps documenting the error will help someone else solve the problem a few minutes faster.

  • 1 accepted solution
  • 2119 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!