Skip to main content
Glama
README.md
# musictomidi-mcp

An MCP server (stdio transport) that lets an AI agent use the [MusicToMIDI API](https://musictomidi.com/developers) with your API key. It starts a MIDI conversion or a stem separation from a local audio or video file, follows the job, downloads its results, lists your jobs and reads your credits, quotas and prices.

API documentation: https://musictomidi.com/developers

Glama listing: https://glama.ai/mcp/servers/julienhalgand/musictomidi-mcp

## Tools

| Tool | Inputs | What it does |
|---|---|---|
| `musictomidi_convert_to_midi` | `file_path`, `model`, `startSeconds`, `endSeconds`, `options`, `stems`, `Idempotency-Key` | Sends the local audio or video file (`POST /v1/files`, then `PUT` to the returned upload URL) and starts a MIDI conversion (`POST /v1/jobs`, `operation: midi`). Returns `jobId` and `status` at once. A file larger than 4 GB is refused before it is sent. |
| `musictomidi_separate_stems` | `file_path`, `model` (`separation`), `startSeconds`, `endSeconds`, `stems`, `formats`, `mp3`, `Idempotency-Key` | The same for a stem separation (`operation: separation`). |
| `musictomidi_get_job` | `job_id`, `wait_seconds` (0 to 50, default 0) | `GET /v1/jobs/{jobId}`. With `wait_seconds`, asks again every 3 seconds until the job is `done`, `failed` or `expired`, or until `wait_seconds`. Returns the status, progress, stage, cost and results. |
| `musictomidi_download_result` | `job_id`, `output_dir` | Downloads the result files of a `done` job into `output_dir` and returns the paths written. Never overwrites a file: a number is added to the name. |
| `musictomidi_list_jobs` | `offset`, `limit` | `GET /v1/jobs`: the jobs of the account, newest first. |
| `musictomidi_get_account` | none | `GET /v1/account`: credits and quotas. |
| `musictomidi_get_prices` | none | `GET /v1/account`: the price list, as the API sends it. |

Models, parameters and options are those of the [OpenAPI description](https://api.musictomidi.com/developers/openapi.json), except `tempoKey` and `options.timingGrid`, which the tools do not expose.

With an `Idempotency-Key`, calling a start tool again with the same value, the same unchanged file and the same parameters does not send the file again and returns the job already started. The server remembers the files it sent for as long as it runs and the API keeps them (24 hours).

## Configuration

| Variable | | |
|---|---|---|
| `MUSICTOMIDI_API_KEY` | required | Your API key, created on https://musictomidi.com/developers. `mtm_prod_…` keys run real conversions. `mtm_test_…` keys use the same API, run no conversion, debit no credits and always return the same sample result. |
| `MUSICTOMIDI_API_URL` | optional | Base URL of the API. Default: `https://api.musictomidi.com/v1`. |

Without `MUSICTOMIDI_API_KEY`, every tool answers with an error that tells you to create a key.

Example of an `mcpServers` block with `npx`:

```json
{
  "mcpServers": {
    "musictomidi": {
      "command": "npx",
      "args": ["-y", "@rhiea/musictomidi-mcp"],
      "env": {
        "MUSICTOMIDI_API_KEY": "mtm_prod_…"
      }
    }
  }
}
```

Requires Node.js 18 or later.

## Errors

Each `error.code` of the API comes back as a clear message, with the original `code`. A network error or an unexpected HTTP response comes back with the HTTP code and the first 500 characters of the body. The API key never appears in an answer or a log.

## License

MIT License — see LICENSE.

TDQS

A4.1/5.0

Scored across 7 tools

Disambiguation5/5

Each tool maps to a distinct step of the workflow: two job-creation tools with clearly different outputs (MIDI vs. stems), plus status polling, file download, listing, credits/quotas, and pricing. The only near-overlap is get_account vs. get_prices, but the descriptions make the boundary explicit (remaining credits/quotas vs. per-model cost formula).

Naming Consistency5/5

All seven tools use the same musictomidi_ prefix followed by a snake_case verb_noun pattern (convert_to_midi, separate_stems, get_job, download_result, list_jobs, get_account, get_prices). No convention mixing.

Tool Count5/5

Seven tools is well-scoped for an async conversion service: two job submitters, three job-lifecycle tools, and two account/billing tools. Nothing feels redundant or missing at the count level.

Completeness4/5

The full async lifecycle is covered: submit, poll, download, list history, check credits, and check pricing. Minor gaps exist, e.g. no cancel/delete job operation and no explicit pagination/cursor parameter for list_jobs, but agents can work around these.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues