Work with a coding agent
Give Claude Code or another agent the docs, the types, the next action and the fixes for your project, with every write waiting for you.
Status Status is where the work is: Planned (in a milestone, not started), Building (tickets in progress), Preview (usable, may change), then the stability it ships at.
Stability The promise an interface ships with.
- Stable Follows semantic versioning; breaking changes need a new major, 12 months of overlap and a codemod.
- Beta Usable in production; may change before it becomes stable.
- Experimental May change or go away; needs an explicit opt-in in main.yaml.
You will give an agent the tools to finish a MainSDK task without guessing. It takes about 10 minutes.
You need
- A MainSDK project (see start a project).
- A coding agent that speaks MCP.
1. Read the docs offline
npx mainsdk help check
npx mainsdk docs --list
npx mainsdk docs mcpmainsdk help <command> prints usage and examples for a command. mainsdk docs reads the docs bundled with the version you installed, and mainsdk docs mcp serves them to an agent over MCP.
2. Make undeclared names fail
npx mainsdk typesIt writes .mainsdk/types/main.d.ts from main.yaml, so a call to something the project never declared fails to type-check.
3. Ask for the next action
npx mainsdk next --jsonIt prints one action: fix, edit, test, declare, ask a person or done. It exits 1 while there is something to do.
4. Apply a fix
npx mainsdk fix MAIN-NET-0002 --dry-run
npx mainsdk fix --all--dry-run prints the diff and writes nothing. A fix that widens a grant waits for a person and --allow-widen (MAIN-DEV-0001).
5. Connect the agent
npx mainsdk mcpThe server runs over stdio. Write tools are off until you pass --allow-write; without it the agent gets MAIN-DEV-0003.
Check that it works
mainsdk nextends withdoneafter the agent's changes, andmainsdk checkpasses.
Next
Was this page helpful?