diff --git a/.env.example b/.env.example deleted file mode 100644 index 2a2e660..0000000 --- a/.env.example +++ /dev/null @@ -1,5 +0,0 @@ -# Uncomment to disable SSL verification (not recommended for production) -# NODE_TLS_REJECT_UNAUTHORIZED=0 - -ARGOCD_BASE_URL= -ARGOCD_API_TOKEN= diff --git a/.vscode/mcp.json b/.vscode/mcp.json index 4d2b234..78362e5 100644 --- a/.vscode/mcp.json +++ b/.vscode/mcp.json @@ -14,22 +14,13 @@ } ], "servers": { - "argocd-mcp-server-stdio": { - "type": "stdio", - "command": "node", - "args": [ - "${workspaceFolder}/dist/argocd-mcp-server.js", - "stdio" - ], - "envFile": "${workspaceFolder}/.env" - }, "argocd-mcp-server-sse": { "type": "sse", "url": "http://localhost:3000/sse", "headers": { "x-argocd-base-url": "${input:argocd-base-url}", - "x-argocd-api-token": "${input:argocd-api-token}", + "x-argocd-api-token": "${input:argocd-api-token}" } } } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 51e3965..749309f 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,100 @@ -# ArgoCD MCP Server +# Argo CD MCP Server -A Model Context Protocol (MCP) server implementation for ArgoCD, enabling seamless integration with Visual Studio Code through both stdio and SSE (Server-Sent Events) transport protocols. +An implementation of [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for [Argo CD](https://argo-cd.readthedocs.io/en/stable/), enabling AI assistants to interact with your Argo CD applications through natural language. This server allows for seamless integration with Visual Studio Code and other MCP clients through both stdio and Server-Sent Events (SSE) transport protocols. ## Features -- Integration with ArgoCD API -- Support for both stdio and SSE transport modes +- **Transport Protocols**: Supports both stdio and SSE transport modes for flexible integration with different clients +- **Complete Argo CD API Integration**: Provides comprehensive access to Argo CD resources and operations +- **AI Assistant Ready**: Pre-configured tools for AI assistants to interact with Argo CD in natural language -## Development +## Installation + +### Prerequisites + +- Node.js (v18 or higher recommended) +- pnpm package manager (for development) +- Argo CD instance with API access + +### Usage with VSCode + +1. Create a `.vscode/mcp.json` file in your project: + ```json + { + "inputs": [ + { + "id": "argocd-base-url", + "type": "promptString", + "description": "Enter the ArgoCD base URL", + "password": false + }, + { + "id": "argocd-api-token", + "type": "promptString", + "description": "Enter the ArgoCD API token", + "password": true + } + ], + "servers": { + "argocd-mcp-server-stdio": { + "type": "stdio", + "command": "npx", + "args": [ + "argocd-mcp-server", + "stdio" + ], + "env": { + "ARGOCD_BASE_URL": "${input:argocd-base-url}", + "ARGOCD_API_TOKEN": "${input:argocd-api-token}" + } + } + } + } + ``` + +2. Start a conversation with an AI assistant in VS Code that supports MCP. + +### Usage with Claude Desktop + +1. Create a `claude_desktop_config.json` configuration file: + ```json + { + "mcpServers": { + "argocd-mcp": { + "command": "npx", + "args": ["argocd-mcp-server", "stdio"], + "env": { + "ARGOCD_BASE_URL": "https://your-argocd-server.com", + "ARGOCD_API_TOKEN": "your_argocd_token" + } + } + } + } + ``` + +2. Configure Claude Desktop to use this configuration file in settings. + +## Available Tools + +The server provides the following ArgoCD management tools: + +### Application Management +- `list_applications`: List and filter all applications +- `get_application`: Get detailed information about a specific application +- `create_application`: Create a new application +- `update_application`: Update an existing application +- `delete_application`: Delete an application +- `sync_application`: Trigger a sync operation on an application + +### Resource Management +- `get_application_resource_tree`: Get the resource tree for a specific application +- `get_application_managed_resources`: Get managed resources for a specific application +- `get_application_workload_logs`: Get logs for application workloads (Pods, Deployments, etc.) +- `get_resource_events`: Get events for resources managed by an application +- `get_resource_actions`: Get available actions for resources +- `run_resource_action`: Run an action on a resource + +## For Development 1. Clone the repository: ```bash @@ -20,18 +107,9 @@ cd argocd-mcp-server pnpm install ``` -3. Copy the `.env.example` and create a `.env` file in the root directory with your ArgoCD configuration: -```env -# Uncomment to disable SSL verification (not recommended for production) -# NODE_TLS_REJECT_UNAUTHORIZED=0 - -ARGOCD_BASE_URL= -ARGOCD_API_TOKEN= -``` - -4. Start the development server with hot reloading enabled: +3. Start the development server with hot reloading enabled: ```bash +# For SSE mode with hot reloading pnpm run dev ``` Once the server is running, you can utilize the MCP server within Visual Studio Code or other MCP client. -