Skip to main content

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
log_signal_inventory One-pass inventory of DBC signals observed in a log
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 Claude after changing its MCP configuration.

ChatGPT (Secure MCP Tunnel)

ChatGPT cannot start a local stdio MCP server directly. Use OpenAI's Secure MCP Tunnel to keep Canforge running locally without exposing it to the public internet.

Before starting, enable developer mode in ChatGPT under Settings → Security and login, then create a tunnel in the OpenAI Platform. You need its tunnel ID, a runtime API key, and the tunnel-client binary. Make sure the tunnel is associated with the ChatGPT workspace where you will use Canforge.

Configure and start the tunnel with placeholder credentials:

export CONTROL_PLANE_API_KEY="sk-..."

tunnel-client init \
  --sample sample_mcp_stdio_local \
  --profile canforge \
  --tunnel-id tunnel_your_id \
  --mcp-command "uvx canforge-mcp"

tunnel-client doctor --profile canforge --explain
tunnel-client run --profile canforge

Keep tunnel-client run running while using Canforge. In ChatGPT, open Settings → Plugins, add a developer-mode app, choose Tunnel as the connection, and select or paste the tunnel ID. Add the new app to a chat before asking ChatGPT to use the Canforge tools.

Canforge resolves paths on the machine running tunnel-client. Files attached directly to a ChatGPT conversation are not automatically available as local filesystem paths; provide an accessible local path instead.

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: the 0.x line exposes no network transport or hosted service.

Scope and Caveats

  • Supported capture formats come from capkit 0.3: 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.
  • capkit adds raw priority, PGN, and source-address fields for observed extended IDs; dbckit remains responsible for DBC-aware J1939 matching and decoding.
  • signal_timeseries uses deterministic, evenly spaced index sampling when a series exceeds max_points; it is intended for inspection, not resampling or signal processing.
  • log_signal_inventory always loads the DBC leniently and reports parse diagnostics and per-message decode safety. It scans the log body once; include_values=true adds bounded distinct decoded values to the inventory.
  • 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

Large-log performance checks are opt-in and generate their own deterministic captures. See benchmarks/README.md for the smoke command, the full 100k/1M matrix, measurement policy, and committed v0.2.0 baseline.

License

MIT

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.2.0.tar.gz (59.2 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.2.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for canforge_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7ab251a843eadc63cc5bda433151aa6c42b5af74ef9f476a4b8217d8dfc87389
MD5 c55da79468dedb956be529add5431c96
BLAKE2b-256 030b16a6893846be0c76036889756922e13dd94046b4ecbbe3174606b65a2a29

See more details on using hashes here.

Provenance

The following attestation bundles were made for canforge_mcp-0.2.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.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for canforge_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e448eebb9e3a61f2d371ff81cf8f52a80727fccbf60ac09510fc80768e0f70aa
MD5 1731c17d21215c15bb13a327a555cb08
BLAKE2b-256 6d18d815344e3b78c1453c760a26bd54f329b55a4590565a242825ab3a565790

See more details on using hashes here.

Provenance

The following attestation bundles were made for canforge_mcp-0.2.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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page