- SSH-MCP server with 7 infrastructure management tools * ssh_list_hosts - List all available hosts * ssh_exec - Execute commands on remote hosts * ssh_get_file / ssh_put_file - File operations * ssh_docker_ps - List Docker containers * lxc_list / lxc_exec - LXC container management - HTTP/SSE transport wrapper for Claude Code integration * FastAPI-based HTTP server on port 8081 * Server-Sent Events (SSE) support * MCP 2025 specification compliant - Complete deployment on LXC 110 (10.50.0.110) * SSH key-based authentication (Ed25519) * Systemd service for automatic startup * Tested and verified on all infrastructure - Comprehensive documentation * Complete deployment guide * Git collaboration workflow * API usage examples Developed collaboratively by Claude Code and Agent Zero. Infrastructure Access: - photon.obnh.io (test target) - proton.obr.sh (development server, hosts this repo) - fry.obr.sh (migration target) - Proxmox 10.50.0.72 (LXC/VM host) 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
135 lines
3.7 KiB
Markdown
135 lines
3.7 KiB
Markdown
# SSH-MCP Server
|
|
|
|
Model Context Protocol (MCP) server providing SSH-based infrastructure access for Claude Code and Agent Zero.
|
|
|
|
## Overview
|
|
|
|
The SSH-MCP server enables Claude Code and Agent Zero to securely access and manage the OBNH/OBR infrastructure through a standardized MCP interface.
|
|
|
|
## Features
|
|
|
|
- **7 Infrastructure Management Tools**:
|
|
- `ssh_list_hosts` - List all available infrastructure hosts
|
|
- `ssh_exec` - Execute commands on remote hosts
|
|
- `ssh_get_file` / `ssh_put_file` - File operations
|
|
- `ssh_docker_ps` - List Docker containers
|
|
- `lxc_list` / `lxc_exec` - LXC container management
|
|
|
|
- **MCP 2025 Specification Compliant**
|
|
- **HTTP/SSE Transport** for Claude Code integration
|
|
- **SSH Key-Based Authentication** (Ed25519)
|
|
- **Systemd Service** for automatic startup
|
|
|
|
## Deployment
|
|
|
|
- **Server**: LXC Container 110 at 10.50.0.110
|
|
- **HTTP API**: http://10.50.0.110:8081
|
|
- **Status**: Fully operational
|
|
|
|
## Infrastructure Access
|
|
|
|
The SSH-MCP server provides access to:
|
|
- **photon.obnh.io** (46.247.109.251) - Primary test target, Debian, Traefik, Gitea, Mastodon
|
|
- **proton.obr.sh** (72.61.83.117) - Development server, Ubuntu, Traefik, Gitea
|
|
- **fry.obr.sh** - Migration target for photon services
|
|
- **Proxmox** (10.50.0.72) - Host with all LXC/VMs in 10.50.0.0/24
|
|
|
|
## Documentation
|
|
|
|
- [Complete Deployment Guide](docs/ssh-mcp-server-complete.md)
|
|
- [Git Collaboration Setup](docs/git-collaboration.md)
|
|
|
|
## Quick Start
|
|
|
|
### Test the HTTP API
|
|
|
|
```bash
|
|
# Health check
|
|
curl http://10.50.0.110:8081/
|
|
|
|
# List available tools
|
|
curl -X POST http://10.50.0.110:8081/tools
|
|
|
|
# List infrastructure hosts
|
|
curl -X POST http://10.50.0.110:8081/tools/call \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"name": "ssh_list_hosts", "arguments": {}}'
|
|
|
|
# Execute command on proton
|
|
curl -X POST http://10.50.0.110:8081/tools/call \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"name": "ssh_exec", "arguments": {"host": "proton", "command": "hostname"}}'
|
|
```
|
|
|
|
### Claude Code Integration
|
|
|
|
```python
|
|
import anthropic
|
|
|
|
client = anthropic.Anthropic()
|
|
response = client.messages.create(
|
|
model="claude-sonnet-4-5-20250929",
|
|
max_tokens=1024,
|
|
mcp_servers=[{
|
|
"type": "url",
|
|
"name": "ssh-infrastructure",
|
|
"url": "http://10.50.0.110:8081"
|
|
}],
|
|
messages=[{"role": "user", "content": "List all infrastructure hosts"}]
|
|
)
|
|
```
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
ssh-mcp-server/
|
|
├── README.md
|
|
├── docs/
|
|
│ ├── ssh-mcp-server-complete.md # Complete deployment guide
|
|
│ └── git-collaboration.md # Git workflow documentation
|
|
├── implementation/
|
|
│ ├── ssh-mcp-server.py # Core MCP server (stdio transport)
|
|
│ └── ssh-mcp-http-wrapper.py # HTTP/SSE transport wrapper
|
|
└── config/
|
|
└── (systemd service files)
|
|
```
|
|
|
|
## Collaboration
|
|
|
|
This project is collaboratively developed by:
|
|
- **Claude Code**: Implementation and deployment
|
|
- **Agent Zero**: Testing and integration
|
|
|
|
## Testing Strategy
|
|
|
|
- **Primary Test Target**: photon.obnh.io
|
|
- Validate SSH-MCP operations against production services
|
|
- Test Docker container management
|
|
- Verify file operations
|
|
|
|
- **Development Server**: proton.obr.sh
|
|
- Host this repository
|
|
- Test git operations via SSH-MCP
|
|
- Development and integration testing
|
|
|
|
## Status
|
|
|
|
✅ **OPERATIONAL**
|
|
|
|
All components deployed and tested:
|
|
- LXC 110 created and running
|
|
- SSH keys configured on all infrastructure
|
|
- HTTP/SSE wrapper serving on port 8081
|
|
- All 7 tools tested and working
|
|
- Systemd service enabled
|
|
- Documentation complete
|
|
|
|
## License
|
|
|
|
Internal OBNH/OBR infrastructure project
|
|
|
|
---
|
|
|
|
**Deployment Date**: 2025-11-13
|
|
**Repository**: https://git.proton.obr.sh/olaf/ssh-mcp-server
|