Appearance
Use the MCP server with an AI agent
What you're doing
Letting your AI coding agent (Claude Code, Cursor, Codex) build plugins without guessing. The erp-plugin-language MCP server exposes tools the agent calls to fetch the real schemas, the real widget catalog, real worked examples, and to validate what it wrote — all grounded in your ERP's authoring bundle.
Setup
bash
erp mcp install # writes .mcp.json in the current folderRestart your agent in that folder. It now has the erp_* tools.
The tools, and when to reach for each
Grounding — before writing an artifact
| Tool | Returns | Use when |
|---|---|---|
erp_list_schemas | every schema name | "what artifact types exist?" |
erp_get_schema {"name":"entity-definition"} | one full JSON Schema | before writing any entity / page / provider / rule / workflow / seed file |
erp_list_blocks / erp_list_blocks {"type":"core.grid"} | the widget catalog; one widget's full property + event list | before adding a block to a page |
erp_list_grammar_rules | the page/action-chain grammar | when an action chain isn't behaving |
erp_platform_catalog / erp_platform_describe {"className":"..."} | the live inventory of platform engines, REST mappings, tables; real method signatures for extension points | before assuming "there's no built-in X" |
Examples — copy a proven shape
| Tool | Returns |
|---|---|
erp_examples_patterns | curated named shapes (single-stage-self-decide, related-record-lookup-field, n-days-before-reminder-sweep, …), each pointing at a real shipped file |
erp_search_examples {"pattern":"employee-search","kind":"data-service"} | real shipped metadata files matched by name |
erp_search_docs {"query":"..."} | these docs + the live engine catalog + Java contracts |
Validation — after writing
| Tool | Checks |
|---|---|
erp_validate_page | one page against the contract + live block registry |
erp_validate_plugin_pages | every page in a plugin dir |
erp_validate_connector_definition | a connector JSON |
erp_lint_plugin_semantics {"pluginDir":"..."} | PAGE-DS-001 / DS-001 / I18N-001 / SEED-001 / JOB-001 across the whole plugin |
erp_plugin_scaffold | a starting skeleton for a plugin or extension point |
Diagnostics
| Tool | Returns |
|---|---|
erp_tail_logs {"grep":"<X-Correlation-Id>"} | the server-side stack trace for a failed call (join on the response's X-Correlation-Id header) |
A worked interaction
You: "Add a category lookup field to the equipment form."
A well-behaved agent will:
erp_examples_patterns→ findsrelated-record-lookup-field, reads the realpromotions.jsonit points at;erp_get_schema {"name":"data-service-definition"}anderp_search_examples {"pattern":"employee-search","kind":"data-service"}→ learns thesearch+dataViewrecipe;- writes
oeq-category-select-options-view.json,oeq-category-search.json, and thecore.lookupblock; erp_validate_plugin_pagesanderp_lint_plugin_semantics→ confirms clean.
Every step is grounded, nothing is guessed.
The verification-you-can-run trap
Ask the agent to prove each claim with a command whose output you can see — erp plugin test, erp api get ..., erp api post .../execute — not "it should work now". If the agent can't show you the output, the step isn't done.
How to verify the MCP wiring itself
Ask the agent to call erp_list_schemas. It should return a list of ~25 schema names. If it errors or says the tool doesn't exist:
cat .mcp.json— is there anerp-plugin-languageentry?- did you restart the agent in this folder?
- run
erp mcp installagain in the project root.
Common mistakes
| Symptom | Cause | Fix |
|---|---|---|
| agent invents block properties | didn't call erp_list_blocks for that type | tell it to ground first |
agent's page fails install on metadata.dataSource | skipped erp_lint_plugin_semantics | run it before publish |
| agent "can't find" a tool | .mcp.json in wrong folder / agent not restarted | erp mcp install in root, restart |
| schemas look stale | bundle not synced | erp env sync |
What to read next
- Set up the SDK
- Validate and test a plugin
- Expose a plugin operation as an AI tool — the other MCP concept: the ERP product's own embedded AI assistant calling your plugin at runtime, not your coding agent while you build