Skip to main content
Glama
SWITCHSCIENCE

mcp-micropython-bridge

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
micropython_list_portsB

接続可能なシリアルポートを一覧表示

micropython_connectB

指定ターゲットへ接続

Args: target: COM3 なら serial、host[:port] なら WebREPL password: WebREPL 接続時のパスワード baudrate: serial 接続時のボーレート

micropython_disconnectA

現在の MicroPython ボード接続を切断 未接続時も成功を返す

Returns: ok: 成功 True error: エラー時のメッセージ

micropython_connection_statusA

現在の接続状態を返す

Returns: ok: 成功 True connected: 接続中なら True transport: serial または webrepl target: 接続時に指定したターゲット host: WebREPL 接続時のホスト port: 接続先ポート baudrate: serial 接続時のボーレート error: エラー時のメッセージ

micropython_get_infoB

MicroPython ボードのデバイス情報を取得

Returns: ok: 成功 True info: 取得したデバイス情報 error: エラー時のメッセージ

Notes: info には必要に応じて次を含む。 platform, version, implementation, free_mem, alloc_mem, freq_mhz, fs_total_kb, fs_free_kb

micropython_resetA

MicroPython ボードをソフトリセット (machine.reset() に相当) リセット後は再接続が必要

micropython_interruptB

Ctrl-C を送って実行中の処理を中断

micropython_read_streamA

接続中のデバイスから一定時間ストリーム出力を読み取る

Args: duration: 読み取りを続ける最大秒数 idle_timeout: この秒数だけ無通信なら早期終了 max_bytes: 読み取る最大バイト数。超えると truncated=True

Returns: ok: 成功 True stdout: 読み取ったテキスト truncated: max_bytes で打ち切られたら True bytes_read: 実際に読んだバイト数 error: エラー時のメッセージ

micropython_read_untilB

接続中のデバイス出力を、指定文字列が現れるまで読み取る

Args: pattern: 検出したい文字列。正規表現ではなく部分文字列 timeout: 待機する最大秒数 max_bytes: 読み取る最大バイト数

Returns: ok: 成功 True matched: pattern を検出したら True stdout: 読み取ったテキスト bytes_read: 実際に読んだバイト数 error: エラー時のメッセージ

micropython_reset_and_captureA

デバイスをリセットし、起動直後の出力を一定時間読み取る

Args: capture_duration: リセット後の読み取り最大秒数 idle_timeout: この秒数だけ無通信なら早期終了 max_bytes: 読み取る最大バイト数。超えると truncated=True

Returns: ok: リセットと読み取り呼び出しに成功したら True stdout: 起動後に取得したテキスト reset_ok: リセット操作自体が成功したら True truncated: max_bytes で打ち切られたら True error: エラー時のメッセージ

micropython_execB

MicroPython インタープリタで Python コードを実行する。 複数行のコードも実行できる。

Args: code: 実行する Python コード (複数行可) timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数 (デフォルト 10秒)

Returns: ok: 実行に成功したら True stdout: 標準出力 stderr: 標準エラー出力 error: エラー時のメッセージ。成功時は None

Example: code = "import machine\nprint(machine.freq())"

micropython_evalB

MicroPython ボードで式を評価し、結果を文字列で返す。

Args: expression: 評価する Python 式 (例: "1 + 1", "machine.freq()")

Returns: ok: 評価に成功したら True result: 評価結果の文字列表現 error: エラー時のメッセージ。成功時は None

micropython_list_filesB

MicroPython ボードのファイルシステム上のファイル/ディレクトリを一覧表示

Args: path: 一覧表示するディレクトリのパス (デフォルト: "/")

micropython_stat_pathC

MicroPython ボード上のパス情報を取得

Args: path: 対象パス

Returns: ok: 取得に成功したら True path: 対象パス kind: file, dir, unknown のいずれか size_bytes: ファイルサイズ mode: os.stat() の mode 値 mtime: 更新時刻 error: エラー時のメッセージ

micropython_read_fileB

MicroPython ボードのファイルを読み出して返す

Args: path: 読み出すファイルのパス (例: "/main.py") timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数 encoding: テキストデコードに使うエンコーディング errors: テキストデコード時のエラー処理 as_base64: True のときは content を空にし、content_base64 に base64 を返す

Returns: ok: 読み出しに成功したら True path: 読み出したファイルパス content: テキスト内容。as_base64=True のときは空文字列 content_base64: base64 内容。as_base64=False のときは None size_bytes: 読み出したバイト数 error: エラー時のメッセージ

micropython_read_hardware_mdB

デバイス上の /HARDWARE.md を読み出して返す

Args: timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数

micropython_upload_fileB

ローカルファイルを MicroPython ボードへ転送

Args: local_path: ホスト側ファイルパス。ワークスペース内のみ指定可能 remote_path: デバイス側ファイルパス timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数 overwrite: False のとき既存ファイルを上書きしない

Returns: ok: 転送に成功したら True local_path: 読み込んだローカルパス remote_path: 書き込んだデバイス側パス bytes_written: 書き込んだバイト数 sha256: 転送内容の sha256。失敗時は None error: エラー時のメッセージ

micropython_download_fileA

MicroPython ボード上のファイルをローカルへ保存する。

Args: remote_path: デバイス側ファイルパス local_path: ホスト側保存先パス。ワークスペース内のみ指定可能 timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数 overwrite: False のとき既存ファイルを上書きしない

Returns: ok: 保存に成功したら True remote_path: 読み出したデバイス側パス local_path: 保存したローカルパス bytes_written: 保存したバイト数 sha256: 保存内容の sha256。失敗時は None error: エラー時のメッセージ

micropython_hash_fileA

MicroPython ボード上のファイルのハッシュを返す。

Args: path: 対象ファイルパス algorithm: ハッシュアルゴリズム。現状は sha256 のみ timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数

micropython_compare_local_remoteA

ローカルファイルとデバイス上のファイルが一致するか確認する。

Args: local_path: ホスト側ファイルパス。ワークスペース内のみ指定可能 remote_path: デバイス側ファイルパス timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数

Returns: ok: 比較処理に成功したら True local_path: 比較したローカルパス remote_path: 比較したデバイス側パス local_sha256: ローカルファイルの sha256 remote_sha256: デバイス側ファイルの sha256 same: 両者が一致したら True error: エラー時のメッセージ

Notes: 比較は sha256 ハッシュで行う。

micropython_read_linesB

MicroPython ボード上のテキストファイルを行単位で一部読み出す。

Args: path: 対象ファイルパス start_line: 1 始まりの開始行番号 max_lines: 返却する最大行数 timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数 encoding: テキストデコードに使うエンコーディング errors: テキストデコード時のエラー処理

Returns: ok: 読み出しに成功したら True path: 対象ファイルパス start_line: 実際に使った開始行番号 line_count: 返した行数 content: 返したテキスト eof: 返却範囲がファイル末尾に達したら True error: エラー時のメッセージ

micropython_head_linesB

MicroPython ボード上のテキストファイル先頭の数行を返す。

Args: path: 対象ファイルパス lines: 返却する最大行数 timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数 encoding: テキストデコードに使うエンコーディング errors: テキストデコード時のエラー処理

Returns: ok: 読み出しに成功したら True path: 対象ファイルパス content: 返したテキスト line_count: 返した行数 truncated: 返せなかった残り行があるとき True error: エラー時のメッセージ

micropython_tail_linesB

MicroPython ボード上のテキストファイル末尾の数行を返す。

Args: path: 対象ファイルパス lines: 返却する最大行数 timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数 encoding: テキストデコードに使うエンコーディング errors: テキストデコード時のエラー処理

Returns: ok: 読み出しに成功したら True path: 対象ファイルパス content: 返したテキスト line_count: 返した行数 truncated: 返せなかった先頭側の行があるとき True error: エラー時のメッセージ

micropython_write_fileA

MicroPython ボードのファイルに内容を書き込む(上書き)。

Args: path: 書き込み先ファイルのパス (例: "/main.py") content: 書き込むテキスト内容。content_base64 とは排他的 timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数 encoding: content をバイト列に変換するエンコーディング content_base64: base64 で表した書き込みデータ。content とは排他的

Returns: ok: 書き込みに成功したら True path: 書き込み先パス bytes_written: 書き込んだバイト数 error: エラー時のメッセージ

Notes: contentcontent_base64 はどちらか片方のみ指定する。

micropython_append_fileB

MicroPython ボードのファイルに内容を追記する。

Args: path: 追記先ファイルのパス (例: "/main.py") content: 追記するテキスト内容。content_base64 とは排他的 timeout: コード送信から Raw REPL 復帰完了までの全体タイムアウト秒数 encoding: content をバイト列に変換するエンコーディング content_base64: base64 で表した追記データ。content とは排他的

Returns: ok: 追記に成功したら True path: 追記先パス bytes_written: 今回追記したバイト数 error: エラー時のメッセージ

Notes: contentcontent_base64 はどちらか片方のみ指定する。

micropython_delete_fileB

MicroPython ボード上のファイルを削除する。

Args: path: 削除するファイルのパス (例: "/test.py")

micropython_make_dirA

MicroPython ボード上にディレクトリを作成する。

Args: path: 作成するディレクトリパス parents: True のときは親ディレクトリも順に作成 exist_ok: True のときは既存ディレクトリを許容

micropython_remove_dirC

MicroPython ボード上の空ディレクトリを削除する。

Args: path: 削除するディレクトリのパス

micropython_rename_pathB

MicroPython ボード上のパスを rename/move する。

Args: src: 移動元パス dst: 移動先パス

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
micropython_guide_recipesCommon task recipes that prefer HARDWARE.md and board-specific helper APIs.
micropython_policy_hardware_docsCompletion policy for when HARDWARE.md should be updated after board-specific changes.
micropython_guide_troubleshootingTroubleshooting guide for common MCP and device issues.
micropython_guide_limitationsKnown limitations and constraints of this MCP server and its device access model.

TDQS

B3.4/5.0

Scored across 29 tools

Disambiguation4/5

Most tools target a distinct resource and action, with clear separation between file reads, uploads, downloads, stream reads, and directory operations. A few pairs such as eval vs exec and read_file vs download_file require reading descriptions, but boundaries are still understandable.

Naming Consistency5/5

All tools use the same micropython_ prefix and snake_case verb_noun style, making the set predictable and easy to scan.

Tool Count3/5

29 tools is heavy for this server, and several convenience operations around file reading and streaming could likely be consolidated. The breadth is justifiable for a MicroPython bridge, but the count sits at the borderline of being excessive.

Completeness4/5

The surface covers connection lifecycle, execution, reset/interrupt, file CRUD, directory operations, transfers, hashing/comparison, and stream reading. Minor gaps such as recursive directory deletion or on-device copy remain, but core workflows are well covered.

Maintenance

ActivityInactive
ResponsivenessNo issues