mobaxterm-mcp

mobaxterm-mcp

An MCP server that enables AI agents to interact with MobaXterm for managing SSH sessions, executing remote commands, transferring files via SFTP, and monitoring terminal activity.

Category
Visit Server

README

MobaXterm MCP Server

中文文档 | English

An MCP (Model Context Protocol) Server that enables AI agents to interact with MobaXterm — manage SSH sessions, execute remote commands, transfer files via SFTP, and monitor terminal activity.

Features

Session Management

  • list_sessions — List all saved sessions from MobaXterm.ini (supports bookmarks, folders, and multiple bookmark sections)
  • get_session_detail — Get detailed configuration of a specific session (host, port, protocol, username, etc.)

SSH Connection & Command Execution

  • ssh_connect — Establish SSH connections (password or key-based auth), with optional connection reuse from saved sessions
  • ssh_exec — Execute commands on connected servers with stdout/stderr/exit code output
  • ssh_disconnect — Gracefully disconnect SSH sessions
  • ssh_list_connections — List all active SSH connections

SFTP File Transfer

  • sftp_list — List remote directory contents with file metadata (size, permissions, owner, modified time)
  • sftp_upload — Upload local files to remote servers
  • sftp_download — Download remote files to local machine
  • sftp_mkdir — Create remote directories (recursive)
  • sftp_delete — Delete remote files or directories
  • sftp_stat — Get detailed file information (size, permissions, timestamps)

Terminal Log Monitoring

  • monitor_start — Start real-time monitoring of a MobaXterm session's terminal output
  • monitor_stop — Stop monitoring
  • monitor_get_recent — Retrieve recent terminal activity (with configurable time window)
  • monitor_list_logs — List all available MobaXterm log files
  • monitor_search — Search keywords in session logs

Quick Start

Prerequisites

  • Node.js v18 or higher
  • MobaXterm (Portable or Installer edition)

Installation

git clone https://github.com/bobzzgm/mobaxterm-mcp.git
cd mobaxterm-mcp
npm install
npm run build

Configuration

The MCP server requires the path to your MobaXterm.ini file:

  • Portable edition: MobaXterm.ini is in the same directory as MobaXterm.exe
  • Installer edition: Usually at C:\Users\<User>\AppData\Roaming\MobaXterm\MobaXterm.ini

Usage with AI Tools

Qoder

Add to your workspace .mcp.json:

{
  "mcpServers": {
    "mobaxterm": {
      "command": "node",
      "args": [
        "/path/to/mobaxterm-mcp/dist/index.js",
        "--iniPath",
        "/path/to/MobaXterm.ini"
      ]
    }
  }
}

Claude Desktop

Edit %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "mobaxterm": {
      "command": "node",
      "args": [
        "/path/to/mobaxterm-mcp/dist/index.js",
        "--iniPath",
        "/path/to/MobaXterm.ini"
      ]
    }
  }
}

Cursor

Create .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "mobaxterm": {
      "command": "node",
      "args": [
        "/path/to/mobaxterm-mcp/dist/index.js",
        "--iniPath",
        "/path/to/MobaXterm.ini"
      ]
    }
  }
}

Windsurf

Edit ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "mobaxterm": {
      "command": "node",
      "args": [
        "/path/to/mobaxterm-mcp/dist/index.js",
        "--iniPath",
        "/path/to/MobaXterm.ini"
      ]
    }
  }
}

Command Line Options

Option Description Default
--iniPath <path> Path to MobaXterm.ini Required
--logDir <path> Path to MobaXterm log directory Auto-detected from iniPath
--timeout <ms> SSH connection timeout in milliseconds 60000

Architecture

mobaxterm-mcp/
├── src/
│   ├── index.ts              # Entry point - MCP Server setup
│   ├── types/
│   │   └── index.ts          # TypeScript type definitions
│   ├── services/
│   │   ├── ini-parser.ts     # MobaXterm INI parser (GBK/UTF-8)
│   │   ├── ssh-manager.ts    # SSH connection pool (ssh2)
│   │   ├── sftp-manager.ts   # SFTP operations (ssh2-sftp-client)
│   │   └── log-watcher.ts    # Real-time log monitoring (chokidar)
│   └── tools/
│       ├── session-tools.ts  # Session management tools
│       ├── ssh-tools.ts      # SSH tools
│       ├── sftp-tools.ts     # SFTP tools
│       └── monitor-tools.ts  # Monitoring tools
├── package.json
├── tsconfig.json
└── README.md

Key Technical Details

  • INI Parser: Custom parser that handles MobaXterm's special INI format (values prefixed with #CODE# protocol identifiers, %-delimited fields). Supports GBK (cp936) encoding for Chinese folder/bookmark names via iconv-lite.
  • Protocol Detection: Parses MobaXterm protocol codes (SSH=109, Telnet=98, WSL=105, Serial=131, RDP=1, VNC=2).
  • Multi-Bookmark Sections: Supports [Bookmarks], [Bookmarks_1], [Bookmarks_2], etc.
  • Log File Matching: Auto-discovers MobaXterm log files by session name from the configured log directory.

Development

# Build
npm run build

# Watch mode for development
npm run dev

# Inspect with MCP Inspector
npm run inspect

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured