MCP server for read-only access to Argo CD instances using browser session cookies
Project description
MCP Read-Only Argo CD Server
A secure MCP (Model Context Protocol) server that provides read-only access to Argo CD instances using browser session cookies.
Default layout:
- Config:
~/.config/lukleh/mcp-read-only-argocd/connections.yaml- Credentials: injected via the MCP client or shell environment
- State:
~/.local/state/lukleh/mcp-read-only-argocd/session_tokens.json- Cache:
~/.cache/lukleh/mcp-read-only-argocd/
Features
- Read-only by design: only read operations are exposed
- Session cookie authentication: uses your existing
argocd.tokenbrowser session - Multi-instance support: connect to multiple Argo CD instances at once
- Automatic cookie rotation: refreshed session cookies are persisted to local state
- Package-native runtime paths: no repository checkout required for normal use
Why Session Cookies?
Unlike token-based setups, this server can reuse your existing browser session:
- no extra API token management
- uses your existing SSO/OIDC login
- matches the permissions you already have in the UI
Prerequisites
- Python 3.11 or higher
- uv
- an Argo CD browser session cookie
- an MCP client such as Claude Code or Codex
Quick Start
1. Install the Server
# Run the published package without cloning the repository
uvx mcp-read-only-argocd --write-sample-config
# Or install it once and reuse the command directly
uv tool install mcp-read-only-argocd
mcp-read-only-argocd --write-sample-config
The command above writes a starter config to ~/.config/lukleh/mcp-read-only-argocd/connections.yaml.
2. Confirm Runtime Paths
uvx mcp-read-only-argocd --print-paths
3. Edit the Connections File
Edit ~/.config/lukleh/mcp-read-only-argocd/connections.yaml:
- connection_name: staging
url: https://argocd.example.com
description: Staging Argo CD
- connection_name: production
url: https://argocd-prod.example.com
description: Production Argo CD
4. Get Your argocd.token Session Cookie
- Log in to your Argo CD web UI
- Open browser developer tools
- Go to Application/Storage -> Cookies
- Copy the value of the
argocd.tokencookie
5. Set the Environment Variables
Set one ARGOCD_SESSION_<CONNECTION_NAME> variable for each configured connection in the environment used to launch the server.
Example:
export ARGOCD_SESSION_STAGING=your-session-token
export ARGOCD_SESSION_PRODUCTION=your-other-session-token
Optional per-connection timeout override:
export ARGOCD_TIMEOUT_STAGING=60
The server persists rotated session cookies to ~/.local/state/lukleh/mcp-read-only-argocd/session_tokens.json. If both the environment and the state file contain a token, the persisted state file wins until you update or remove it.
6. Configure Your MCP Client
Claude Code
claude mcp add mcp-read-only-argocd \
--scope user \
-e ARGOCD_SESSION_STAGING=your-session-token \
-e ARGOCD_SESSION_PRODUCTION=your-other-session-token \
-- uvx mcp-read-only-argocd
Codex
codex mcp add mcp-read-only-argocd \
--env ARGOCD_SESSION_STAGING=your-session-token \
--env ARGOCD_SESSION_PRODUCTION=your-other-session-token \
-- uvx mcp-read-only-argocd
7. Restart and Test
Restart your MCP client and try a simple query such as:
List all applications in the staging Argo CD instance.
Configuration
connections.yaml supports a list of Argo CD connections:
- connection_name: staging
url: https://argocd.example.com
description: Staging Argo CD instance
timeout: 30
verify_ssl: true
Fields:
connection_name: unique identifier used to derive environment variable namesurl: Argo CD base URLdescription: optional human-readable descriptiontimeout: optional request timeout in secondsverify_ssl: optional SSL verification toggle
Environment variables:
ARGOCD_SESSION_<CONNECTION_NAME>ARGOCD_TIMEOUT_<CONNECTION_NAME>(optional)MCP_READ_ONLY_ARGOCD_CONFIG_DIRMCP_READ_ONLY_ARGOCD_STATE_DIRMCP_READ_ONLY_ARGOCD_CACHE_DIR
Command Line Testing
# Show the resolved runtime paths
uvx mcp-read-only-argocd --print-paths
# Write or refresh the default connections.yaml
uvx mcp-read-only-argocd --write-sample-config
uvx mcp-read-only-argocd --write-sample-config --overwrite
# Run the server with the default home-directory config
uvx mcp-read-only-argocd
# Or point at a different runtime root
uvx mcp-read-only-argocd --config-dir /path/to/config-dir
MCP Tools
Core
list_connectionsget_versionget_settings
Applications
list_applicationsget_applicationget_application_resource_treeget_application_managed_resourcesget_application_logs
Projects
list_projectsget_project
Clusters
list_clustersget_cluster
Repositories
list_repositoriesget_repository
Local Development
If you want to work on the repository itself:
git clone https://github.com/lukleh/mcp-read-only-argocd.git
cd mcp-read-only-argocd
uv sync --extra dev
uv run pytest -q
uv run mcp-read-only-argocd --print-paths
uv run python smoke_test.py --print-paths
The checked-in sample file remains available at connections.yaml.sample for documentation and review, but package users should prefer --write-sample-config.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_read_only_argocd-0.1.2.tar.gz.
File metadata
- Download URL: mcp_read_only_argocd-0.1.2.tar.gz
- Upload date:
- Size: 79.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0ef6a4bc1e2484f463380e549d45a2bcff1467bfc95b244cefa958ad9112ad2
|
|
| MD5 |
cb4baa71dc7a0ee380a2d168ed495a2b
|
|
| BLAKE2b-256 |
c04ea1bb77ce179b3c7f8d7beaece6da2139f8965ff39cf09c9c9bb0c25b04a0
|
Provenance
The following attestation bundles were made for mcp_read_only_argocd-0.1.2.tar.gz:
Publisher:
publish.yml on lukleh/mcp-read-only-argocd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_read_only_argocd-0.1.2.tar.gz -
Subject digest:
c0ef6a4bc1e2484f463380e549d45a2bcff1467bfc95b244cefa958ad9112ad2 - Sigstore transparency entry: 1229036265
- Sigstore integration time:
-
Permalink:
lukleh/mcp-read-only-argocd@acdad14290b7e2c74184555e888bf5d3d51a7ba4 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/lukleh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@acdad14290b7e2c74184555e888bf5d3d51a7ba4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_read_only_argocd-0.1.2-py3-none-any.whl.
File metadata
- Download URL: mcp_read_only_argocd-0.1.2-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b37b65ba5ec1764ebb445fe634350e470ee27df5497155b76837e5555e5483c4
|
|
| MD5 |
c38bce85c55f543155dd55589c94b111
|
|
| BLAKE2b-256 |
12944098922d14a94b178d571e39de4132bf31499ad1862caf12d8f3d0ee0ce1
|
Provenance
The following attestation bundles were made for mcp_read_only_argocd-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on lukleh/mcp-read-only-argocd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_read_only_argocd-0.1.2-py3-none-any.whl -
Subject digest:
b37b65ba5ec1764ebb445fe634350e470ee27df5497155b76837e5555e5483c4 - Sigstore transparency entry: 1229036312
- Sigstore integration time:
-
Permalink:
lukleh/mcp-read-only-argocd@acdad14290b7e2c74184555e888bf5d3d51a7ba4 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/lukleh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@acdad14290b7e2c74184555e888bf5d3d51a7ba4 -
Trigger Event:
push
-
Statement type: