audio_fidelity_mcp
Uses a locally installed FFmpeg to decode audio formats beyond the natively supported WAV, FLAC, OGG and MP3 when comparing reference and processed files.
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., "@audio_fidelity_mcpcompare original.wav to compressed.mp3 and tell me the quality loss"
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.
What it does
Give it two audio files. It aligns them, then reports what changed:
Perceptual scores: PEAQ Basic ODG (ITU-R BS.1387-1) and ViSQOL MOS-LQO (Google, speech or audio mode). POLQA (ITU-T P.863) runs if you point it at your licensed binary.
Waveform measurements: sub-sample delay, SNR, segmental SNR, residual peak, correlation, optimal gain, clipping, BS.1770 loudness.
Spectral measurements: log-spectral distance, bandwidth of each file, and a noise-to-mask ratio per Bark band that points at the bands where damage concentrates.
Setup is one config block. uv run reads the dependency block inside the script and installs
everything on first run, so there is nothing to compile and nothing to download by hand.
Related MCP server: io.github.attenlabs/hotato
Setup
You need uv on the machine. Nothing else.
Paste the prompt below into your agent (Claude Code, Codex, OpenCode, Cursor, Gemini CLI, or any LLM with shell access). It clones the repo, registers the server, asks about POLQA, and verifies that the backends came up.
Install the MCP server "audio_fidelity_mcp" (measures audio quality loss: PEAQ ODG,
ViSQOL MOS-LQO, POLQA wrapper).
1. Run `uv --version`. If uv is missing, stop and link me to
https://docs.astral.sh/uv/getting-started/installation/. Do not install anything else,
do not use pip or virtualenvs.
2. Ask me where to clone (default ~/Projects/audio_fidelity_mcp), then:
git clone https://github.com/sittiev/audio_fidelity_mcp.git <path>
3. Ask me: "Do you have a licensed POLQA binary? (y/n)". If no, skip to step 4.
If yes, ask for its path and add to the server entry:
"env": { "POLQA_BIN": "<path>", "POLQA_ARGS": "-t {ref} -d {deg} -o {out}" }
Mention that the default POLQA_ARGS is an assumption we could not test, and that the tool
returns the binary's raw output so we can fix the flags if it fails.
4. Register the server. Prefer the CLI:
Claude Code: claude mcp add audio-fidelity -- uv run <path>/audio_fidelity_mcp.py
Other clients: add this block to that client's MCP config, with an absolute path:
{ "command": "uv", "args": ["run", "<path>/audio_fidelity_mcp.py"] }
5. Call server_info() through the MCP client and report which backends are up (PEAQ, ViSQOL
speech, ViSQOL audio, POLQA). Then run visqol_score() on a speech WAV I point you at and
report the MOS-LQO.
Do not edit files inside the repo.git clone https://github.com/sittiev/audio_fidelity_mcp.git
cd audio_fidelity_mcp
uv run audio_fidelity_mcp.py # headless stdio, deps resolved on first runRegister it in your MCP client (keep the path absolute):
{
"mcpServers": {
"audio-fidelity": {
"command": "uv",
"args": ["run", "/PATH/audio_fidelity_mcp/audio_fidelity_mcp.py"]
}
}
}POLQA is proprietary. OPTICOM and the ITU-T license the P.863 reference code and it
cannot be redistributed, so this repository ships the polqa_score tool but no binary.
Without POLQA_BIN the tool reports why and returns null. Voice is still measured, by
ViSQOL speech mode at 16 kHz.
If you own a binary, add it to the server entry:
"env": {
"POLQA_BIN": "/path/to/Polqa",
"POLQA_ARGS": "-t {ref} -d {deg} -o {out}"
}POLQA_ARGS is optional. Placeholders: {ref} for the reference file, {deg} for the
degraded file, {out} for the result file. The default assumes -t, -d and -o, which
we could not verify without a licensed binary. If the flags are wrong the tool still returns
the binary's own output under raw_output, so you can read its usage message and fix it.
Tools
Tool | Returns |
| Everything: ViSQOL, PEAQ, objective metrics, Bark bands |
| Ranking of codecs or bitrates by ODG, with MOS-LQO |
| PEAQ only: ODG, distortion index, 11 MOVs |
| ViSQOL only: MOS-LQO, VNSIM |
| POLQA only, needs |
| Active backends, platform, formats, failure reasons |
ODG runs from 0 (imperceptible) to -4 (very annoying). MOS-LQO runs from 5 (perfect) to 1 (bad). Identical files give ODG near +0.2 and MOS-LQO near 4.73, which are the ceilings of the two models, not a disagreement between them.
All tools take local paths. WAV, FLAC, OGG and MP3 are read natively; anything else works if
ffmpeg is installed. Downmix to mono, resampling and alignment are handled for you. Every
tool is marked readOnly, so calling one changes nothing.
Usage
Ask your agent to compare two files:
Compare
/music/master.wavagainst/music/song_128.mp3and tell me if the degradation is audible.
This is what comes back, cut down to the interesting fields:
{
"alignment": { "delay_samples": -0.007, "delay_ms": 0.0 },
"time_domain":{ "snr_db": 24.8, "segmental_snr_db": 15.1, "correlation": 0.97 },
"spectrum": { "lsd_db": 6.2, "reference_bandwidth_hz": 20500, "test_bandwidth_hz": 16000 },
"psychoacoustic_proxy": { "audible_time_freq_cells_pct": 3.1, "total_nmr_db": -12.4 },
"peaq": { "odg": -1.42, "odg_interpretation": "perceptible but not annoying",
"distortion_index": 0.9 },
"visqol": { "mode": "audio", "moslqo": 3.9, "vnsim": 0.88 },
"verdict": "Subtle degradation (few audible time-frequency regions in the proxy)"
}More prompts are in MCP_USECASES.md.
Which metric to use
Voice, speech and VoIP:
visqol_score(mode="speech"). ViSQOL's speech mode was calibrated on speech and runs at 16 kHz. With a licensed binary,polqa_scoreis the telecom standard for calls.Music and audio codecs:
visqol_score(mode="audio")at 48 kHz, andpeaq_odgbeside it.Long files: read the MOVs, not just the ODG.
Bandwidth,Noise-to-MaskandAverage Modulation Differenceusually tell you where the damage is.IIR filters and anything else that distorts phase break time-domain SNR, because no single delay aligns every frequency. Trust the spectral numbers and the perceptual scores there.
What is verified
Part | Status |
peaqb on linux-x86_64 | Ran in tests over the MCP protocol |
peaqb on linux-aarch64, macos and windows builds | Compiled with |
ViSQOL speech and audio (visqol-python 3.8) | Ran in tests, checked against Google's C++ build: identical files scored 4.7266 and 4.7321 on both, MP3 at 24k scored 3.2048 on both |
POLQA wrapper | Never ran. No licensed binary was available, and the default CLI flags are a guess |
If the bundled PEAQ binary refuses to run (a noexec mount, antivirus), the server_info
tool says why and PEAQ_BIN points it at another copy.
Limits
No perceptual model here was checked against the ITU conformance vectors, which are paid documents. Numbers come from the tests listed above.
PEAQ here is Basic, not Advanced. POLQA is a wrapper, and it needs your own licensed binary.
ODG and MOS-LQO compare versions of the same material. They are not physical measurements, and they were not built to rank two different recordings against each other.
Credits
peaqb, PEAQ Basic by G. Gottardi, with Akinori Ito's speed patch, plus FFTW 2.x. Source and
COPYINGare invendor/.visqol-python, a pure-Python implementation of Google's ViSQOL.
ai-edge-litert runs the lattice model, libsvm-official runs the audio SVR.
Structure follows the mcp-builder guide.
License
GPL-3.0-or-later, because vendor/peaqb is GPLv2. See LICENSE and NOTICE
for third-party components and the changes made to them.
This server cannot be deployed
Maintenance
Related MCP Connectors
Measure voice/VoIP path quality -> estimated MOS + live network metrics
Test the voice agents you run: scored transcripts, pass/fail verdicts, latency and WER metrics.
Podcast and media analysis: transcripts, captions, chapters, ad markers and show notes.
Media intelligence analysis for audio, video, and images via the Echosaw MCP server.
Related MCP Servers
- AlicenseAqualityCmaintenanceLoudness compliance verdicts against formal broadcast standards (EBU R128, ATSC A/85). Measures audio/video with ffmpeg and returns a pass/fail verdict with exact deltas and remediation parameters.237 PyPI1MIT
- AlicenseNot gradedqualityAmaintenanceEnables coding agents to run offline voice-agent call forensics over local stdio, scoring recordings and reading/verifying evidence to isolate failures. It also proposes fixes and regression checks so broken calls can be pinned and prevented from shipping again.61 PyPI2MIT
- AlicenseNot gradedqualityBmaintenanceTurns silent defects in AI-generated video and audio — wrong speaking pace, mismatched loudness, truncation, dead air, late captions, broken layout — into hard assertion failures inside tests and CI. Enables agents to check individual files or whole output directories against platform presets, returning pass/fail exit codes and human-readable bug reports instead of raw measurements.23 PyPIMIT
- AlicenseAqualityAmaintenanceAudio perception for AI agents. Measure loudness, clipping, noise and pitch; view spectrograms; split audio into events; transcribe speech; compare before/after; and clean up, edit or synthesize sound. Runs locally, no API keys.14218 PyPIMIT