Skip to main content

AI-Powered Server Management - Connect Claude, Cursor, and other AI tools directly to your Alpacon infrastructure

Project description

Alpacon MCP Server

๐Ÿš€ Zero-trust server access for AI agents: Let Claude, Cursor, and other AI tools operate your own and your customers' infrastructure through Alpaconโ€”no VPN, no SSH keys

An MCP (Model Context Protocol) server that extends Alpacon's browser-based, zero-trust infrastructure access to AI assistants. Execute commands, transfer files, monitor metrics, and manage servers across your own and customer environments using natural language.

Python Version MCP Compatible License

โœจ What is Alpacon MCP server?

Alpacon provides browser-based server access with zero-trust security built inโ€”no SSH keys, no VPNs. The Alpacon MCP Server brings that same secure access to AI assistants, so you can operate your own and your customers' infrastructure through natural language while every action is authenticated, authorized, and recorded.

๐ŸŽฏ Key benefits

  • Zero-trust access for AI: AI agents authenticate through Alpacon's identity layerโ€”same RBAC, audit trails, and session recording as human users
  • No credential management: No SSH keys or VPN configs to distributeโ€”one identity, every server
  • Natural language operations: "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: Access servers across your own and customer environments with a single interface
  • Compliance-ready: Every AI operation is logged with full session recording and audit trails

๐ŸŒŸ Core features

๐Ÿ” Zero-trust infrastructure access

  • Authenticate once, access every authorized server
  • Role-based access control (RBAC) with time-limited permissions
  • Full audit trail for every AI operation
  • Automatic session recording for compliance

๐Ÿ”ง Secure remote operations

  • Websh sessions for browser-based terminal access
  • Command execution with real-time output
  • File upload/download via WebFTP with S3 presigned URLs
  • Persistent connections with automatic session management

๐Ÿ“Š Real-time monitoring

  • CPU, memory, disk, and network metrics
  • Performance trend analysis and top server identification
  • Custom alert rule management
  • Comprehensive health dashboards

๐Ÿ’ป System administration

  • User, group, and IAM management
  • Package inventory and system information
  • Network interface and disk analysis
  • Event tracking and search

๐Ÿš€ Quick start

For first-time users (recommended)

Just run this command and follow the interactive setup:

uvx alpacon-mcp

That's it! The setup wizard will:

  1. โœ… Ask for your region (default: ap1)
  2. โœ… Ask for your workspace name
  3. โœ… Ask for your API token
  4. โœ… Save configuration automatically
  5. โœ… Test the connection
  6. โœ… Show you the Claude Desktop config to copy

No manual file editing required!

Get your API token

Before running the setup, get your API token:

  1. Visit https://alpacon.io
  2. Log in to your account
  3. Click "API Token" in left sidebar
  4. Create new token or copy existing one
  5. Configure ACL permissions (important for command execution)
  6. Copy the token (starts with alpat-...)

Connect to your MCP client

After setup completes, add the configuration to your MCP client:

{
  "mcpServers": {
    "alpacon": {
      "command": "uvx",
      "args": ["alpacon-mcp"]
    }
  }
}

Client-specific locations:

  • Claude Desktop:
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Cursor: .cursor/mcp.json in your project
  • VS Code: MCP extension settings

Restart or reconnect your MCP client and you're ready! ๐ŸŽ‰


๐Ÿ“‹ CLI commands reference

uvx alpacon-mcp                                # Start server (auto-setup if needed)
uvx alpacon-mcp setup                          # Run setup wizard (shows token file path)
uvx alpacon-mcp setup --local                  # Use project config instead of global
uvx alpacon-mcp setup --token-file ~/my.json   # Use custom file location
uvx alpacon-mcp test                           # Test your connection
uvx alpacon-mcp list                           # Show configured workspaces
uvx alpacon-mcp add                            # Add another workspace (shows path)

๐Ÿ”ง Advanced installation options

Option A: install UV (if not already installed)

curl -LsSf https://astral.sh/uv/install.sh | sh

Option B: manual configuration

If you prefer to manually configure tokens:

Global Configuration (recommended):

mkdir -p ~/.alpacon-mcp
echo '{
  "ap1": {
    "production": "alpat-ABC123xyz789...",
    "staging": "alpat-DEF456uvw012..."
  }
}' > ~/.alpacon-mcp/token.json

Project-Local Configuration:

mkdir -p config
echo '{
  "ap1": {
    "my-workspace": "alpat-ABC123xyz789..."
  }
}' > config/token.json

Environment Variables:

export ALPACON_MCP_AP1_PRODUCTION_TOKEN="alpat-ABC123xyz789..."
uvx alpacon-mcp

Option C: development installation

git clone https://github.com/alpacax/alpacon-mcp.git
cd alpacon-mcp
uv venv && source .venv/bin/activate
uv install
python main.py

๐Ÿ”Œ Connect to other AI tools

Cursor IDE

Create .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "alpacon": {
      "command": "uvx",
      "args": ["alpacon-mcp"]
    }
  }
}

VS Code with MCP extension

Install the MCP extension and add to settings:

{
  "mcp.servers": {
    "alpacon": {
      "command": "uvx",
      "args": ["alpacon-mcp"]
    }
  }
}

Note: Token configuration is automatically discovered from:

  1. ~/.alpacon-mcp/token.json (global - recommended)
  2. ./config/token.json (project-local)
  3. Environment variables

๐Ÿ’ฌ 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

  • list_servers: List all servers in workspace
  • get_server: Get detailed server information
  • get_server_overview: Comprehensive server overview (system info + metrics)
  • list_server_notes: View server documentation
  • create_server_note: Create server notes

๐Ÿ“Š Monitoring & metrics

  • get_cpu_usage: CPU utilization metrics
  • get_memory_usage: Memory consumption data
  • get_disk_usage: Disk space metrics
  • get_disk_io: Disk I/O performance metrics
  • get_network_traffic: Network bandwidth usage
  • get_top_servers: Top servers by metric type(s)
  • get_alert_rules: Alert rules configuration
  • get_server_metrics_summary: Comprehensive health overview

๐Ÿ’ป 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
  • get_system_time: System time and uptime

๐Ÿ”ง Remote operations

Command API (requires ACL permission)

  • execute_command_with_acl: Execute commands on servers
  • execute_command_sync: Execute and wait for results
  • get_command_result: Get command execution results
  • list_commands: List recent command history
  • execute_command_multi_server: Execute on multiple servers simultaneously

Websh (shell access)

  • execute_command: Execute single command (auto-manages connections)
  • execute_command_batch: Execute multiple commands on same server
  • websh_session_create: Create Websh session
  • websh_sessions_list: List active sessions
  • websh_session_reconnect: Create new channel for existing session
  • websh_session_terminate: Close sessions
  • websh_websocket_execute: Single command via WebSocket
  • websh_websocket_batch_execute: Multiple commands via WebSocket
  • websh_channel_connect: Persistent connection management
  • websh_channel_execute: Execute using persistent channels
  • websh_channels_list: List active WebSocket channels
  • websh_channel_disconnect: Disconnect and clean up connections

WebFTP (file management)

  • webftp_session_create: Create file transfer session
  • 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

๐Ÿ”” Alert management

  • list_alerts: List alerts with optional filtering
  • get_alert: Get alert details
  • mute_alert: Mute an alert temporarily
  • create_alert_rule: Create monitoring thresholds
  • update_alert_rule: Update alert rule configuration
  • delete_alert_rule: Delete an alert rule

๐Ÿ›ก๏ธ Security ACLs

  • list_command_acls: List command ACL rules
  • create_command_acl: Create command ACL rule
  • update_command_acl: Update command ACL rule
  • delete_command_acl: Delete command ACL rule
  • list_server_acls: List server ACL rules
  • create_server_acl: Create server ACL rule
  • list_file_acls: List file ACL rules
  • create_file_acl: Create file ACL rule

๐Ÿ“‹ Events & logging

  • list_events: Browse server events and logs
  • get_event: Get event details by ID
  • search_events: Search and filter events

๐Ÿ“ Audit logs

  • list_activity_logs: Audit user and system actions
  • get_activity_log: Get activity log details
  • list_server_logs: Server command execution logs
  • list_webftp_logs: WebFTP file transfer logs

๐Ÿ” Identity and access management (IAM)

User management:

  • list_iam_users: List workspace IAM users with pagination
  • get_iam_user: Get detailed user information
  • create_iam_user: Create new users with group assignment
  • update_iam_user: Update user details and group memberships
  • delete_iam_user: Remove users from workspace

Group management:

  • list_iam_groups: List all workspace groups
  • create_iam_group: Create new IAM group

โš™๏ธ Workspace

  • list_workspaces: List available workspaces

๐ŸŒ 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

๐Ÿš€ 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

  • Zero-trust architecture: Every request authenticated and authorized through Alpacon's identity layer
  • Session recording: All Websh and WebFTP operations automatically recorded for audit
  • Workspace-based access control: Separate tokens per workspace with RBAC
  • ACL configuration required: Configure token permissions in Alpacon web interface for command execution
  • Audit logging: All operations logged with full traceability

โš ๏ธ Command execution limitations

Important: Websh and command execution tools can only run pre-approved commands configured in your token's ACL settings:

  1. Visit token details in Alpacon web interface (click on your token)
  2. Configure ACL permissions for allowed commands, servers, and operations
  3. Commands not in ACL will be rejected with 403/404 errors
  4. 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 give your AI agents secure infrastructure access?

Built with โค๏ธ by AlpacaX for the Alpacon ecosystem

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

alpacon_mcp-0.5.0.tar.gz (239.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alpacon_mcp-0.5.0-py3-none-any.whl (302.4 kB view details)

Uploaded Python 3

File details

Details for the file alpacon_mcp-0.5.0.tar.gz.

File metadata

  • Download URL: alpacon_mcp-0.5.0.tar.gz
  • Upload date:
  • Size: 239.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for alpacon_mcp-0.5.0.tar.gz
Algorithm Hash digest
SHA256 13cd3799484eafaf7d5a8e6754151c3cc5ef5c27e4a5857c898fc55b8ef39f6e
MD5 e96d7ae948b21eafdcf5ed84dcf6404a
BLAKE2b-256 0d42175e57f032782e00a16e15ab92475e940e2b7098d12508387145db938a21

See more details on using hashes here.

Provenance

The following attestation bundles were made for alpacon_mcp-0.5.0.tar.gz:

Publisher: publish.yml on alpacax/alpacon-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file alpacon_mcp-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: alpacon_mcp-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 302.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for alpacon_mcp-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 968449aabda1f30b89d8dc3141e23991464aef45fcad89c775720daffb640f9d
MD5 8e95ccd413bba3bcdac6baa66916f7a1
BLAKE2b-256 85e25374a09f8bb904e0b1bbbf5d4f48d3226cbe481bde79d52e355f17af27f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for alpacon_mcp-0.5.0-py3-none-any.whl:

Publisher: publish.yml on alpacax/alpacon-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page