midasheng-gen-mcp
AGENTS.md2 starsChanged 3 months agoApache-2.0View on GitHub
FastMCP 3.4 server wrapping MiDashengLM-Gen (Xiaomi Research): unified 16 kHz mixed audio scene generation (speech, music, SFX, ambience) from structured text captions. LLM-driven autoregressive flow matching with a Qwen3-1.7B backbone (2.9B params total). Apache-2.0, runs locally on CUDA. - Ports: backend 11159 (REST + MCP /mcp), frontend 11160 (registered in WEBAPP_PORTS.md) - The shared FastMCP instance lives in server.py; tool modules import mcp from there (registration at import time - no import = no tool) - uv sync --extra model…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- llms-full.txtllms.txt
- llms.txtllms.txt
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 60
No em dashes in any file; ASCII only
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md - midasheng-gen-mcp
Purpose
FastMCP 3.4 server wrapping MiDashengLM-Gen (Xiaomi Research): unified 16 kHz mixed audio scene generation (speech, music, SFX, ambience) from structured text captions. LLM-driven autoregressive flow matching with a Qwen3-1.7B backbone (2.9B params total). Apache-2.0, runs locally on CUDA.
Layout
src/midasheng_gen_mcp/
server.py FastMCP instance (shared), lifespan, FastAPI build
main.py Dual transport entry (stdio default, HTTP on MCP_PORT)
config.py Settings from MIDASHENG_* env vars
model_manager.py Lazy torch/transformers load, generate, state machine
jobs.py Async job runner + prompt builder
db.py SQLite scenes + jobs store (WAL)
samples.py Built-in example captions
audio.py WAV metadata + persistence helpers
logs.py Ring-buffer log store
mcp/tools/ audio_scene portmanteau, help, prefab cards
api/routes/ REST: health, dashboard, scenes, jobs, audio, tools,
skills, samples, logs, llm, model, capabilities
skills/midasheng-gen/SKILL.md
webapp/ React + Vite + Tailwind SOTA dashboard (port 11160)
tests/ 15 pytest tests (no torch required)Key facts
- Ports: backend 11159 (REST + MCP /mcp), frontend 11160 (registered in WEBAPP_PORTS.md)
- The shared FastMCP instance lives in
server.py; tool modules importmcpfrom there (registration at import time - no import = no tool) uv sync --extra modelinstalls torch/transformers; without it the server runs but reportsnot_installedstate (declared, not fake)- Model checkpoint:
mispeech/midashenglm-genon Hugging Face (~6 GB), auto-download via start.ps1 or the download_model operation - Structured caption: <|caption|> <|asr|> <|speech|> <|sfx|> <|music|> <|env|> views; absent views become <|unknown|>
- MCP generate is synchronous; the webapp uses the async job API (POST /api/generate -> job id -> GET /api/jobs/{id})
Commands
just lint ruff check + format --check
just test pytest (light, no torch)
just web-check tsc --noEmit + biome check (webapp)
just ci lint + test
just mcpb-pack fresh-stage MCPB bundle
just model-download installs model extra + downloads checkpointConventions
- Fleet standards: mcp-central-docs (AGENTS.md gate, SOTA, WEBAPP_PORTS)
- No em dashes in any file; ASCII only
- Dialogic returns: {success, message, ...}; _error_response auto-logs
- Prefab cards for list/status surfaces (show_scene_status_card etc.)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

