famistudio-mcp
OfficialSummary: famistudio-mcp is an MCP server for generating, inspecting, validating, and rendering NES FamiStudio .fms projects from JSON without the GUI.
Locate FamiStudio and report version, CLI export capabilities, and allowed read/write roots (
famistudio_info).Convert between seconds, ticks, tempo, and frame rates (
compute_ticks).Compile JSON song specs into FamiStudio projects, optionally writing
.fmsfiles (compile_song_spec,create_fms).Validate every FamiStudio load invariant and list problems (
validate_fms).Read
.fmsfiles into structured JSON, summarize projects, and diff two projects (read_fms,summarize_fms,diff_fms).Round-trip through FamiStudio to verify text export and WAV render consistency (
verify_roundtrip).Export audio as WAV/MP3/OGG, export text or assembly, and analyze rendered WAVs (
export_audio,export_text,analyze_audio).Run arbitrary FamiStudio CLI commands as an escape hatch (
run_famistudio).FamiStudio itself is only required for rendering, text export, and round-trip verification; generation, reading, validation, and diffing work without it.
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., "@famistudio-mcp Create a quick jump sound with Square1, verify it, and render a WAV."
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.
famistudio-mcp
English | 简体中文
Model Context Protocol server for FamiStudio. Generate, inspect, validate and render NES
.fmsprojects from plain JSON — no GUI, no manual format wrangling.
compile_song_spec ──▶ create_fms ──▶ validate_fms ──▶ verify_roundtrip ──▶ export_audio
JSON notes .fms file invariants FamiStudio agrees .wavFamiStudio's command line can read .fms, .txt, .ftm and .nsf, but it has no
fms-export command — writing the binary format is the only supported way to produce
a .fms from a script. famistudio-mcp does that the same way FamiStudio 4.5.x does,
validates every load invariant before writing, and proves the result by feeding it back
to FamiStudio.
Quick start
Nothing to install — point your MCP host at the published package:
// Claude Desktop / Cursor / any MCP client that spawns a command
{
"mcpServers": {
"famistudio": {
"command": "npx",
"args": ["-y", "famistudio-mcp"],
// Optional fallback; see "Where generated files go" in docs/USAGE.md. If your client
// can prompt, you will be asked once and can pick a directory per project instead.
"env": { "FAMISTUDIO_MCP_OUTDIR": "/absolute/path/to/your/audio-work" }
}
}
}Bun users can swap the command:
{ "command": "bunx", "args": ["famistudio-mcp"] }Then ask your agent for what you want:
Build me a 2-second snake-move blip: a bright Square1 arpeggio, a low Triangle pulse underneath, and a noise tick. Write it to
D:/Game Assets/snake_move.fms, verify FamiStudio can load it, and render a 44100 Hz WAV next to it.
Without an MCP host
The same engine ships as a CLI, which is handy for scripts and CI:
npx -y famistudio-mcp-cli info
npx -y famistudio-mcp-cli compile examples/snake-move.json -o out/snake.fms
npx -y famistudio-mcp-cli verify out/snake.fms
npx -y famistudio-mcp-cli export out/snake.fms out/snake.wav --rate 44100
npx -y famistudio-mcp-cli analyze out/snake.wav --pitchAs a library
npm install famistudio-mcpimport { compileSongSpec, writeFms, readProject } from 'famistudio-mcp/core';
import { writeFile } from 'node:fs/promises';
const { project } = compileSongSpec({
name: 'Blip',
patternLength: 16,
channels: [
{ channel: 'Square1', notes: [{ time: 0, note: 'C4', duration: 8 }, { time: 8, note: 'stop' }] },
{ channel: 'Triangle', notes: [{ time: 0, note: 'C1', duration: 16 }] },
],
});
await writeFile('blip.fms', writeFms(project));
console.log(readProject(writeFms(project)).songs[0].name); // "Blip"FamiStudio itself is only needed for rendering, text export and round-trip verification. Generating, reading, validating and diffing projects works without it.
Related MCP server: project-fmod-api
Tools
Tool | Purpose |
| Locate the FamiStudio executable, report its version and the allowed read/write roots |
| Convert between seconds, ticks and tempo |
| Compile a JSON song spec into a complete project object, optionally writing a |
| Same, but always writes a file |
| Check every FamiStudio load invariant and list the problems |
| Decode a |
| Human-readable listing of a project with per-pattern note dumps |
| Structural diff of two projects |
| Round-trip through FamiStudio: text export + WAV render, checking for desync and silence |
| Render WAV / MP3 / OGG via the FamiStudio CLI |
| FamiStudio text, FamiTracker text, or sound-engine assembly |
| WAV duration, peak/RMS, silence and pitch detection |
| Escape hatch for any other FamiStudio CLI command (NSF, ROM, ...) |
Recommended flow
compute_ticks— decide the tick budget for the sound you want.compile_song_spec— build the notes.create_fms— write the file (or pass the returnedprojectstraight on).verify_roundtrip— prove FamiStudio loads it and produces audio.export_audio— render the.wavfor your game.analyze_audio— confirm duration and pitch, e.g. withseparateChannels.
The one thing to know before writing notes: a tick is one frame of the console, so a
song's length is ticks / 60.0988 seconds (NTSC) and its tempo follows from the tick grid
you write — bpm = 60 * frameRate / beatLength. groove and noteLength do not scale
playback. Everything else about the spec, including the full grammar and an effects table,
is in docs/USAGE.md.
Documentation
Document | What is in it |
README.md (this file) | What the project is, install, quick start, tool list |
The full song-spec reference: note forms, effects, tempo, output location, configuration, editor/CLI options | |
Build/test/verify commands and their gotchas, adding a tool, code style, path policy, desync debugging, known limitations | |
The | |
The compact entry point for coding agents: repository map, the format invariants, the change checklist | |
How to contribute | |
Release history |
Every document exists in English and Simplified Chinese (X.md / X.zh-CN.md), with a
switcher under the title going to the other language — except AGENTS.md, which is
agent-facing and deliberately English-only.
Compatibility
Writes and reads FamiStudio 4.5.x project files: serialization version 19.
Reading older files (versions 10–18) is not supported; open and re-save them in FamiStudio to upgrade them. Generation is unaffected.
Plain 2A03 only (no expansion audio: VRC6, FDS, N163, S5B, VRC7, EPSM). DPCM samples in an existing project are preserved byte-for-byte but cannot be authored.
The container uses
zlibraw deflate by design, and a re-encoded container can differ byte-for-byte from the original while the decompressed payload is identical.
License
MIT — see LICENSE.
FamiStudio itself is a separate project by Mathieu Gauthier-Pilote, licensed under the MIT license; this server only reads and writes its file format and drives its command line.
Available Tools
13 toolsanalyze_audioAnalyze a rendered WAVARead-onlyIdempotent
Report duration, peak/RMS level and silence for a WAV file, and optionally detect the pitch sequence. Pitch detection expects a monophonic render, e.g. a single channel exported with export_audio + separateChannels.
Inputs: path (required), channel, detectPitch, maxSegments, +3 more.
compile_song_specCompile a song spec into a FamiStudio projectAIdempotent
Compile a compact JSON song specification (channels + notes) into a complete FamiStudio project object, optionally writing it to a .fms file. Object ids, the mandatory instrument envelope masks and the fixed 256-slot pattern tables are filled in automatically. The returned "project" can be passed straight to export_audio / verify_roundtrip / validate_fms.
Notes can be written two ways: absolute: {"channel":"Square1","notes":[{"time":0,"note":"C4","duration":8},{"time":8,"note":"E4"}]} grid: {"channel":"Square1","notes":["C4",null,null,null,"E4"]} // one entry per tick In grid form a note without "duration" sustains until the next filled cell. FamiStudio note names are one octave above standard pitch: its "C4" sounds ~523 Hz, so write melodies one octave below the pitch you hear in a tracker.
Inputs: spec (required), outputPath.
compute_ticksConvert between seconds and ticksARead-onlyIdempotent
FamiStudio tempo arithmetic: with a uniform groove one tick equals one frame, so duration is ticks / frameRate (60.0988 NTSC, 50.007 PAL). Use it to turn a target duration into the tick count a spec needs, or to check how long a pattern budget lasts.
Inputs: pal, ticks, seconds, noteLength, +1 more.
create_fmsWrite a FamiStudio .fms file from a song specAIdempotent
Convenience wrapper around compile_song_spec that always writes a .fms file and returns its path plus a structural summary. Use this when the goal is a file on disk.
Inputs: spec (required), outputPath (required).
diff_fmsCompare two projectsARead-onlyIdempotent
Structurally compare two FamiStudio projects (files or inline objects) and list differences in metadata, instruments and per-note content. Use it to confirm that a rewrite did not change the musical content.
Inputs: projectA, projectB, projectPathA, projectPathB.
export_audioExport a project to WAV/MP3/OGGAIdempotent
Render a FamiStudio project to an audio file with the FamiStudio command line. Requires FamiStudio 4.5.x to be installed; call famistudio_info first if unsure. Returns the artifact path plus duration, peak level and an audibility check for WAV output.
Inputs: outputPath (required), rate, songs, format, +6 more.
export_textExport a project to text or assemblyBIdempotent
Convert a project with famistudio-txt-export (FamiStudio text - excellent for verification and for reading note data), famitracker-txt-export, or a sound-engine assembly exporter (famistudio-asm-export, famitone2-asm-export, ...). Returns a preview of the produced file.
Inputs: outputPath (required), songs, cleanup, command, +4 more.
famistudio_infoLocate FamiStudioARead-onlyIdempotent
Report whether the FamiStudio executable was found, which version it is, and the paths that were probed. Also lists the CLI export commands this server can run, and the directories it is allowed to read and write.
Inputs: no named parameters.
read_fmsRead a .fms fileARead-onlyIdempotent
Decode a FamiStudio project file into structured JSON: songs, channels, patterns and notes, plus instrument envelope contents. Set includeNotes=false for a structural overview of large projects. Only version 19 files (FamiStudio 4.5.x) can be read; older files must be re-saved by FamiStudio.
Inputs: path (required), includeNotes.
run_famistudioRun an arbitrary FamiStudio CLI commandAIdempotent
Escape hatch for FamiStudio commands this server does not wrap (NSF export, ROM export, assembly export with exotic options). Runs FamiStudio <input> <command> <output> [extraArgs...] with the given argv and no shell involved. Prefer export_audio / export_text when they fit.
Inputs: input (required), output (required), command (required), extraArgs, +1 more.
summarize_fmsSummarize a .fms projectARead-onlyIdempotent
Return a readable listing of a project: every song with its pattern order and per-pattern note dumps, plus tick totals and rendered duration. Use this to review what a .fms actually contains.
Inputs: project, projectPath, maxPatternsPerChannel.
validate_fmsValidate a project against FamiStudio rulesARead-onlyIdempotent
Check every invariant FamiStudio relies on when loading a project: the mandatory four-envelope instrument masks, the DPCM mapping count, unique object ids, nextUniqueId, reference integrity, note ranges and effect ranges, and the fixed 256-entry pattern tables. Returns the list of problems.
Inputs: project, projectPath.
verify_roundtripRound-trip a project through FamiStudioBIdempotent
The end-to-end validity check: re-export the project to FamiStudio text and render a WAV, then report whether FamiStudio loaded the file cleanly (no field desync) and produced audio of the expected length. Run this after generating a .fms file.
Inputs: project, workDir, projectPath, renderAudio, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Several tools sit close together: compile_song_spec vs create_fms, validate_fms vs verify_roundtrip, read_fms vs summarize_fms, and export_audio vs analyze_audio. The descriptions do clearly separate in-memory creation from file writing, invariant checks from end-to-end verification, and structured decoding from human-readable review, but an agent must read them carefully to avoid misselection.
Most tools follow a clean verb_noun snake_case pattern such as compile_song_spec, validate_fms, and export_audio, with the repeated _fms suffix forming a recognizable family. The main deviations are famistudio_info, which is noun-style, and run_famistudio, which uses the application name as the object.
Thirteen tools is a well-scoped size for a specialized FamiStudio server, and each tool maps to a distinct part of the create-validate-export-review workflow. None feel redundant or extraneous.
The server covers the full core loop: environment info, tempo arithmetic, spec compilation, file writing, validation, round-trip verification, reading, summarizing, diffing, audio analysis, and audio/text export. A minor gap is the lack of a direct update/modify path for an existing project from structured JSON, though run_famistudio acts as an escape hatch for uncovered CLI operations.
Maintenance
Related MCP Connectors
Create, validate, edit, export (markdown/svg/png/mermaid), and search JSON Canvas files.
Draft, validate, render, and share split-flap and flip-dot board videos written in flipcode.
Remote MCP: JSON repair, JSON Schema validation, JSON to TypeScript, CSV to JSON and JSON to CSV.
Convert PNG/JPG/SVG artwork to Brother .PES & Tajima .DST embroidery files or inspect binaries.
21
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides a headless video editing workflow using portable JSON projects and Kdenlive for review, enabling automated video rendering and project management.19Apache 2.0
- FlicenseNot gradedqualityCmaintenanceEnables bounded, schema-validated automation of FMOD Studio game audio through MCP/CLI workflows, including inspection, safe mutations, previews, receipts, and high-level workflows for events, assets, parameters, adaptive music, spatial audio, banks, and mixer/routing.-
- AlicenseAqualityBmaintenanceEnables agents to author, validate, inspect, patch, and render editable JSON pixel-art and animation recipes through local tools, producing PNG contact sheets, APNGs, sprite atlases, and related export bundles.281,365 npm141MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to build songs by editing a JSON song model: searching a licence-tagged sample library, adding step-pattern and time-stretched loop tracks, setting gain/pan, describing songs, and rendering them to 44.1 kHz WAV/MP3 with release-safety warnings. Songs and renders are read from and written to a project root, so an agent can go from empty project to finished track through MCP tool calls.1MIT