agentleFS
AdancurusulAdancurusul/serial-mcp-server/CLAUDE.md

serial-mcp-server

CLAUDE.md94 starsChanged 5 months agoMITView on GitHub

This repository provides a Rust MCP stdio server and one-shot CLI for serial port communication. MCP server mode: No-subcommand startup remains compatible with old MCP stdio configurations, but new docs and client configs should use serve. Config commands: The CLI is the preferred automation surface for scripts, CI, and skills: stdout is data only. Diagnostics and logs go to stderr or a configured log file. serial-mcp-server is a Rust MCP stdio server and one-shot CLI for serial port communication. Connection…

  • In this repositoryOne other file it gives its agents.

The file

We split this CLAUDE.md into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer small, reviewable changes with matching tests and documentation.

    line 8
  2. Distinctive:

    Do not claim hardware validation unless a command was run against a real connected device and produced evidence.

    line 10
  3. Very specific:

    Keep generated build output such as target/ out of commits.

    line 11

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This repository provides a Rust MCP stdio server and one-shot CLI for serial port communication.

Development Rules

  • Keep main releasable.
  • Prefer small, reviewable changes with matching tests and documentation.
  • Preserve CLI stdout for command data and JSON output. Send diagnostics to stderr.
  • Do not claim hardware validation unless a command was run against a real connected device and produced evidence.
  • Keep generated build output such as target/ out of commits.

Quality Gates

cargo fmt --all -- --check
cargo clippy --locked --all-targets --all-features -- -D warnings
cargo test --locked --all-targets --all-features
cargo doc --locked --all-features --no-deps

Build And Run

cargo build --release
cargo run --locked -- --help
cargo run --locked -- serve --help
cargo run --locked -- list-ports --json

MCP server mode:

cargo run --locked -- serve

No-subcommand startup remains compatible with old MCP stdio configurations, but new docs and client configs should use serve.

Config commands:

cargo run --locked -- generate-config
cargo run --locked -- validate-config --config path/to/config.toml
cargo run --locked -- show-config --config path/to/config.toml

CLI Surface

The CLI is the preferred automation surface for scripts, CI, and skills:

serial-mcp-server list-ports --json
serial-mcp-server probe --port <port> --baud 115200 --json
serial-mcp-server write --port <port> --baud 115200 --data H --read --timeout-ms 1000 --json
serial-mcp-server read --port <port> --baud 115200 --timeout-ms 1000 --json
serial-mcp-server set-control-lines --port <port> --rts high --dtr low --json

stdout is data only. Diagnostics and logs go to stderr or a configured log file.

Architecture

serial-mcp-server is a Rust MCP stdio server and one-shot CLI for serial port communication.

  • src/main.rs: argument parsing, logging setup, command dispatch, MCP server startup.
  • src/config.rs: clap arguments, subcommands, TOML config, validation.
  • src/cli.rs: one-shot CLI command execution.
  • src/tools/serial_handler.rs: MCP tool handler and six MCP tools.
  • src/serial/**: serial connection wrapper, connection manager, port listing.
  • src/session/**: session abstractions used by supporting APIs and tests.
  • skills/serial-debug/**: Codex and Claude Code compatible skill, CLI-first with MCP optional.

MCP Tool Model

MCP tools:

  • list_ports
  • open
  • write
  • read
  • close
  • set_control_lines

Connection IDs are returned by open and are required for write, read, close, and set_control_lines.

Hardware Notes

RTS and DTR can be wired to reset or boot circuitry on development boards. Do not claim hardware validation unless a real command was run against a connected device and produced evidence.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.