# mcp-server-ssh-list A minimal MCP (Model Context Protocol) server that exposes SSH server definitions from a TOML config file. Built in Rust, lets AI assistants look up SSH connection details by name or alias. Communicates via stdio using JSON-RPC 2.0, like all MCP servers. ## Tools | Tool | Description | |------|-------------| | `list_servers` | List all SSH servers with their aliases, host, user, port, and description | | `lookup_server` | Look up a server by name or alias (case-insensitive), returns SSH connection details | ### list_servers Returns all configured SSH servers. No parameters. ### lookup_server Find a server by name or alias. **Parameters:** | Name | Type | Required | Description | |------|------|----------|-------------| | `query` | string | yes | Server name or alias to look up (case-insensitive) | **Matching behavior:** - Name lookup uses **substring** matching (e.g., "prod" matches "production-web") - Alias lookup uses **exact** matching (e.g., "web" only matches if "web" is a defined alias) ## Prerequisites - Rust (edition 2024) ## Setup Create the config file: ```bash mkdir -p ~/.config/mcp-server-ssh-list ``` Create `~/.config/mcp-server-ssh-list/ssh-list.toml`: ```toml [[servers]] name = "Production Web" aliases = ["prod", "web"] host = "192.168.1.100" user = "deploy" port = 22 description = "Main production web server" [[servers]] name = "Staging" aliases = ["stage"] host = "192.168.1.200" description = "Staging environment" ``` Fields `user` (default: `root`) and `port` (default: `22`) are optional. A sample config is included in the repo root as `ssh-list.toml`. ## Build ```bash cargo build --release ``` This produces `target/release/mcp-server-ssh-list`. For development: ```bash cargo build # debug build cargo run # run in dev mode RUST_LOG=debug cargo run # run with debug logging ``` ## MCP Configuration Add to your Claude Desktop config (`~/.config/Claude/claude_desktop_config.json`): ```json { "mcpServers": { "ssh-list": { "command": "/path/to/mcp-server-ssh-list" } } } ``` ## Project Structure ``` src/ main.rs - entry point, reads config, starts stdio transport config.rs - Config and SshServer structs, TOML deserialization, matching logic server.rs - MCP tool definitions (list_servers, lookup_server) ``` ## License MIT