Jasper Galton-Fenzi

← All projects

Arm MCP Server: open-source fix

October 2026 · merged into arm/mcp main

Terminal showing --triple failing and --mtriple working

What I did

Arm publishes an MCP server: a set of tools an AI assistant can call, including mca, which predicts how fast a piece of assembly runs on an Arm CPU. It was my first time using Arm software, so I ran it locally in Docker and called each tool directly with MCP Inspector, with no AI in the loop, to see what it really does.

The bug

Filling in the tool's triple option (which Arm CPU family to target) always failed:

llvm-mca: Unknown command line argument '--triple'.
llvm-mca: Did you mean '--mtriple'?
llvm-mca: Too many positional arguments specified!

The response showed the exact command the server had run, which led me to one line in llvm_mca_tool.py: it passed --triple, but llvm-mca's flag is --mtriple. Because the flag wasn't recognised, the value after it was read as a second input file. The option had never worked since the first release, and no test covered it.

The fix and the test

Using the tool: -O0 vs -O2

I also used llvm-mca to compare a simple C loop compiled with optimisation off (-O0) and on (-O2), on a Neoverse V2 model:

Comparison-O0-O2
Whole function474 cycles403 cycles (looks ~15% faster)
Loop body, per number added3.08 cycles0.26 cycles (~12× faster)

The whole-function number hides the real gain, because llvm-mca runs every line once per pass and the -O2 code has extra setup around a vector loop. One surprise: IPC went down while the code got faster, because one vector instruction does four additions. IPC measures how busy the CPU is, not how much useful work it does.

What I learned