maimai-mcp: Instructions file for Codex

AGENTS.md

maimai-mcp AGENTS.md is an instructions file for Codex, OpenCode from antinomie1/maimai-mcp. It costs 2,460 tokens per session, scanned A, original, BSD-2-Clause.

A Rust architecture guide for an MCP server that handles maimai DX music, scores, user data, and generated images. MCP is a standard way for an AI assistant to call tools.

In plain words
What is it for?
Use it when implementing or reviewing a Rust maimai DX server, its score and song databases, chart-image rendering, or connections to score websites and chat bots.
Why use it?
It gives developers a defined structure for rebuilding the service, including its modules, configuration, data sources, image output, and error handling.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is antinomie1/maimai-mcp's own configuration. It tells Codex and OpenCode how to work on maimai-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything maimai-mcp configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is # 静态资源根目录(默认 ./static 或 ../maimaiDX/static).

Reuse

Borrowing it

Nothing to install: this file belongs to antinomie1/maimai-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/antinomie1/maimai-mcp/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/antinomie1/maimai-mcp

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for maimai-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/antinomie1/maimai-mcp/agents-md/github.svg)](https://agentmods.dev/instructions/antinomie1/maimai-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/antinomie1/maimai-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/antinomie1/maimai-mcp/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for maimai-mcp AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/antinomie1/maimai-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/antinomie1/maimai-mcp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,460 This file is loaded in full into every session.
When invoked 2,460 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02460 $0.02460
Opus 5 $0.01230 $0.01230
Sonnet 5 $0.00492 $0.00492
Haiku 4.5 $0.00246 $0.00246

Measured 8d ago against content hash f481ba418b71, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

maimai-mcp AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 156 lines

How it starts

The opening of the file, as written. The whole thing — 156 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Maimai DX MCP Server (Rust Architecture Specification)

本文档定义了将 Python 原版 maimaiDX 项目重构为高性能、模块化、代码精简的 Rust MCP 工具集的设计规范与实现蓝图。


1. 系统目标与设计原则

  1. 通俗易懂与极简代码
    • 杜绝过度工程和过深的抽象层,以简单、直观的函数式和轻量结构体驱动。
    • 整体代码量严格控制在 10,000 行以内。
  2. 高性能与多线程
    • 使用异步 I/O (tokio) 高并发处理查分网(水鱼 DivingFish / 落雪 LXNS / 柚子别名 Yuzuchan)的 HTTP 请求与数据同步。
    • 图片渲染阶段使用 CPU 多线程并发流水线(rayon 并行拼图和加载素材),大幅降低 B50 / 进度表渲染延迟。
  3. 像素级绝对坐标对齐
    • 采用纯 Rust 图像引擎(image + imageproc + ab_glyph),严格按照原 PIL 脚本的绝对像素坐标 (x, y) 贴图与绘制文字。
    • 静态资源路径完全兼容原项目规范,支持 MAIMAI_STATIC_DIR 环境变量与配置文件路径覆盖。
  4. LLM 与 AstrBot 友好
    • 自动支持上下文提取 QQ 号,统一入参标准。
    • 接口支持输出纯文本、Base64 图片(MCP 标准 Image Content Block)及本地图片文件路径,无缝兼容 QQ 机器人消息发送。

2. 模块架构设计

src/
├── main.rs                 # 服务入口、MCP Server 启动与 stdio 传输监听
├── config.rs               # 环境变量与资源路径配置 (MAIMAI_STATIC_DIR 等)
├── error.rs                # 统一轻量错误处理
│
├── core/
│   ├── models/             # 领域模型定义
│   │   ├── music.rs        # 曲目、谱面、等级与别名结构
│   │   ├── score.rs        # 成绩、分段、Rating 与 DX 分计算
│   │   └── user.rs         # 用户配置、绑定信息与凭据
│   │
│   ├── database/           # 本地数据存储与缓存
│   │   ├── music_db.rs     # 曲目库与谱面缓存索引
│   │   ├── alias_db.rs     # 别名数据库与模糊匹配
│   │   └── user_store.rs   # 按 QQ 号隔离的用户配置存储 (JSON)
│   │
│   ├── clients/            # 外部查分服务客户端 (Reqwest 异步请求)
│   │   ├── divingfish.rs   # 水鱼查分网 API Client
│   │   ├── lxns.rs         # 落雪查分网 API Client
│   │   └── yuzuchan.rs     # 柚子查分/别名数据源 Client
│   │
│   └── calc/               # 游戏数值算法
│       ├── rating.rs       # 单曲 Rating、B50 算法 (35 旧 + 15 新)
│       └── progress.rs     # 牌子、完成度、段位进度统计
│
├── draw/                   # 纯 Rust 绝对坐标绘图引擎 (image + ab_glyph + rayon)
│   ├── assets.rs           # 字体与图片素材加载/缓存管理器
│   ├── canvas.rs           # 坐标贴图、文字度量与绘制辅助器
│   ├── b50.rs              # B50 成绩总览图生成
│   ├── play_score.rs       # 单曲成绩结算卡片生成
│   ├── chart_info.rs       # 谱面信息预览卡片生成
│   ├── level_progress.rs   # 定数/等级完成度表生成
│   ├── plate_table.rs      # 牌子(霸者/舞舞/将/极/神等)进度表生成
│   ├── rating_table.rs     # Rating 达成表生成
│   └── fortune.rs          # 每日舞萌运势图生成
│
└── tools/                  # 供 LLM 调用的 MCP Tool 路由定义
    ├── b50.rs              # b50 查询与出图
    ├── score.rs            # 单曲成绩、分数线、上分推荐 (play_score / rise_score)
    ├── music.rs            # 曲目搜索、谱面信息、别名检索 (search_song / chart_info / alias)
    ├── random.rs           # 随机选曲、今天吃什么 (random_song / mai_what)
    ├── progress.rs         # 完成度与牌子进度 (level_progress / plate_table / level_score_list)
    ├── user.rs             # 绑定用户、查分源切换 (bind_player / user_settings)
    ├── fortune.rs          # 今日运势 (fortune)
    └── group_rank.rs       # 群内综合排行 (group_rank)

Read the full file on GitHub · 156 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 156 lines · 2,460 tokens per session scan A f481ba418b71

Subscribe to this mod's changes

maimai-mcp AGENTS.md is an instructions file published in the GitHub repository antinomie1/maimai-mcp (0 stars, last pushed 6d ago), licensed BSD-2-Clause. It adds 2,460 tokens to every session, about $0.0123 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,735 tokens