AI-Powered Server Management - Connect Claude, Cursor, and other AI tools directly to your Alpacon infrastructure
Project description
Alpacon MCP Server
๐ AI-Powered Server Management - Connect Claude, Cursor, and other AI tools directly to your Alpacon infrastructure
An advanced MCP (Model Context Protocol) server that bridges AI assistants with Alpacon's server management platform, enabling natural language server administration, monitoring, and automation.
โจ What is Alpacon MCP Server?
The Alpacon MCP Server transforms how you interact with your server infrastructure by connecting AI assistants directly to Alpacon's management platform. Instead of switching between interfaces, you can now manage servers, monitor metrics, execute commands, and troubleshoot issues using natural language.
๐ฏ Key Benefits
- Natural Language Server Management - "Show me CPU usage for all web servers in production"
- AI-Powered Troubleshooting - "Investigate why server-web-01 is slow and suggest fixes"
- Multi-Workspace Support - Connect to your Alpacon workspaces with secure API authentication
- Real-Time Monitoring Integration - Access metrics, logs, and events through AI conversations
- Secure Websh & File Operations - Execute commands and transfer files via AI interface
๐ Core Features
๐ฅ๏ธ Server Management
- List and monitor servers in your workspace
- Get detailed system information and specifications
- Create and manage server documentation
- Multi-workspace support with API token management
๐ Real-Time Monitoring
- CPU, memory, disk, and network metrics
- Performance trend analysis
- Top server identification
- Custom alert rule management
- Comprehensive health dashboards
๐ป System Administration
- User and group management
- Package inventory and updates
- Network interface monitoring
- Disk and partition analysis
- System time and uptime tracking
๐ง Remote Operations
- Websh sessions for secure shell access
- Command execution with real-time output
- File upload/download via WebFTP
- Session management and monitoring
๐ Event Management
- Command acknowledgment and tracking
- Event search and filtering
- Execution history and status
- Automated workflow coordination
๐ Quick Start
1. Installation
Option A: Using uvx (Recommended)
# Install UV first (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Run directly without installation
uvx alpacon-mcp --help
# Run with configuration
uvx alpacon-mcp --config-file /path/to/config.json
Option B: Traditional Installation
# Install from PyPI
pip install alpacon-mcp
# Or using UV
uv tool install alpacon-mcp
# Run the server
alpacon-mcp
Option C: Development Installation
# Clone and setup for development
git clone https://github.com/alpacax/alpacon-mcp.git
cd alpacon-mcp
uv venv && source .venv/bin/activate
uv pip install -e .
2. Get API Token from Alpacon
- Visit your Alpacon workspace:
https://alpacon.io- Or if you have a specific workspace:
https://alpacon.io/workspace/
- Or if you have a specific workspace:
- Log in to your account
- Click "API Token" in the left sidebar
- Create a new token or copy existing token
- Configure Token Permissions (ACL):
- Click on the generated token to open details
- Configure Access Control List (ACL) settings
- Important: Command execution requires specific ACL permissions
- Set allowed commands, servers, and operations as needed
- Save the token securely
3. Configure Authentication
You need to create a token configuration file with your Alpacon API tokens. The server supports multiple workspaces.
Create Token Configuration File
Step 1: Create the token file anywhere you prefer
# Example: Create in your home directory
mkdir -p ~/.config/alpacon
nano ~/.config/alpacon/tokens.json
Step 2: Add your tokens using this format
{
"ap1": {
"your-workspace-name": "your-api-token-from-alpacon-web-interface"
}
}
Real Example:
{
"ap1": {
"production": "alpat-ABC123xyz789...",
"staging": "alpat-DEF456uvw012...",
"development": "alpat-GHI789rst345..."
}
}
Step 3: Run with your token file
# Method 1: Using environment variable (recommended)
ALPACON_MCP_CONFIG_FILE=~/.config/alpacon/tokens.json uvx alpacon-mcp
# Method 2: Using command line flag
uvx alpacon-mcp --config-file ~/.config/alpacon/tokens.json
Alternative: Environment Variables (For CLI/Testing)
Instead of a config file, you can use environment variables:
# Format: ALPACON_MCP_<REGION>_<WORKSPACE>_TOKEN (currently ap1 supported)
export ALPACON_MCP_AP1_PRODUCTION_TOKEN="alpat-ABC123xyz789..."
export ALPACON_MCP_AP1_STAGING_TOKEN="alpat-DEF456uvw012..."
# Run with environment variables
uvx alpacon-mcp
4. Connect to AI Client
Claude Desktop
Add this to your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"alpacon": {
"command": "uvx",
"args": ["alpacon-mcp"],
"env": {
"ALPACON_MCP_CONFIG_FILE": "~/.config/alpacon/tokens.json"
}
}
}
}
Cursor IDE
Create .cursor/mcp.json in your project root:
{
"mcpServers": {
"alpacon": {
"command": "uvx",
"args": ["alpacon-mcp"],
"env": {
"ALPACON_MCP_CONFIG_FILE": "~/.config/alpacon/tokens.json"
}
}
}
}
๐ฌ Usage Examples
Server Health Monitoring
"Give me a comprehensive health check for server web-01 including CPU, memory, and disk usage for the last 24 hours"
Performance Analysis
"Show me the top 5 servers with highest CPU usage and analyze performance trends"
System Administration
"List all users who can login on server web-01 and check for any users with sudo privileges"
Automated Troubleshooting
"Server web-01 is responding slowly. Help me investigate CPU, memory, disk I/O, and network usage to find the bottleneck"
Command Execution
"Execute 'systemctl status nginx' on server web-01 and check the service logs"
File Management
"Upload my config.txt file to /home/user/ on server web-01 and then download the logs folder as a zip"
Persistent Shell Sessions
"Create a persistent shell connection to server web-01 and run these commands: check disk usage, list running processes, and create a backup directory"
๐ง Available Tools
๐ฅ๏ธ Server Management
- servers_list - List all servers in workspace
- server_get - Get detailed server information
- server_notes_list - View server documentation
- server_note_create - Create server notes
๐ Monitoring & Metrics
- get_cpu_usage - CPU utilization metrics
- get_memory_usage - Memory consumption data
- get_disk_usage - Disk space and I/O metrics
- get_network_traffic - Network bandwidth usage
- get_server_metrics_summary - Comprehensive health overview
- get_cpu_top_servers - Identify performance leaders
๐ป System Information
- get_system_info - Hardware specifications and details
- get_os_version - Operating system information
- list_system_users - User account management
- list_system_groups - Group membership details
- list_system_packages - Installed software inventory
- get_network_interfaces - Network configuration
- get_disk_info - Storage device information
๐ง Remote Operations
Websh (Shell Access)
- websh_session_create - Create secure shell sessions
- websh_command_execute - Execute single commands
- websh_websocket_execute - Single command via WebSocket
- websh_channel_connect - Persistent connection management
- websh_channel_execute - Execute commands using persistent channels
- websh_channels_list - List active WebSocket channels
- websh_session_terminate - Close sessions
WebFTP (File Management)
- webftp_upload_file - Upload files using S3 presigned URLs
- webftp_download_file - Download files/folders (folders as .zip)
- webftp_uploads_list - Upload history
- webftp_downloads_list - Download history
- webftp_sessions_list - Active FTP sessions
๐ Event Management
- list_events - Browse server events and logs
- search_events - Find specific events
- acknowledge_command - Confirm command receipt
- finish_command - Mark commands as complete
๐ Identity and Access Management (IAM)
User Management:
- iam_users_list - List workspace IAM users with pagination
- iam_user_get - Get detailed user information
- iam_user_create - Create new users with group assignment
- iam_user_update - Update user details and group memberships
- iam_user_delete - Remove users from workspace
- iam_user_permissions_get - View effective user permissions
- iam_user_assign_role - Assign roles to users
Group & Role Management:
- iam_groups_list - List all workspace groups
- iam_group_create - Create groups with permissions
- iam_roles_list - List available roles
- iam_permissions_list - View all permissions
Advanced IAM Features:
- Workspace-level isolation for multi-tenant security
- Role-based access control (RBAC) implementation
- Group-based permission inheritance
- Comprehensive audit trails and logging
๐ Authentication
- auth_set_token - Configure API tokens
- auth_remove_token - Remove stored tokens
๐ Supported Platforms
| Platform | Status | Notes |
|---|---|---|
| Claude Desktop | โ Full Support | Recommended client |
| Cursor IDE | โ Full Support | Native MCP integration |
| VS Code | โ Full Support | Requires MCP extension |
| Continue | โ Full Support | Via MCP protocol |
| Other MCP Clients | โ Compatible | Standard protocol support |
๐ Documentation
- ๐ Complete Documentation - Full documentation index
- ๐ Getting Started Guide - Step-by-step setup
- โ๏ธ Configuration Guide - Advanced configuration
- ๐ง API Reference - Complete tool documentation
- ๐ก Usage Examples - Real-world scenarios
- ๐ ๏ธ Installation Guide - Platform-specific setup
- ๐ Troubleshooting - Common issues and solutions
๐ Advanced Usage
Multi-Workspace Management
# Configure tokens for multiple workspaces (ap1 region)
python -c "
from utils.token_manager import TokenManager
tm = TokenManager()
tm.set_token('ap1', 'company-prod', 'ap1-company-prod-token')
tm.set_token('ap1', 'company-staging', 'ap1-company-staging-token')
tm.set_token('ap1', 'company-dev', 'ap1-company-dev-token')
"
Custom Config File
# Use custom config file location
export ALPACON_MCP_CONFIG_FILE="/path/to/custom-tokens.json"
uvx alpacon-mcp
Docker Deployment
# Build and run with Docker
docker build -t alpacon-mcp .
docker run -v $(pwd)/config:/app/config:ro alpacon-mcp
SSE Mode (HTTP Transport)
# Run in Server-Sent Events mode for web integration
python main_sse.py
# Server available at http://localhost:8237
๐ Security & Best Practices
- Secure Token Storage - Tokens encrypted and never committed to git
- Workspace-Based Access Control - Separate tokens per workspace environment
- ACL Configuration Required - Configure token permissions in Alpacon web interface for command execution
- Audit Logging - All operations logged for security review
- Connection Validation - API endpoints verified before execution
โ ๏ธ Command Execution Limitations
Important: Websh and command execution tools can only run pre-approved commands configured in your token's ACL settings:
- Visit token details in Alpacon web interface (click on your token)
- Configure ACL permissions for allowed commands, servers, and operations
- Commands not in ACL will be rejected with 403/404 errors
- Contact your administrator if you need additional command permissions
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
- ๐ Bug Reports - Use GitHub issues
- ๐ก Feature Requests - Open discussions
- ๐ Documentation - Help improve guides
- ๐ง Code Contributions - Submit pull requests
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
Ready to transform your server management experience?
- ๐ Start with our Getting Started Guide
- ๐ง Explore the API Reference
- ๐ฌ Join our community discussions
Built with โค๏ธ for the Alpacon ecosystem
Project details
Release history Release notifications | RSS feed
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 alpacon_mcp-0.2.0.tar.gz.
File metadata
- Download URL: alpacon_mcp-0.2.0.tar.gz
- Upload date:
- Size: 141.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae766ccc89e5c184fefca419713a187f0920a45376b5a07b5b2bada0b611408f
|
|
| MD5 |
001e8fbd54c1cd1ac5ac19c6474598ff
|
|
| BLAKE2b-256 |
85bdbb147095a562e5044ed926fd8379b64239ddf1b954791f273a12d1ea9b27
|
Provenance
The following attestation bundles were made for alpacon_mcp-0.2.0.tar.gz:
Publisher:
publish.yml on alpacax/alpacon-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
alpacon_mcp-0.2.0.tar.gz -
Subject digest:
ae766ccc89e5c184fefca419713a187f0920a45376b5a07b5b2bada0b611408f - Sigstore transparency entry: 562900505
- Sigstore integration time:
-
Permalink:
alpacax/alpacon-mcp@1b275f050af113b02a401364ac1db23a2915bfa0 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/alpacax
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1b275f050af113b02a401364ac1db23a2915bfa0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file alpacon_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: alpacon_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 186.9 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 |
6ab058b92aea1be24e7f6331ddd90cfc1f12994e7bba79b71f233f50fe781f7a
|
|
| MD5 |
a1e2d7a7daae634e213dc707e6536e26
|
|
| BLAKE2b-256 |
558c573c2b17598217c23ebb29e4adb666f0f3e0fa32428d48e3f643d22f93b0
|
Provenance
The following attestation bundles were made for alpacon_mcp-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on alpacax/alpacon-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
alpacon_mcp-0.2.0-py3-none-any.whl -
Subject digest:
6ab058b92aea1be24e7f6331ddd90cfc1f12994e7bba79b71f233f50fe781f7a - Sigstore transparency entry: 562900513
- Sigstore integration time:
-
Permalink:
alpacax/alpacon-mcp@1b275f050af113b02a401364ac1db23a2915bfa0 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/alpacax
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1b275f050af113b02a401364ac1db23a2915bfa0 -
Trigger Event:
push
-
Statement type: