mcpField
S
Singing Pitch Tracker

Singing Pitch Tracker

Local
github.com/raulkiviMedia & Design1Updated 1d ago

About Singing Pitch Tracker

Singing Pitch Tracker is an MCP server for singers and score-based practice, detecting pitch from recordings or microphone input and aligning it with MusicXML. It reports score position and intonation, and can focus analysis on selected measures.

Key features

  1. 01Detect pitch in recordings and live microphone input
  2. 02Align audio with MusicXML scores
  3. 03Report measure position and pitch accuracy
  4. 04Analyze selected measure ranges
  5. 05Manage practice sessions and summaries

Use cases

  1. 01Follow score position while singing
  2. 02Find notes sung too high or too low
  3. 03Analyze intonation in selected measures
  4. 04Monitor a practice session through a microphone

MCP support

As an MCP server, it exposes tools for recording analysis, score loading, live monitoring, position checks, and session management. Clients can provide MusicXML and WAV recordings or start a microphone practice session.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"raulkivi-pitch": {
"command": "uvx",
"args": [
"pitch-mcp"
],
"env": {
"PITCH_BACKEND": "<PITCH_BACKEND>"
}
}
}
}
Run commanduvx pitch-mcp
Environment variables to set
PITCH_BACKENDPitch detection algorithm: librosa (default) or crepe

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypipitch-mcp0.3.1

Tools

7

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
part_idstringYesPart ID to compare against (e.g. 'Soprano')
musicxmlstringYesMusicXML document as a string
audio_pathstringYesAbsolute path to a 16-bit PCM WAV file

Details

From the project README

pitch-mcp

MCP server for real-time pitch detection and score alignment. Listens to a singer via microphone and reports their current position in a score and whether they are singing in tune.

What it does

Covers three goals:

  • Goal 4 — Show the current measure/beat position while singing
  • Goal 5 — Report pitch accuracy (too high / too low / on pitch)
  • Goal 6 — Identify where in the score a singer is based on a hummed or sung phrase

Supports both offline analysis of pre-recorded audio and real-time microphone input.

Tools

ToolDescription
analyze_recordingOffline: analyse a WAV file against a reference MusicXML score; returns per-note accuracy and highlights ("flat on E5 in m.12–14 (-35 cents avg)")
start_practiceLoad a score and open the microphone in one call; returns a session_id
load_scoreLoad a MusicXML score into a named session; returns a session_id
describe_scoreSummarize a score cheaply: title, key, tempo, parts with IDs and ranges
start_monitoringOpen the microphone and begin real-time pitch detection
get_current_positionPoll the current score position and pitch accuracy
stop_monitoringStop the microphone and return a session summary with highlights
list_sessionsList open practice sessions with their part, state (loaded / monitoring) and idle time
list_capabilitiesReturn server metadata: pitch backend, microphone availability
health_checkCheck that runtime dependencies (librosa, sounddevice/portaudio) are available

Scores are given as musicxml_path (a .musicxml, .xml or .mxl file, preferred) or as inline musicxml text, never both. Paths must lie inside the output root (SHEET_MUSIC_OUTPUT_ROOT, default the working directory), the client's MCP roots or a folder in SHEET_MUSIC_INPUT_ROOTS.

analyze_recording, load_score and start_practice take an optional measures: [start, end] (printed bar numbers, inclusive; a pickup is 0) to practise or analyse only those bars. Reported measures keep their printed numbers.

Installation

cd pitch-mcp
uv sync

For real-time monitoring (start_monitoring), PortAudio is required:

# Ubuntu / Debian
sudo apt install libportaudio2

Quick install: on Ubuntu/Debian/Linux Mint, bash install.sh handles uv and the optional libportaudio2 install for you — see SETUP.md for the full non-technical walkthrough. Ready-made client configs (Claude Desktop, Cursor, Windsurf, Continue, Zed) are in examples/. If something goes wrong, check TROUBLESHOOTING.md.

Running

uv run pitch-mcp

Configuration

VariableDefaultDescription
PITCH_BACKENDlibrosaPitch detection algorithm: librosa or crepe
PITCH_SESSION_IDLE_MINUTES10Close a practice session (and its microphone) after this many idle minutes; 0 never closes. stop_monitoring still returns the summary of a closed session for an hour, with "timed_out": true.

crepe requires a manual TensorFlow install (~500 MB) and downloads ~50 MB of model weights on first use. The default librosa backend (pYIN algorithm) works well for singing voice with no extra setup.

Usage examples

// Offline analysis of a recording
{
  "tool": "analyze_recording",
  "arguments": {
    "audio_path": "/path/to/recording.wav",
    "musicxml_path": "/path/to/score.mxl",
    "part": "Soprano"
  }
}

// Real-time session
{"tool": "describe_score", "arguments": {"musicxml_path": "/path/to/score.mxl"}}
// → returns parts with IDs ("P1" …), names and ranges

{"tool": "start_practice", "arguments": {"musicxml_path": "/path/to/score.mxl", "part": "Alto", "measures": [17, 24]}}
// → returns {"session_id": "abc123", "measure_count": 8, ..., "status": "started"}
// (the same as load_score followed by start_monitoring)

{"tool": "get_current_position", "arguments": {"session_id": "abc123"}}
// → returns measure, beat, expected pitch, detected pitch, accuracy

{"tool": "stop_monitoring", "arguments": {"session_id": "abc123"}}
// → summary with accuracy_histogram and highlights, e.g. "flat in m.19–21 (-32 cents avg over 5 notes)"

Audio must be 16-bit PCM WAV. MP3 and FLAC are not supported.

Testing

# Unit tests (no microphone or audio required)
VIRTUAL_ENV= .venv/bin/pytest tests/ -v

# Integration tests (offline analysis against a committed fixture pair)
VIRTUAL_ENV= .venv/bin/pytest tests/ -v -m integration

# Manual tests (real microphone required — skip in CI)
VIRTUAL_ENV= .venv/bin/pytest tests/ -v -m manual

294 of the 300 total tests are unit tests (292 run, 2 skipped), run against mocks and synthetic (in-memory) WAV data — none require real audio hardware or pre-recorded fixtures. The other 6 are marked integration (4 — offline analysis against the committed tests/fixtures/ pair) or manual (2 — full real-microphone session lifecycle) and are excluded from a plain pytest tests/ run by tests/conftest.py; select them explicitly with -m integration / -m manual.

Dependencies

  • librosa — pYIN pitch detection (primary backend, pure Python)
  • music21 — score parsing and pitch calculations
  • sounddevice — real-time microphone input
  • numpy, scipy — numerics
  • mcp — MCP protocol

System requirements

  • Python 3.12+
  • libportaudio2 — required for real-time microphone input (start_monitoring)
  • No system libraries required for offline analysis

Phase status

PhaseStatus
Phase A — offline analysisComplete. DTW-based alignment (dtaidistance); 292 unit tests plus 4 -m integration tests against a committed fixture pair (tests/fixtures/)
Phase B — real-time monitoringComplete. Position tracking is audio-driven (matches detected pitch, not just elapsed time); tempo_bpm override supported. Covered by unit tests with mocked sounddevice; full-lifecycle -m manual tests exist for real-microphone verification but require real hardware to run

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.