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: stored in
connections.yaml- Rotated session 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@latest --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
When using uvx, prefer mcp-read-only-argocd@latest in user-facing docs and
MCP client configs. This avoids reusing a stale cached tool environment after a
new release is published.
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@latest --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
session_token: your-session-token
- connection_name: production
url: https://argocd-prod.example.com
description: Production Argo CD
session_token: your-other-session-token
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. Store the Session Cookie
Put the cookie value in the session_token field for each connection in
~/.config/lukleh/mcp-read-only-argocd/connections.yaml. The server persists
rotated session cookies to
~/.local/state/lukleh/mcp-read-only-argocd/session_tokens.json, keyed by
connection_name. The server detects changes to connections.yaml before tool
calls, so editing this file does not require an MCP restart. If both
connections.yaml and the state file contain a token for the same connection,
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 \
-- uvx mcp-read-only-argocd@latest
Codex
codex mcp add mcp-read-only-argocd \
-- uvx mcp-read-only-argocd@latest
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
session_token: your-session-token
timeout: 30
verify_ssl: true
Fields:
connection_name: unique identifier used in tool calls and rotated session stateurl: Argo CD base URLdescription: optional human-readable descriptionsession_token: Argo CDargocd.tokenbrowser cookietimeout: optional request timeout in secondsverify_ssl: optional SSL verification toggle
Runtime path override environment variables:
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@latest --print-paths
# Write or refresh the default connections.yaml
uvx mcp-read-only-argocd@latest --write-sample-config
uvx mcp-read-only-argocd@latest --write-sample-config --overwrite
# Run the server with the default home-directory config
uvx mcp-read-only-argocd@latest
# Or point at a different runtime root
uvx mcp-read-only-argocd@latest --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.2.0.tar.gz.
File metadata
- Download URL: mcp_read_only_argocd-0.2.0.tar.gz
- Upload date:
- Size: 85.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d05a1fb947abfba43f8c07f6b1fa6e405b0c4d0759279753b10f361c275198b1
|
|
| MD5 |
b053e1fd7216f27b1616f4b48705e6e6
|
|
| BLAKE2b-256 |
fa5670f629f32dc880505c87c3602f0fc8546cab37710e1f3a9fef6a35c23d4d
|
Provenance
The following attestation bundles were made for mcp_read_only_argocd-0.2.0.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.2.0.tar.gz -
Subject digest:
d05a1fb947abfba43f8c07f6b1fa6e405b0c4d0759279753b10f361c275198b1 - Sigstore transparency entry: 1568437725
- Sigstore integration time:
-
Permalink:
lukleh/mcp-read-only-argocd@1119f4aabf2802dcfbf354bcc57e3dab6a909ea0 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/lukleh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1119f4aabf2802dcfbf354bcc57e3dab6a909ea0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_read_only_argocd-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mcp_read_only_argocd-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
163075299de956155b5c9cebd3b069dd0d844a330facf1b26c13d23dcdd83f1a
|
|
| MD5 |
1729da7ac302fccf768a48dcbd1bbd33
|
|
| BLAKE2b-256 |
3fee773f4cd4bc81c892c54eb2f5efc9c34a562aba78950eed782e7ab2a327a1
|
Provenance
The following attestation bundles were made for mcp_read_only_argocd-0.2.0-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.2.0-py3-none-any.whl -
Subject digest:
163075299de956155b5c9cebd3b069dd0d844a330facf1b26c13d23dcdd83f1a - Sigstore transparency entry: 1568437748
- Sigstore integration time:
-
Permalink:
lukleh/mcp-read-only-argocd@1119f4aabf2802dcfbf354bcc57e3dab6a909ea0 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/lukleh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1119f4aabf2802dcfbf354bcc57e3dab6a909ea0 -
Trigger Event:
push
-
Statement type: