This MCP server integrates with the ArgoCD API, allowing AI assistants and language models to manage ArgoCD applications through natural language interactions. It handles authentication, application management, and provides a robust API client for ArgoCD operations.
# Clone the repository
git clone https://github.com/severity1/argocd-mcp.git
cd argocd-mcp
# Create virtual environment and activate it
uv venv
source .venv/bin/activate
# Install dependencies
uv pip install -e .
The server is configured using environment variables:
Environment Variable | Description | Default Value |
---|---|---|
ARGOCD_TOKEN |
ArgoCD API token | None |
ARGOCD_API_URL |
ArgoCD API endpoint | https://argocd.example.com/api/v1 |
ARGOCD_VERIFY_SSL |
Verify SSL certificates | true |
# Using MCP dev tools (provides debugging tools)
export ARGOCD_TOKEN=YOUR_ARGOCD_TOKEN
mcp dev server.py
# Using MCP run command
export ARGOCD_TOKEN=YOUR_ARGOCD_TOKEN
mcp run server.py
# Standard method
export ARGOCD_TOKEN=YOUR_ARGOCD_TOKEN
uv run server.py
# With custom API URL and SSL verification disabled
export ARGOCD_TOKEN=YOUR_ARGOCD_TOKEN
export ARGOCD_API_URL=https://your-argocd-server.com:9000/api/v1
export ARGOCD_VERIFY_SSL=false
uv run server.py
# Using a .env file
echo "ARGOCD_TOKEN=YOUR_ARGOCD_TOKEN
ARGOCD_API_URL=https://your-argocd-server.com:9000/api/v1
ARGOCD_VERIFY_SSL=false" > .env
uv run server.py
# Run in background
export ARGOCD_TOKEN=YOUR_ARGOCD_TOKEN
uv run server.py > server.log 2>&1 & echo $! > server.pid
# Add the MCP server
claude mcp add argocd-mcp "uv run $(pwd)/server.py"
# With token
claude mcp add argocd-mcp -e ARGOCD_TOKEN=YOUR_ARGOCD_TOKEN -- "uv run $(pwd)/server.py"
# Verify it was added
claude mcp list
Create a claude_desktop_config.json
configuration file:
{
"mcpServers": {
"argocd-mcp": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/argocd-mcp",
"run",
"server.py"
],
"env": {
"ARGOCD_TOKEN": "your_argocd_token",
"ARGOCD_API_URL": "https://your-argocd-server.com/api/v1",
"ARGOCD_VERIFY_SSL": "true"
}
}
}
}
Replace paths and values with your actual configuration:
which uv
on macOS/Linux or where uv
on Windows)get_user_info
: Retrieve current user's informationget_settings
: Get ArgoCD server settings (UI, OIDC, etc.)get_plugins
: Get information about configured ArgoCD pluginsget_version
: Get ArgoCD API server version informationlist_applications
: Get all applications with filtering optionsget_application_details
: Get detailed information about a specific applicationcreate_application
: Create a new applicationupdate_application
: Update an existing applicationdelete_application
: Delete an applicationsync_application
: Trigger a sync operation on an applicationUser: What's my user information in ArgoCD?
Claude: Let me retrieve your user information.
⏺ argocd-mcp:get_user_info (MCP)
⎿ {"loggedIn": true, "username": "devops-user", "iss": "argocd"}
You are logged in as 'devops-user'.
User: What version of ArgoCD is running on the server?
Claude: Let me check the ArgoCD version information.
⏺ argocd-mcp:get_version (MCP)
⎿ {
"Version": "v2.9.3+5eaf684",
"BuildDate": "2023-09-15T14:25:11Z",
"GitCommit": "5eaf68452",
"GitTreeState": "clean",
"GoVersion": "go1.20.7",
"Compiler": "gc",
"Platform": "linux/amd64",
"KustomizeVersion": "v5.1.1",
"HelmVersion": "v3.12.3",
"KubectlVersion": "v1.27.4",
"JsonnetVersion": "v0.20.0"
}
You're running ArgoCD v2.9.3, built on September 15, 2023. It's running on Linux (amd64) with Go 1.20.7, and includes Kustomize v5.1.1 and Helm v3.12.3.
User: What applications do I have in the "production" project?
Claude: Let me list your applications in the production project.
⏺ argocd-mcp:list_applications (MCP)
⎿ {
"items": [
{
"metadata": {
"name": "frontend-app",
},
"status": {
"sync": {"status": "Synced"},
"health": {"status": "Healthy"},
}
},
{
"metadata": {
"name": "api-service",
},
"status": {
"sync": {"status": "OutOfSync"},
"health": {"status": "Healthy"},
}
},
{
"metadata": {
"name": "database",
},
"status": {
"sync": {"status": "Synced"},
"health": {"status": "Degraded"},
}
}
]
}
You have 3 applications in the production project:
- frontend-app (Synced, Healthy)
- api-service (OutOfSync, Healthy)
- database (Synced, Degraded)
User: Sync the api-service application
Claude: I'll sync the api-service application for you.
⏺ argocd-mcp:sync_application (MCP)
⎿ {
"resourcesResult": {
"updated": ["Deployment/api-service"],
"hooks": []
},
"status": "Syncing"
}
Application sync initiated successfully. The sync operation is now in progress.
If you encounter issues:
# Disable SSL verification
export ARGOCD_VERIFY_SSL=false
uv run server.py
# Show all current ArgoCD environment variables
env | grep ARGOCD
mcp dev server.py
, access the MCP Inspector at http://localhost:5173 for debuggingTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "argocd-mcp" '{"command":"/path/to/uv","args":["--directory","/path/to/argocd-mcp","run","server.py"],"env":{"ARGOCD_TOKEN":"your_argocd_token","ARGOCD_API_URL":"https://your-argocd-server.com/api/v1","ARGOCD_VERIFY_SSL":"true"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"argocd-mcp": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/argocd-mcp",
"run",
"server.py"
],
"env": {
"ARGOCD_TOKEN": "your_argocd_token",
"ARGOCD_API_URL": "https://your-argocd-server.com/api/v1",
"ARGOCD_VERIFY_SSL": "true"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"argocd-mcp": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/argocd-mcp",
"run",
"server.py"
],
"env": {
"ARGOCD_TOKEN": "your_argocd_token",
"ARGOCD_API_URL": "https://your-argocd-server.com/api/v1",
"ARGOCD_VERIFY_SSL": "true"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect