MCP (Model Context Protocol) Support

February 10, 2026 · View on GitHub

Autohand includes a built-in MCP client that connects to external MCP servers, extending your agent with tools from databases, APIs, browsers, and any MCP-compatible service.

Table of Contents


Overview

MCP is an open protocol for connecting AI agents to external tools. Autohand's MCP client supports:

  • stdio transport -- spawns a child process and communicates via JSON-RPC 2.0 over stdin/stdout
  • SSE transport -- connects to an HTTP server using Server-Sent Events (planned)
  • Automatic tool discovery -- discovers and registers tools from connected servers
  • Namespaced tools -- MCP tools are prefixed to avoid collisions with built-in tools
  • Non-blocking startup -- servers connect in the background without delaying the prompt
  • Interactive management -- toggle servers on/off with the /mcp command

Quick Start

Install from Community Registry

The fastest way to get started is installing a pre-configured server from the community registry:

# In the Autohand REPL
/mcp install filesystem

This adds the server to your config and auto-connects it. You can also browse the full registry:

/mcp install

Manual Configuration

Add an MCP server to ~/.autohand/config.json:

{
  "mcp": {
    "servers": [
      {
        "name": "filesystem",
        "transport": "stdio",
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/projects"]
      }
    ]
  }
}

Restart Autohand and the server connects automatically in the background.


Configuration

Config Structure

{
  "mcp": {
    "enabled": true,
    "servers": [
      {
        "name": "filesystem",
        "transport": "stdio",
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
        "env": {},
        "autoConnect": true
      }
    ]
  }
}

Server Config Fields

FieldTypeRequiredDescription
namestringYesUnique server identifier
transport"stdio" | "sse"YesTransport type
commandstringYes (stdio)Command to start the server process
argsstring[]NoArguments for the command
urlstringYes (sse)SSE endpoint URL
envobjectNoEnvironment variables passed to the server
autoConnectbooleanNoAuto-connect on startup (default: true)

Global Settings

FieldTypeDefaultDescription
mcp.enabledbooleantrueEnable/disable all MCP support
mcp.serversarray[]List of server configurations

Slash Commands

/mcp -- Interactive Server Manager

Running /mcp with no arguments opens an interactive toggle list:

MCP Servers
────────────────────────────────────────────────────────
▸ ● filesystem          enabled (5 tools)
  ○ github              disabled
  ● postgres            error
    Connection refused

↑↓ navigate  ⏎/space toggle  q/esc close
  • Arrow keys to navigate between servers
  • Space or Enter to toggle a server on/off (connect/disconnect)
  • q or ESC to close the list
  • Error details shown when an errored server is selected

/mcp Subcommands

CommandDescription
/mcpInteractive server toggle list
/mcp connect <name>Connect to a specific server
/mcp disconnect <name>Disconnect from a server
/mcp listList all tools from connected servers
/mcp toolsAlias for /mcp list
/mcp add <name> <cmd> [args]Add a server to config and connect
/mcp remove <name>Remove a server from config

Examples

# Add a server manually
/mcp add time npx -y @modelcontextprotocol/server-time

# View all available tools
/mcp list

# Disconnect a server
/mcp disconnect time

# Remove a server permanently
/mcp remove time

/mcp install -- Community Registry Browser

Browse and install pre-configured MCP servers from the community registry:

# Browse the full registry with categories
/mcp install

# Install a specific server directly
/mcp install filesystem

The interactive browser shows:

  • Categories: Developer Tools, Data & Databases, Web & APIs, Productivity, AI & Reasoning
  • Featured servers with ratings
  • Search with autocomplete
  • Server details before install (description, required env vars, required arguments)

Available Servers

ServerCategoryDescription
filesystemDeveloper ToolsRead, write, and manage files and directories
githubDeveloper ToolsGitHub repos, issues, and PRs
everythingDeveloper ToolsReference MCP server for testing
timeDeveloper ToolsTime and timezone tools
postgresData & DatabasesPostgreSQL database queries
sqliteData & DatabasesSQLite database operations
brave-searchWeb & APIsBrave web search
fetchWeb & APIsFetch and parse web pages
puppeteerWeb & APIsBrowser automation with Puppeteer
slackProductivitySlack messaging
memoryAI & ReasoningPersistent knowledge graph memory
sequential-thinkingAI & ReasoningStep-by-step reasoning

Environment Variables

Some servers require environment variables. When installing, Autohand prompts for any required values:

/mcp install slack
# Prompts for:
#   SLACK_BOT_TOKEN: xoxb-your-token
#   SLACK_TEAM_ID: T0YOUR_TEAM_ID

Required Arguments

Servers like filesystem require path arguments:

/mcp install filesystem
# Prompts for: allowed directory path

Tool Naming

MCP tools are registered with a namespaced prefix to avoid collisions:

mcp__<server-name>__<tool-name>

For example, the filesystem server's read_file tool becomes mcp__filesystem__read_file.

When the LLM decides to use an MCP tool, Autohand automatically routes the call to the correct server.


Non-Blocking Startup

MCP servers connect asynchronously in the background during startup. This means:

  1. The prompt appears immediately -- no waiting for servers to connect
  2. Servers connect in parallel, each independently
  3. Tools become available as servers finish connecting
  4. If a server fails, others continue normally (errors shown with /mcp)
  5. When the LLM invokes an MCP tool, Autohand waits for connections to complete first

This behavior matches how Claude Code and similar tools handle MCP -- the user is never blocked by slow server startup.


Troubleshooting

Server won't connect

# Check status
/mcp

# Try reconnecting
/mcp disconnect <name>
/mcp connect <name>

Common errors

ErrorCauseFix
Command not foundPackage not installedRun the npx command manually first
Connection refusedServer not running (SSE)Verify the URL and server status
Request timed outServer unresponsiveCheck server logs, restart
SSE transport not yet implementedSSE not supported yetUse stdio transport

Server logs

MCP server stderr output is captured internally. If a server misbehaves, check if the underlying command works outside Autohand:

npx -y @modelcontextprotocol/server-filesystem /tmp

Disabling MCP

Set mcp.enabled to false in your config to disable all MCP support:

{
  "mcp": {
    "enabled": false
  }
}

Or set individual servers to not auto-connect:

{
  "mcp": {
    "servers": [
      {
        "name": "filesystem",
        "transport": "stdio",
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-filesystem"],
        "autoConnect": false
      }
    ]
  }
}