MPS AGENTS.md

Project instructions for a codebase that combines JetBrains MPS models with Java and Kotlin code. JetBrains MPS is a tool for creating programming languages and code generators, and the guide explains which tools and files agents should use.

In plain words
What is it for?
Working on Java and Kotlin code, generated code, MPS languages, models, generators, validation, and related development tools.
Why use it?
It prevents agents from misreading or corrupting MPS model files and directs them to the appropriate workflow for each kind of code.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/jetbrains/mps/agents-md
Clone the repo
git clone --depth 1 https://github.com/JetBrains/MPS

Made for: Codex, OpenCode.

Per session 2,898 This file is loaded in full into every session.
When invoked 2,898 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.02898 $0.02898
Opus 5 $0.01449 $0.01449
Sonnet 5 $0.00580 $0.00580
Haiku 4.5 $0.00290 $0.00290

Measured 3d ago against content hash 6f838ad9948f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

MPS 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 3d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

AGENTS.md · 181 lines

How it starts

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

Agents Guide for This Project

This project is a mixed JetBrains MPS + plain Java/Kotlin codebase.

Developers typically use two environments against the same checkout:

  • IntelliJ IDEA for editing, debugging, testing, and inspecting Java/Kotlin code, including code generated by MPS.
  • JetBrains MPS for editing languages, models, generators, and other MPS artifacts.

Agents must adapt to the tools available in the current session. Use this file as the cross-environment entry point.

For detailed MPS node, model, language, generator, validation, and MCP workflows, load the mps-mcp-workflow skill. If your agent runtime does not explicitly confirm that project skills are auto-loaded, read .agents/skills/mps-mcp-workflow/SKILL.md before changing MPS artifacts.

⚠️ WARNING: Never Read Raw MPS Model Files

If you are opening or reading .mps, .mpl, or other MPS XML files directly, you are way off track and must stop immediately.

MPS model files are binary-like serialized XML that cannot be safely understood or edited as plain text. Reading them gives you opaque node IDs and no semantic insight — you will misinterpret the content and likely corrupt the model if you try to edit it.

What to do instead:

  • Use MPS MCP tools (mps_mcp_*) to inspect, navigate, and edit MPS models.
  • If MPS MCP tools are not available in your session, ask the user to start MPS and enable the MPS MCP server before continuing with any MPS work.
  • Do not attempt to parse, edit, or reason from raw .mps XML.

Project Nature: JVM + MPS

Treat this repository as having two kinds of source of truth:

  • Plain Java/Kotlin and related project files, usually edited and validated through IntelliJ IDEA tooling.
  • MPS models and language definitions, edited and validated through MPS-aware tooling.

Prefer the highest-level source of truth:

  • If behavior is defined by an MPS language, model, or generator, prefer fixing the MPS artifact rather than only patching generated Java.
  • If behavior is implemented in hand-written Java/Kotlin, use IDEA-oriented tools and workflows.

Read the full file on GitHub · 181 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. 3d ago First seen · 181 lines · 2,898 tokens per session scan A 6f838ad9948f

Subscribe to this mod's changes

MPS AGENTS.md is an instructions file published in the GitHub repository JetBrains/MPS (1,657 stars, last pushed yesterday), licensed Apache-2.0. It adds 2,898 tokens to every session, about $0.0145 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-08-30.