Skip to main content

Local, read-only MCP tools for CAN databases and capture logs

Project description

canforge-mcp

PyPI CI Python versions License: MIT

canforge-mcp is a local, read-only MCP server for inspecting DBC files and decoding CAN capture logs.

Files stay on the machine running the server. The server exposes bounded tools instead of uploading captures or returning unbounded traces.

Tools

Tool Purpose
dbc_info DBC version, message/signal/node counts, and node names
list_messages Bounded message summaries, with optional search
get_message Full message and signal detail by name or arbitration ID
search_signals Bounded signal search across a DBC
decode_frame Decode one hexadecimal CAN payload
validate_dbc Structured DBC validation issues
diff_dbcs Added, removed, and changed messages and signals
probe_log Detect a log format and read header metadata
log_stats Frame count, span, ID counts, and median cycle times
read_frames Bounded raw-frame samples with ID and time filters
decode_log Bounded decoded frames from a DBC and log
signal_timeseries Downsampled timestamp/value points for one signal

See the tool reference for arguments, return shapes, and hard caps.

Install

Run directly with uvx:

uvx canforge-mcp

Or install with pip:

pip install canforge-mcp
canforge-mcp

Requires Python >=3.11.

Configure

Claude Code:

claude mcp add canforge -- uvx canforge-mcp

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "canforge": {
      "command": "uvx",
      "args": ["canforge-mcp"]
    }
  }
}

Restart the client after changing its MCP configuration.

Design

  • Local-first: tools accept filesystem paths and do not send file content over the network.
  • Read-only: no tool creates, edits, encodes, or overwrites a file.
  • Bounded: list and frame tools enforce hard caps and report total, returned, and truncated; timeseries are downsampled server-side.
  • Cached: parsed DBCs are cached by resolved path and nanosecond modification time for repeated inspection during one server session.
  • Composable: capkit reads capture formats; dbckit parses and decodes DBC content.
  • Stdio-only: version 0.1 exposes no network transport or hosted service.

Scope and Caveats

  • Supported capture formats come from capkit 0.2: Kvaser CanKing TXT, candump text, and Vector ASC.
  • DBC support and validation behavior follow dbckit 1.x.
  • Timestamps are floats exactly as recorded by capkit; they are not rebased.
  • Median cycle time is the median gap between consecutive occurrences of an ID.
  • signal_timeseries uses deterministic, evenly spaced index sampling when a series exceeds max_points; it is intended for inspection, not resampling or signal processing.
  • Paths are resolved by the machine running the MCP server. A remote client's filesystem is not visible to a server running elsewhere.

Development

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
ruff check .
mypy canforge_mcp
pytest --cov=canforge_mcp --cov-fail-under=90
python -m build

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

canforge_mcp-0.1.0.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

canforge_mcp-0.1.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file canforge_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: canforge_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for canforge_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e18ec4b922ee86280cba49b36d8cb7d2c9ed085249ec8cf44996ac91f0b04524
MD5 61665ba282607a7deb8fc9fbd13c85bb
BLAKE2b-256 de6782c5641d43bbbf47863476dab855d58c3b133490e34603484c6e38389cac

See more details on using hashes here.

Provenance

The following attestation bundles were made for canforge_mcp-0.1.0.tar.gz:

Publisher: release.yml on canforge/canforge-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file canforge_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: canforge_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for canforge_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a394d2d2e9e958f5407d971a4b3167fcb386bce95dcfafb9abfc9b866233e13a
MD5 974521f7fb7714e7e22cbd6b797e01f4
BLAKE2b-256 558a82a06c813720dfde10935cfb65c952bc2fdbf41ee93491e822ac4d8b55cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for canforge_mcp-0.1.0-py3-none-any.whl:

Publisher: release.yml on canforge/canforge-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page