Skip to content

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 folder

Restart your agent in that folder. It now has the erp_* tools.

The tools, and when to reach for each

Grounding — before writing an artifact

ToolReturnsUse when
erp_list_schemasevery schema name"what artifact types exist?"
erp_get_schema {"name":"entity-definition"}one full JSON Schemabefore 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 listbefore adding a block to a page
erp_list_grammar_rulesthe page/action-chain grammarwhen 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 pointsbefore assuming "there's no built-in X"

Examples — copy a proven shape

ToolReturns
erp_examples_patternscurated 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

ToolChecks
erp_validate_pageone page against the contract + live block registry
erp_validate_plugin_pagesevery page in a plugin dir
erp_validate_connector_definitiona connector JSON
erp_lint_plugin_semantics {"pluginDir":"..."}PAGE-DS-001 / DS-001 / I18N-001 / SEED-001 / JOB-001 across the whole plugin
erp_plugin_scaffolda starting skeleton for a plugin or extension point

Diagnostics

ToolReturns
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:

  1. erp_examples_patterns → finds related-record-lookup-field, reads the real promotions.json it points at;
  2. erp_get_schema {"name":"data-service-definition"} and erp_search_examples {"pattern":"employee-search","kind":"data-service"} → learns the search + dataView recipe;
  3. writes oeq-category-select-options-view.json, oeq-category-search.json, and the core.lookup block;
  4. erp_validate_plugin_pages and erp_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 an erp-plugin-language entry?
  • did you restart the agent in this folder?
  • run erp mcp install again in the project root.

Common mistakes

SymptomCauseFix
agent invents block propertiesdidn't call erp_list_blocks for that typetell it to ground first
agent's page fails install on metadata.dataSourceskipped erp_lint_plugin_semanticsrun it before publish
agent "can't find" a tool.mcp.json in wrong folder / agent not restartederp mcp install in root, restart
schemas look stalebundle not syncederp env sync