A Model Context Protocol (MCP) server that enables AI assistants to interact with DevSpace - a developer tool for Kubernetes that lets you develop and deploy cloud-native software faster.
- Complete DevSpace CLI Integration: All major DevSpace commands available through MCP
- Intelligent Error Handling: Enhanced error messages with troubleshooting suggestions
- Structured Logging: Configurable logging with request tracking and performance monitoring
- Modular Architecture: Clean, maintainable codebase with separated concerns
- Type Safety: Full TypeScript support with comprehensive validation
- Development Workflow: File sync, port forwarding, log streaming, and more
- Node.js v18+
- DevSpace CLI installed and in PATH
- Access to a Kubernetes cluster
npm install -g devspace-mcp-serverAdd to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"devspace": {
"command": "npx",
"args": ["devspace-mcp-server"],
"cwd": "~/",
"env": {
"LOG_LEVEL": "info"
}
}
}
}Add to your Cursor settings (Ctrl/Cmd + Shift + P β "Preferences: Open Settings (JSON)"):
{
"mcp": {
"servers": {
"devspace": {
"command": "npx",
"args": ["devspace-mcp-server"],
"cwd": "~/",
"env": {
"LOG_LEVEL": "info",
"DEVSPACE_TIMEOUT": "300000"
}
}
}
}
}Note: The cwd can be set to any convenient directory (like your home directory ~/ or projects folder). Each DevSpace command accepts an optional workingDirectory parameter, allowing you to work with multiple projects without changing the MCP configuration.
LOG_LEVEL: Set logging level (debug,info,warn,error)DEVSPACE_TIMEOUT: Command timeout in milliseconds (default: 300000)DEVSPACE_MAX_RETRIES: Maximum retry attempts (default: 3)
devspace_init: Initialize new DevSpace projectsdevspace_dev: Start development mode with file sync and port forwardingdevspace_deploy: Deploy applications to Kubernetesdevspace_build: Build and manage Docker images
devspace_logs: Stream container logs with filteringdevspace_enter: Open interactive terminal sessionsdevspace_analyze: Analyze configuration and cluster status
devspace_list: List resources (deployments, profiles, etc.)devspace_use: Switch contexts, namespaces, or profilesdevspace_set/devspace_reset: Manage variables and statedevspace_print: Display current configuration
devspace_run: Execute custom commands fromdevspace.yamldevspace_sync: Manual file synchronizationdevspace_ui: Launch DevSpace web UIdevspace_add/devspace_remove: Plugin managementdevspace_cleanup/devspace_purge: Resource cleanup
Since every tool supports a workingDirectory parameter, you can easily work with multiple DevSpace projects:
"Initialize a new DevSpace project in ~/projects/my-api"
"Deploy the project in ~/projects/frontend using the production profile"
"Start development mode for the project in /home/user/microservices/auth-service"
When working within one project, you can omit the workingDirectory if your MCP cwd is set correctly:
"Initialize a new DevSpace project for my Next.js app and deploy it to staging"
"Start DevSpace development mode with file sync enabled, then show me the logs from the web container"
"List all available DevSpace profiles and switch to the production profile"
"Show the current configuration for the project in ~/projects/backend"
"Analyze my DevSpace configuration and show any issues with the current deployment"
"Check the logs for the web container in the project at /path/to/my/project"
The server is built with a modular architecture for maintainability:
src/
βββ index.ts # Main server setup and request handling
βββ command-handlers.ts # Business logic for each DevSpace command
βββ command-executor.ts # Command execution with timeout/abort support
βββ schemas.ts # Zod validation schemas
βββ tool-definitions.ts # MCP tool definitions
βββ validation.ts # Requirements and environment validation
βββ logger.ts # Structured logging system
βββ config.ts # Configuration management
βββ types.ts # TypeScript type definitions
If you want to contribute or modify the package locally:
git clone https://github.com/RaghuChandrasekaran/devspace-mcp-server.git
cd devspace-mcp-server
npm install
npm run buildThen update your MCP configuration to use the local version:
{
"mcpServers": {
"devspace": {
"command": "node",
"args": ["/path/to/devspace-mcp-server/dist/index.js"],
"cwd": "~/",
"env": {
"LOG_LEVEL": "debug"
}
}
}
}# Development mode with file watching
npm run dev:watch
# Type checking
npm run typecheck
# Build production version
npm run build
# Clean build artifacts
npm run clean# Check DevSpace installation
devspace version
# Verify Kubernetes access
kubectl cluster-info- Command timeout: Increase
DEVSPACE_TIMEOUTenvironment variable - Permission denied: Check Kubernetes cluster permissions and namespace access
- Port conflicts: Use different ports in
devspace_uicalls - File sync issues: Ensure proper file permissions and disk space
MIT License - see LICENSE file for details.