agent-tune
OfficialReads datalogs and edits ECU tune files (.kcl) from Honda cars equipped with KTuner, letting an assistant check full-throttle runs for knock, AFR, ignition timing and fuel trims, propose specific table/cell changes, and write them into a new tune file for the user to review and flash.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-tuneanalyze my latest KTuner datalog for knock and suggest safe fuel edits"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agent-tune
Tune your car with KTuner and an AI assistant.
A VEHRA project.
KTuner lets you change almost anything in your car's ECU. Knowing what to change is the hard part, and usually that means paying a tuner.
agent-tune does the tuner's homework. Record a few full-throttle runs with KTuner and give the log to your AI assistant. It checks for knock, compares the fuel and ignition timing your engine actually got with what makes power, and comes back with specific edits: which table, which cells, from what value to what. Say yes, and agent-tune writes them into a new tune file. You open it in KTuner, look it over, and flash it. Then you drive the same runs again and see what changed.
It never flashes the car and never touches your original tune file.

agent-tune works with KTuner hardware and the KTuner app. It is not affiliated with or endorsed by KTuner.
What you need
A Honda with a KTuner, and the KTuner app on a Windows laptop.
An AI assistant that can use skills or MCP, such as Claude Code or Codex. Optional: every step also works as a command.
Related MCP server: Race MCP Server
Get started
Install it with uv (needs Python 3.11 or newer):
uv tool install "vehra-agent-tune[mcp]"The package is called vehra-agent-tune on PyPI; the command it installs is agent-tune.
Leave out [mcp] if you won't connect an AI assistant. To install the latest development
version instead:
uv tool install "vehra-agent-tune[mcp] @ git+https://github.com/VehraLabs/agent-tune"With an AI assistant
Connect it once:
Assistant | How to connect |
Assistants that use skills (Claude Code, Codex, ...) | Copy |
Assistants that use MCP |
|
Anything that can run commands | Call |
Then ask it something like "I have a KTuner on my Honda and I want more power. What should I do first?" It will tell you how to drive for a log, check what you bring back, and propose edits for you to approve.
On your own
agent-tune guide power # how to drive and record for power
agent-tune check-log drive.csv --goal power # does the log have what's needed?
agent-tune analyze drive.csv --findings # knock, fuel, timing, room to improve
agent-tune tune check stock.kcl # can this tune file be edited?
agent-tune tune set stock.kcl --add "wot-h-6000-600=0.3" -o step-1.kcl --dry-run # preview an editWithout --dry-run it writes step-1.kcl and step-1.manifest.json, which lists every value
it changed. After flashing and driving the same runs again, agent-tune compare before.csv after.csv shows the difference.
A few terms
Datalog: a recording of your engine's sensors while you drive. KTuner records it; export it to CSV for agent-tune.
Full-throttle run (or pull): accelerating with the pedal all the way down through the rev range. This is where power is made, so it's what power tuning looks at.
AFR (air-fuel ratio): how much air there is for each part of fuel. Lower is richer (more fuel). Naturally aspirated engines usually make the most power around 12.5 to 13.2 at full throttle.
Knock: uncontrolled combustion that can damage an engine. Any change that causes knock gets undone.
Ignition timing: when the spark fires. A little more can add power, but too much causes knock.
Tune file (
.kcl): the file KTuner flashes to your car. Flashing means writing it to the car's computer.
What's supported
What | Status |
Reading KTuner datalogs (CSV export): full-throttle runs, knock, AFR, timing, fuel trims, before/after | Every Honda KTuner supports |
Editing tune files: 1,502 values, including ignition timing, full-throttle fuel (WOT enrichment), intake cam (VTC), VTEC, rev limits, fuel cut, airflow (AFM) curve and cylinder trims | Verified so far on the 64S ECU (Civic 2.0 L, 37805-64S-AC20, KTuner 1.0.14.1 saves). Other ECUs: check your file |
Logging live data without the KTuner app | Verified so far on the 64S ECU. Other ECUs: try it |
When agent-tune records live data itself, it reads RPM, measured and commanded lambda (AFR), MAF (g/s and Hz), MAP, throttle position and commanded throttle, ignition timing, short and long-term fuel trims, coolant and intake temperature, speed, gear, intake and exhaust cam angles (actual and commanded), FP1, battery voltage, knock control and fuel status. These match what KTuner displays. Knock count and VTEC state are not available that way yet, so record with the KTuner app when you need them. Any timing change needs the knock count.
Adding your car
Each new ECU is added once someone confirms it works. Here is how to check yours.
Datalogs. Anything that reads a KTuner CSV export already works on any car. For recording with agent-tune itself,
agent-tune logkeeps every reply the dongle sends, including ones it doesn't recognize yet, so they can be matched against a KTuner datalog later. You can also give it your own channel layout with--platform my-car.json, starting from the bundled file.Tune files.
agent-tune tune check your.kclsays whether your file is from a verified family. If not, it checks whether the known layout looks right for it (timing in a sensible range, the airflow curve increasing, rev limits in order, and so on). If it does,--unverifiedlets you read it and write a test file. Change one value, open the new file in KTuner, and confirm that exactly that value changed. Files written this way carry a warning. Don't flash anything until KTuner shows exactly what you expect.
If it works on your car, open an issue or a pull request with the fingerprint from
tune check and your car details so it can be added. CONTRIBUTING.md has
the steps. Please never share tune files, VINs or serial numbers.
Commands
Command | What it does |
| Step-by-step instructions for recording a useful datalog: what to press, how to drive, how to export |
| Checks whether a datalog is good enough for the goal, and says what to redo if not |
| Reads a datalog the way a tuner would: runs, knock, AFR, timing, fuel trims, heat |
| Before and after a change, by RPM: acceleration, AFR, timing, knock |
| Finds a connected KTuner dongle |
| Records live data with agent-tune (KTuner app closed) |
| Can agent-tune edit this tune file? Plausibility report if it isn't verified |
| Shows the current values in a tune file |
| Writes a new tune file with the changes, plus a list of every value changed |
| Airflow (AFM) curve suggestions; needs two or more drives that agree |
| Cars agent-tune can record live data from, and the values it reads |
| Runs the MCP server for AI assistants |
Value ids look like ign-max-h-6000-100 (table, cam, RPM, column) and accept wildcards such as
wot-h-6000-*. Add --unverified to tune commands for a file outside the verified families.
tune set never overwrites the file you start from.
Safety
Tuning for power can damage an engine. Ignition timing is where engines get hurt.
Keep your original tune and a stock backup. Flash only with a healthy battery or a charger connected, and never interrupt a flash.
Change timing in small steps (1 degree or less), only where your logs show no knock, and never where the full-throttle AFR is lean.
Judge every change with the same full-throttle runs in the same gear, at a similar temperature, and only where it is legal and safe.
You are responsible for what you flash and for following the emissions and road laws where you drive.
For developers
uv sync --extra mcp
uv run pytestCONTRIBUTING.md explains how to add a car or a tune-file family. SECURITY.md states exactly what the tool does and doesn't send to the car. AGENTS.md is the guide for AI agents changing this code.
License
MIT. See LICENSE. The VEHRA name and logo are trademarks of Vehra and are not covered by the license; see docs/brand.
This server cannot be deployed
Maintenance
Related MCP Connectors
Gives your AI assistant persistent memory and intelligence about your work patterns.
Checks AI-written code against your rules as it is written, and keeps a record of what it found.
AI coach for Garmin: builds training plans and structured workouts, synced straight to your watch.
Connect ChatGPT or Claude to your Gym Plus account to log and review workouts with AI coaching.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI-powered debugging through structured logging with pattern recognition and intelligent analysis. Allows applications to write structured logs and receive actionable debugging insights based on error patterns and frequency analysis.-
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered racing coaching and telemetry analysis for iRacing, providing real-time racing advice, car spotting, lap analysis, and conversational interaction with racing data through live telemetry streaming.2MIT
- FlicenseBqualityCmaintenanceEnables AI-assisted analysis of log files through advanced searching, filtering, and test execution capabilities. Supports time-based queries, pattern matching, test summarization, and code coverage reporting directly within compatible MCP clients.12-
- AlicenseAqualityAmaintenanceEnables AI assistants to analyze vibration data, detect machinery faults, and generate professional diagnostic reports through natural conversation.3478 PyPI100MIT