SSH proxy for GNS3 MCP. ansible, ssh, tftp, web-proxy + tools
2.7K
FastAPI-based proxy for SSH automation in GNS3 network labs with TFTP server and HTTP/HTTPS reverse proxy.
/opt/gns3-ssh-proxy/tftphttp://proxy:8022/http-proxy/{device_ip}:{port}/pathservices:
gns3-ssh-proxy:
image: chistokhinsv/gns3-ssh-proxy:0.3.0
container_name: gns3-ssh-proxy
network_mode: host
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /opt/gns3-ssh-proxy:/opt/gns3-ssh-proxy
environment:
- GNS3_HOST=192.168.1.20
- GNS3_PORT=80
- GNS3_USER=admin
- GNS3_PASSWORD=your_password
docker run -d \
--name gns3-ssh-proxy \
--network host \
--restart unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /opt/gns3-ssh-proxy:/opt/gns3-ssh-proxy \
-e GNS3_HOST=192.168.1.20 \
-e GNS3_PORT=80 \
-e GNS3_USER=admin \
-e GNS3_PASSWORD=your_password \
chistokhinsv/gns3-ssh-proxy:0.3.0
POST /ssh/configure - Create/configure SSH sessionGET /ssh/status/{node_name} - Check session statusPOST /ssh/cleanup - Clean orphaned sessionsPOST /ssh/send_command - Execute show commandPOST /ssh/send_config_set - Send configurationPOST /local/execute - Execute command on proxy containerPOST /tftp (action: list, upload, download, delete, status)POST /http-proxy (action: register, unregister, list, reload)GET /ssh/buffer/{node_name} - Read continuous bufferGET /ssh/history/{node_name} - Command historyGET /proxy/registry - Discover lab proxiesGET /health - Health check endpointGET /version - Service versionGET /proxy/registry - Multi-proxy discoveryimport httpx
# Configure SSH session
response = httpx.post("http://192.168.1.20:8022/ssh/configure", json={
"node_name": "Router1",
"device_dict": {
"device_type": "cisco_ios",
"host": "10.1.0.1",
"username": "admin",
"password": "cisco123"
}
})
# Execute command
response = httpx.post("http://192.168.1.20:8022/ssh/send_command", json={
"node_name": "Router1",
"command": "show version"
})
print(response.json()["output"])
# Access device web UI through reverse proxy
ui_response = httpx.get("http://192.168.1.20:8022/http-proxy/10.1.0.1:80/")
โโโโโโโโโโโโโโโโ
โ MCP Server โ
โโโโโโโโฌโโโโโโโโ
โ
โโโโโโโโผโโโโโโโโโโโโโ
โ Main Proxy โ (GNS3 Host)
โ 192.168.1.20 โ
โโโโโโโโฌโโโโโโโโโโโโโ
โ
โโโโโโผโโโโโ โโโโโโโโโโโ
โ Lab โ โ Lab โ
โ Proxy 1 โ โ Proxy 2 โ
โ 10.1.0 โ โ 10.2.0 โ
โโโโโโฌโโโโโ โโโโโโฌโโโโโ
โ โ
โโโโโโผโโโโโ โโโโโผโโโโโโ
โ Devices โ โ Devices โ
โโโโโโโโโโโ โโโโโโโโโโโ
# Health check
curl http://localhost:8022/health
# Version check
curl http://localhost:8022/version
# TFTP file list
curl -X POST http://localhost:8022/tftp -H "Content-Type: application/json" \
-d '{"action": "list"}'
# HTTP reverse proxy device list
curl -X POST http://localhost:8022/http-proxy -H "Content-Type: application/json" \
-d '{"action": "list"}'
0.3.0 - Auto-updated by GitHub Actions
MIT License - See LICENSEโ for details
Contributions welcome! Please read the contributing guidelines before submitting PRs.
Report issues at: https://github.com/ChistokhinSV/gns3-mcp/issuesโ
Content type
Image
Digest
sha256:e08c16df4โฆ
Size
101.5 MB
Last updated
10 months ago
docker pull chistokhinsv/gns3-ssh-proxy