Skip to main content

agent-can

Agent-first CAN bus session frontend for MCP clients. Runtime access goes through python-can; DBC decode/encode goes through cantools.

The server runs over stdio MCP and exposes tools for adapter discovery, connect/disconnect, status, DBC schema discovery, message list/read/send/stop, periodic sends, and python-can trace export.

MCP configuration

Use uvx agent-can as a stdio MCP server:

{
  "mcpServers": {
    "agent-can": {
      "command": "uvx",
      "args": ["agent-can"]
    }
  }
}

For development from this repository:

uv run agent-can

Hardware mode

Real hardware uses the installed python-can backend and host drivers. PEAK PCAN on Windows and SocketCAN on Linux are the intended hardware paths:

{ "interface": "pcan", "channel": "PCAN_USBBUS1", "bitrate": 500000 }

Message operations

Raw sends use target: "0x123" and a hex string payload. Standard 11-bit classic CAN is the default.

{ "target": "0x123", "data": "01020304" }

Use extended: true for extended 29-bit IDs and fd: true for CAN FD payloads.

{ "target": "0x18DAF110", "data": "0102030405060708090A0B0C", "extended": true, "fd": true }

Semantic sends use target: "alias.MessageName" and a signal map:

{
  "target": "vehicle.PowertrainStatus",
  "data": {
    "vehicle_speed": 12.3,
    "engine_rpm": 1200,
    "throttle": 20,
    "coolant_temp": 82
  }
}

Send and read targets accept raw arbitration IDs such as 0x123 or exact semantic names such as alias.MessageName. Schema and message-list filters also accept partial or glob-style semantic names. DBC paths and trace paths must be absolute.

Periodic sends require periodicity_ms of at least 1.

Trace export

Trace export uses python-can logger suffix dispatch. The trace path must be absolute and the parent directory must exist. Use .asc for ASCII logs; other python-can-supported suffixes select their corresponding writer.

Development

uv run ruff check .
uv run pytest
uv build --no-sources

Release files for agent-can 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-can 0.1.1
File Size Uploaded
agent_can-0.1.1.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-can 0.1.1
File Interpreter ABI Platform
agent_can-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / agent_can-0.1.1.tar.gz

Download URL agent_can-0.1.1.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4f20d82dddb8b0f4d85d3ffcf5c8d093df793beba029f5b9bb70bb1af525035d
BLAKE2b-256 checksum
How to use checksums
71e5459eb37926b83d97cbfbc1ea9025e0577e573d08fe5783e3c26e79c4652e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / agent_can-0.1.1-py3-none-any.whl

Download URL agent_can-0.1.1-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
842d3c65b6d258997f540f0b93b3ce891ace051437ad50371cd62fbcd0e04137
BLAKE2b-256 checksum
How to use checksums
d29e50a1bb1702c35e970b0d0d925ea5dc72bf57d26d02e0c9e5d61df1c5d448
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release 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