Skip to content

sameehj/ssh-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ssh-mcp: Simple, Secure, Structured AI Tool Execution over SSH

License: MIT Status: Pre-release AI-Ready

ssh-mcp is a simple, secure, and structured CLI tool that enables AI agents and developers to execute JSON-based commands over SSH using the Model Context Protocol (MCP).

The missing bridge between AI and ops.

It acts as a bridge between AI systems (like Claude, LLaMA, GPT) and real-world system operations, allowing tools, prompts, and resource-based interactions through a structured protocol.

๐Ÿ“š Table of Contents

๐Ÿ“Œ Current Status

๐Ÿšง Under active development โ€“ MVP Bash implementation available. Go version and package manager support coming soon.


โ“ The Problem

SSH works great for people. But for AI agents and automated devtools?

  • There's no structure โ€” just raw text output
  • No arguments, schemas, or results
  • No streaming, prompting, or metadata

Result: AI agents can't reliably automate remote tasks. Devtools can't reason with responses. And humans must glue everything together.


โœ… The Solution

ssh-mcp makes SSH structured, predictable, and AI-friendly.

  • Wrap any remote tool as a JSON-based callable
  • Interact with remote machines using structured requests
  • Return consistent results with explanations and suggestions
  • Secure-by-default using existing SSH keys

โœจ Key Benefits

Feature Description
โœ… Simple One binary or bash script, zero dependencies
๐Ÿ” Secure Uses existing SSH auth (no daemon, no socket)
๐Ÿ“ฆ Structured MCP protocol for inputs, outputs, context
๐Ÿค– AI-Ready Built for agents, LLMs, auto-devtools
โš™๏ธ Extensible Add your own tools, prompts, resources

๐Ÿ‘ฅ Who Should Use This

If you're building:

  • AI tools that talk to real infrastructure
  • Developer copilots that touch live servers
  • Secure automations that need structured control

...then ssh-mcp helps you move fast without sacrificing control or safety.


๐Ÿ’ก Use Cases

  • ๐Ÿ’ป Developers: Structured command execution over SSH
  • ๐Ÿค– AI Agents (Claude, GPT, LLaMA): Natural language โ†’ structured tool invocation
  • ๐Ÿ› ๏ธ Automation: Run predefined tools, long-running ops, and observability
  • ๐Ÿ‘จโ€๐Ÿ’ป Replit / Cursor / AutoGPT: Drop-in remote tool layer

โš–๏ธ Comparison to Alternatives

Feature Raw SSH REST APIs ssh-mcp
Structured Output โŒ โœ… โœ…
Schema-based Args โŒ โœ… โœ…
Streaming Support โŒ Limited โœ…
Requires Daemon โŒ Usually โŒ
Secure by SSH โœ… โŒ โœ…
AI Prompt Support โŒ โŒ โœ…

โš™๏ธ Protocol Design

Request Format

{
  "tool": "string",
  "args": {
    "property1": "value1"
  },
  "conversation_id": "uuid",
  "context": {
    "user_intent": "string",
    "reasoning": "string"
  }
}

Response Format

{
  "conversation_id": "uuid",
  "status": { "code": 0, "message": "Success" },
  "result": { "property1": "value1" },
  "explanation": "string",
  "suggestions": [
    { "tool": "string", "description": "string" }
  ],
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  }
}

โšก Quick Start

# 1. Install
git clone https://github.com/sameehj/ssh-mcp.git
cd ssh-mcp
chmod +x install.sh
./install.sh

# 2. Run a tool
echo '{"tool":"system.info"}' | ssh-mcp user@host

Note: Package manager support (brew, apt, scoop) is planned for future releases.


๐Ÿ” Prerequisites

  • SSH access to the target system
  • Bash and jq installed on remote machine
  • Key-based auth recommended

๐Ÿš€ Features

  • Full MCP Protocol support
  • Tools, prompts, and resource handling
  • Conversation tracking and AI context embedding
  • Structured error handling, suggestions, explanations
  • Shell completions, self-discovery, tool schemas

๐Ÿ“Š Tool Categories

Meta Tools

  • meta.discover: List tools
  • meta.describe: Tool descriptions
  • meta.schema: Tool input schema

System Tools

  • system.info: OS, CPU, memory
  • system.health: Disk, load, uptime

File Tools

  • file.read, file.write, file.list, file.find

Process Tools

  • process.list, process.info

Network Tools

  • network.status, network.route

Resources

  • resource.get, resource.list, resource.create

Long-Running

  • longRunning.backup, longRunning.scan, longRunning.download

๐Ÿค– AI Integration Example (Python)

import json, subprocess, uuid

class McpClient:
    def __init__(self, server):
        self.server = server
        self.conversation_id = str(uuid.uuid4())

    def execute_tool(self, tool_name, args=None, user_intent=None):
        payload = {
            "tool": tool_name,
            "args": args or {},
            "conversation_id": self.conversation_id,
        }
        if user_intent:
            payload["context"] = {"user_intent": user_intent}

        result = subprocess.run([
            "ssh", self.server, "./mcp.sh"
        ], input=json.dumps(payload).encode(), stdout=subprocess.PIPE)
        return json.loads(result.stdout)

๐Ÿ’ฌ Chat / REPL Support

Use ssh-mcp in conversational loops or LLaMA-based shells:

while true; do
  echo -n "mcp > "
  read CMD
  echo $CMD | ssh-mcp user@host
done

Pair this with a local LLM (e.g. LLaMA) to enable:

"Check CPU usage" โ†’ { "tool": "system.monitor" }


๐Ÿ”ฎ Roadmap

  • โœ… Bash-based MVP (mcp.sh)
  • ๐Ÿšง Go binary version (ssh-mcp)
  • ๐Ÿšง Streaming support for long-running tools
  • ๐Ÿšง Resource references: inline or URI-based
  • ๐Ÿšง Prompt + tool hybrid execution
  • ๐Ÿšง Plugin architecture for third-party tools
  • ๐Ÿšง Package manager support (brew, apt, scoop)
  • ๐Ÿšง Shell completions and --discover/--describe
  • ๐Ÿšง Integration with Claude, Cursor, Replit AI agents

๐Ÿชง License

MIT License โ€” see LICENSE file for details.


๐ŸŽฏ Architecture Diagram

SSH-MCP Architecture


๐Ÿ”Ž References & Related Projects


๐ŸŽ‰ Get Involved

Want to contribute tools, prompts, or ideas? Want to use ssh-mcp with your AI shell, devtool, or infra layer?

Let's build it together. Star the repo, fork it, or open an issue.


๐Ÿš€ Let's Build the AI Shell of the Future

ssh-mcp is more than a CLI โ€” it's a protocol for building intelligent, secure interfaces between humans, AI, and machines.

  • โญ Star the repo
  • ๐Ÿ› ๏ธ Contribute a tool or prompt
  • ๐Ÿ’ฌ Tell us what you're building

This is the terminal AI deserves.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages