Skip to main content
Glama

misc-mcp-server

A personal, modular MCP server. The first connectors let an LLM agent operate embedded boards on its own (Raspberry Pi, Jetson Nano, Android/adbd boards) over SSH and ADB: run commands, start and watch long-running jobs, read and write files. More connectors (web scraping, ...) can be added as plain Python files.

Setup

python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
cp config.example.yaml config.yaml     # optional, then edit your devices

For ADB tools, install adb (sudo apt install adb or Android platform-tools).

Register with Claude Code

claude mcp add --scope user misc -- /path/to/misc-mcp-server/.venv/bin/misc-mcp \
    --config /path/to/misc-mcp-server/config.yaml

To let the agent run these tools without asking each time, allow them in Claude Code settings ("permissions": {"allow": ["mcp__misc"]}) — or allow only the read-only ones and keep ssh_exec / adb_shell on approval.

Other MCP clients (Claude Desktop, Cursor, ...) use the same command in their JSON config. For a network server: misc-mcp --transport streamable-http --port 8765 (endpoint /mcp).

Related MCP server: adbmcp

Docker

docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t misc-mcp .

Register the container as a stdio MCP server (the client starts it on demand):

claude mcp add --scope user misc -- docker run -i --rm --network host \
    -v ~/.ssh:/home/mcp/.ssh:ro \
    -v misc-mcp-data:/data \
    -v /path/to/misc-mcp-server/config.yaml:/config/config.yaml:ro \
    -v ~/mcp-files:/workspace \
    -e JETSON_PASSWORD \
    misc-mcp

Mount / flag

Why

-i

stdio transport needs stdin open (no -t)

--network host

reach boards on your LAN by their usual addresses, and reuse the host's adb server at localhost:5037 (USB devices + already-authorized keys just work; start it on the host with adb start-server)

~/.ssh:/home/mcp/.ssh:ro

your keys and ~/.ssh/config aliases (build with your UID so keys are readable)

misc-mcp-data:/data

writable known_hosts for newly accepted boards (seeded from your ~/.ssh/known_hosts)

config.yaml:/config/config.yaml

device list (optional)

~/mcp-files:/workspace

local paths used by *_upload, *_download, adb_push/adb_pull refer to the container; this is the shared folder

-e VAR

forward env vars referenced by password_env / sudo_password_env

Without host networking, let the container run its own adb server instead: add --device /dev/bus/usb -v ~/.android:/home/mcp/.android (USB) and use adb_connect for network devices.

HTTP mode (one long-lived server, several clients):

docker run -d --name misc-mcp --network host -v ~/.ssh:/home/mcp/.ssh:ro -v misc-mcp-data:/data \
    misc-mcp --transport streamable-http --host 127.0.0.1 --port 8765
claude mcp add --scope user --transport http misc http://127.0.0.1:8765/mcp

What makes it agent-ready

  • Non-interactive by design: stdin is closed unless given, so prompts can't hang a call; sudo works with a configured password (sudo -S, fed over the channel, never in argv) or sudo -n.

  • Timeouts really stop things: on timeout the remote command's whole process group is killed.

  • Background jobs for anything long (builds, servers, training, flashing, tail -f): *_job_start returns a job_id immediately; *_job_status can wait up to 10 min for completion and returns state, exit code and the output tail. Jobs live on the device, so they survive dropped connections.

  • Robust output: binary/garbled output is decoded leniently and long output is truncated (head + tail).

  • New boards work first time: host keys are accepted on first contact (accept-new), but a changed key is refused.

  • Readable errors: failures (unreachable host, auth, missing file, adb unauthorized...) reach the model as text it can act on.

  • Commands run in the user's login shell (bash on Pi/Jetson), each call in a fresh shell (use cwd).

Tools

SSH (ssh connector)

target = device name from config, a ~/.ssh/config alias, or [user@]host[:port]. Connections are pooled; ~/.ssh/config (HostName, User, Port, IdentityFile, ProxyJump) and your ssh-agent are honoured.

Tool

What it does

ssh_list_targets

configured devices, ~/.ssh/config hosts, open connections

ssh_exec

run a command → exit code / stdout / stderr; timeout, cwd, stdin, sudo

ssh_job_start / ssh_job_status / ssh_job_list / ssh_job_stop

background jobs (with sudo too)

ssh_read_file / ssh_write_file

read (chunked) / write text files over SFTP

ssh_board_info

model, OS, kernel, CPU, RAM, disk, temps, network, Jetson L4T/JetPack, Pi vcgencmd

ssh_upload / ssh_download

SFTP file or directory transfer

ssh_disconnect

close one or all pooled connections

ADB (adb connector)

device = configured name, serial, or omitted when only one device is attached.

Tool

What it does

adb_devices

attached devices (adb devices -l) + configured ones

adb_connect / adb_disconnect

TCP/IP connections

adb_shell

run a command; timeout, cwd, stdin, root (via su)

adb_job_start / adb_job_status / adb_job_list / adb_job_stop

background jobs

adb_read_file / adb_write_file

read / write text files

adb_device_info

Android properties + the same board overview as SSH

adb_push / adb_pull

file transfer

adb_logcat

dump recent logcat lines with optional filter

adb_install

install an APK

adb_reboot

reboot (normal / bootloader / recovery / ...)

Security notes

  • These tools run arbitrary commands on your devices. Only connect the server to clients you trust.

  • Put passwords in env vars (password_env, sudo_password_env) — never as tool arguments.

  • host_key_policy: accept-new trusts a board on first contact (like OpenSSH's StrictHostKeyChecking=accept-new). Use strict on untrusted networks.

Adding a connector

  1. Create src/misc_mcp/connectors/<name>.py with register(mcp, config); decorate tools with @tool(mcp, ...) from misc_mcp.connectors (gives the model readable error messages). Read your settings from config.section("<name>"). Return an async cleanup function or None. Shell-like connectors can reuse connectors/_shell.py (exec with kill-on-timeout + background jobs) by implementing its small Backend protocol.

  2. Add it to AVAILABLE in src/misc_mcp/connectors/__init__.py.

  3. Enable it under connectors: in config.yaml.

Tests

.venv/bin/pytest
# live tests against a real board (exec, timeouts, jobs, files, host keys):
MISC_MCP_TEST_SSH_HOST=pi@192.168.1.50 MISC_MCP_TEST_SSH_KEY=~/.ssh/id_ed25519 .venv/bin/pytest

Available Tools

28 tools
adb_connectA

Connect to a device over TCP/IP (adb connect host[:port], default port 5555). A configured device name is also accepted.

Inputs: address (required). Returns: result

adb_device_infoB
Read-only

Overview of the device: Android build properties (if Android) plus model, kernel, CPU, memory, disk, temperatures and network (works on adbd-enabled Linux boards too).

Inputs: device. Returns: object

adb_devicesA
Read-only

List devices attached to the local adb server (USB and network) and devices named in the config.

Inputs: no named parameters. Returns: object

adb_disconnectA

Disconnect a TCP/IP device, or all TCP/IP devices if address is omitted.

Inputs: address. Returns: result

adb_installC
Destructive

Install an APK on an Android device (adb install [-r]).

Inputs: apk_path (required), device, replace. Returns: object

adb_job_listC
Read-only

List background jobs started on the device.

Inputs: device. Returns: object

adb_job_startA
Destructive

Start a long-running command in the background on the device and return a job_id immediately. Output is logged on the device. Poll with adb_job_status, stop with adb_job_stop.

Inputs: command (required), cwd, root, device.

adb_job_statusA
Read-only

Get a background job's state (running / exited / dead), exit code, elapsed time and last output lines. wait_seconds (max 600) waits for the job to finish before answering.

Inputs: job_id (required), device, tail_lines, wait_seconds.

adb_job_stopA
Destructive

Stop a background job (SIGTERM then SIGKILL, whole process group); remove=true deletes its logs.

Inputs: job_id (required), device, remove. Returns: result

adb_logcatB
Read-only

Dump recent Android logcat lines (non-blocking).

Args: lines: number of most recent lines to return. filter_spec: optional logcat filter, e.g. "ActivityManager:I :S" or ":E". clear: clear the log buffer after reading.

Inputs: clear, lines, device, filter_spec. Returns: object

adb_pullC
Destructive

Copy a file or directory from the device to a local path (adb pull).

Inputs: local_path (required), remote_path (required), device. Returns: object

adb_pushB
Destructive

Copy a local file or directory to the device (adb push).

Inputs: local_path (required), remote_path (required), device. Returns: object

adb_read_fileB
Read-only

Read a text file from the device (first max_bytes bytes).

Inputs: path (required), device, max_bytes. Returns: object

adb_rebootB
Destructive

Reboot the device. mode may be None (normal), "bootloader", "recovery", "sideload" or "fastboot".

Inputs: mode, device. Returns: object

adb_shellA
Destructive

Run a shell command on the device and return exit_code, stdout and stderr.

Non-interactive (no TTY). Each call is a fresh shell, so use cwd instead of relying on a previous cd. On timeout the command and its children are killed. For long-running work (servers, logcat -f, benchmarks) use adb_job_start.

Args: command: shell command line, interpreted by the device's shell. device: configured name or serial; may be omitted when only one device is attached. timeout: seconds before the command is killed (default from config, 60s). cwd: directory to run the command in. stdin: text fed to the command's standard input. root: run through su (rooted devices only).

Inputs: command (required), cwd, root, stdin, +2 more. Returns: object

adb_write_fileB
Destructive

Create/overwrite a text file on the device (pushes a temp file). mode is octal, e.g. "755".

Inputs: path (required), content (required), mode, device. Returns: result

ssh_board_infoB
Read-only

Collect a hardware/OS overview of a Linux board: model, OS, kernel, CPU, memory, disk, temperatures, network, plus Jetson (L4T/JetPack, nvpmodel) and Raspberry Pi (vcgencmd) details.

Inputs: target (required). Returns: object

ssh_disconnectA
Idempotent

Close the pooled SSH connection to target, or all connections if omitted.

Inputs: target. Returns: result

ssh_downloadB
Destructive

Copy a remote file (or directory with recursive=true) from the remote host to a local path via SFTP.

Inputs: target (required), local_path (required), remote_path (required), recursive. Returns: result

ssh_execA
Destructive

Run a shell command on a remote host and return exit_code, stdout and stderr.

The command runs non-interactively in the remote user's shell (no TTY; stdin is closed unless stdin is given), so use non-interactive flags such as apt-get -y. Each call is a fresh shell: use cwd or cd x && ... instead of relying on a previous cd. On timeout the command and its children are killed. For anything slower than a few minutes, or that must keep running (servers, builds, training, tail -f), use ssh_job_start instead.

Args: target: device name, ~/.ssh/config alias, or [user@]host[:port]. command: shell command line (multi-line scripts are fine). timeout: seconds before the command is killed (default from config, 60s). cwd: directory to run the command in. stdin: text fed to the command's standard input (e.g. file content for tee file). sudo: run as root. Uses the device's sudo_password if configured, else sudo -n.

Inputs: target (required), command (required), cwd, sudo, +2 more. Returns: object

ssh_job_listB
Read-only

List background jobs started on the remote host, with their state and command.

Inputs: target (required). Returns: object

ssh_job_startA
Destructive

Start a long-running command in the background on the remote host and return immediately with a job_id. Output goes to a log on the device; the job keeps running even if the MCP server or connection goes away. Use for builds, servers, benchmarks, training, flashing, tail -f, etc. Then poll with ssh_job_status and stop with ssh_job_stop.

Inputs: target (required), command (required), cwd, sudo. Returns: object

ssh_job_statusA
Read-only

Get a background job's state (running / exited / dead), exit code, elapsed time and the last tail_lines lines of its output. wait_seconds (max 600) waits up to that long for the job to finish before answering, which avoids busy polling.

Inputs: job_id (required), target (required), tail_lines, wait_seconds. Returns: object

ssh_job_stopA
Destructive

Stop a background job (SIGTERM, then SIGKILL after 5s, whole process group). With remove=true also delete its log directory (works for finished jobs too).

Inputs: job_id (required), target (required), remove. Returns: result

ssh_list_targetsA
Read-only

List SSH targets: devices from the misc-mcp config, Host aliases from ~/.ssh/config, and currently open connections. Any of these names can be used as target in other ssh_* tools, as can a plain [user@]host[:port] string.

Inputs: no named parameters. Returns: object

ssh_read_fileA
Read-only

Read a text file from the remote host (SFTP). Returns at most max_bytes starting at offset, plus the total size so larger files can be read in chunks.

Inputs: path (required), target (required), offset, max_bytes. Returns: object

ssh_uploadB
Destructive

Copy a local file (or directory with recursive=true) to the remote host via SFTP.

Inputs: target (required), local_path (required), remote_path (required), recursive. Returns: result

ssh_write_fileA
Destructive

Create/overwrite (or append to) a text file on the remote host via SFTP. mode is an octal string like "755". For root-owned paths use ssh_exec(command="tee /path >/dev/null", stdin=content, sudo=true) instead.

Inputs: path (required), target (required), content (required), mode, +2 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 28 tools

    Disambiguation4/5

    The ssh_* and adb_* families form two clearly parallel, non-overlapping domains, and within each domain the tools split cleanly into exec/job/file/device concerns. The only mild overlaps are text-writing tools (ssh_write_file, adb_write_file) versus transfer tools (ssh_upload, adb_push), but descriptions make the text-vs-file distinction explicit. ssh_job_list vs ssh_job_status and their adb twins are also easily told apart.

    Naming Consistency4/5

    Nearly everything follows a predictable `domain_noun_verb` pattern (ssh_job_start, adb_read_file, adb_device_info) in consistent snake_case with a domain prefix. The one deviation is ssh_list_targets, which flips to verb-noun ordering unlike ssh_job_list/adb_job_list, a minor blemish in an otherwise uniform scheme.

    Tool Count3/5

    28 tools is on the heavy side, but it is really two symmetric 14-tool domains (SSH and ADB), each of which covers exec, background jobs, file transfer and diagnostics with no filler. A dual-domain server justifies the size better than most, yet it still sits above the comfortable 15-tool range and could be trimmed by folding job_list into job_status.

    Completeness4/5

    Both domains are close to lifecycle-complete: shell exec, background job start/status/list/stop, file read/write/transfer, device/board info, and connect/disconnect are all present, with ADB adding install, logcat and reboot. Remaining gaps are modest but real — no adb_forward/reverse port forwarding, no uninstall, and no explicit file-delete (workable via shell exec).

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables AI agents to control Android TV/Android devices through ADB, including screen capture, remote control, app management, and more.
      24
      25 npm
      8
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to control Android devices through the Android Debug Bridge, covering device listing, shell commands, app install/uninstall, logcat reading, screenshots, UI automation (tap/swipe/type/key events), dumpsys queries, file transfer, port forwarding, permission management, and Wi-Fi pairing. Failures are mapped to typed, actionable causes and tool calls are safety-annotated and guardrailed, with multi-device calls scoped explicitly by serial.
      35
      47 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to see and control Android devices through ADB and screen mirroring, supporting screen capture, touch input, app management, UI element finding, file transfer, shell commands, clipboard access, and audio/video streaming.
      566 npm
      MIT