Skip to main content
Version: v1 (Current)

AI Agent Configuration

Use the GxP Toolkit with a local coding assistant to discover platform APIs, plan a plugin, and implement its Vue components and admin configuration. Project instructions give the assistant context; MCP connects it to tools. Neither connection proves that generated code works in an installed project.

This guide describes @gxp-dev/tools 2.1.40. Check the installed version and tool schemas when working with another release. Start with Toolkit Setup if you have not created a plugin project.

Examples below use a global gxdev command. With a project-local toolkit, run ./node_modules/.bin/gxdev from that project instead, for example ./node_modules/.bin/gxdev storybook or ./node_modules/.bin/gxdev --version. Use the global installation for initial creation from a parent directory.

Platform agents and local assistants​

The Developer Hub provides hosted planning, plan execution, and live coding chat. Planning saves a structured plan for approval; generation starts a hosted coding session. Agent configuration and team quotas belong to that platform workflow. See AI Planning and Generation.

Local Claude Code, Codex, and Gemini CLI sessions run on your workstation. Their authentication and usage belong to the selected provider. The local gxp-api MCP server is a toolkit process; it is separate from the platform MCP service and from AppUI's Storybook server. Local output still goes through Git review, build, release, installation, and permission checks before it becomes a working platform app.

Overview​

gxdev init copies these files into a new project. Updating an existing project preserves existing files unless you choose overwrite; review the changes before replacing customized instructions.

FilePurpose
AGENTS.mdShared project instructions used by Codex and other compatible assistants
CLAUDE.mdClaude instructions that import AGENTS.md
.claude/agents/gxp-developer.mdClaude's GxP developer subagent definition
.claude/settings.jsonClaude permission settings; the template allows mcp__gxp-api
.mcp.jsonClaude project MCP configuration for gxp-api and local Storybook
GEMINI.mdGemini CLI project instructions
.gemini/settings.jsonGemini project MCP configuration; the template includes gxp-api only
app-instructions.mdInstructions for the plugin being built; add its requirements and conventions

AGENTS.md is not Codex's MCP configuration. Claude's permission settings are not its server definition. A copied server definition still needs a resolvable executable, the correct working directory, and client approval where required.

Pin the MCP working directory​

Launching an assistant from the plugin root is the simplest starting point. For a persistent registration that must always use one particular project, save this gxp-mcp.cjs in that project's root, with the toolkit installed locally:

process.chdir(__dirname)
require("@gxp-dev/tools/mcp/mcp-serve.js")

This wrapper loads the project's toolkit and pins its .env and relative file operations to the wrapper's directory. In Claude or Gemini, merge this stdio entry into the respective mcpServers object, replacing the existing gxp-api entry. Replace the example absolute path with your project path:

{
"gxp-api": {
"command": "node",
"args": ["/absolute/path/my-plugin/gxp-mcp.cjs"],
"env": { "VITE_API_ENV": "develop" }
}
}

For Codex, inspect/remove an obsolete registration, then register the wrapper:

codex mcp add gxp-api --env VITE_API_ENV=develop -- node /absolute/path/my-plugin/gxp-mcp.cjs

The registration now targets this particular project; change it when switching projects. node must resolve in the client's PATH, or use its absolute path. For an operator's custom catalog, pass GXDEV_API_SPEC_BASE_URL in the same JSON env object, or as another Codex --env KEY=VALUE argument. Keep the project .env selector consistent: its matching VITE_API_ENV wins over the child environment. Reconnect and inspect get_api_environment to confirm the selected URLs before discovering operations or writing configuration.

What the Agents Know​

The bundled instructions describe the runtime container, store access, operation bindings, real-time events, dynamic content, admin configuration, and the plan/build/test workflow. They are starting context, not a guarantee that every example matches your installed runtime or API deployment.

In this release, some bundled examples still name GxButton/GxCard and legacy HTTP or socket helpers. The noninteractive generation prompt also contains older examples. Discover the installed AppUI exports and current operation schemas before coding. Prefer declared callApi bindings and current listen/broadcast methods for new code; apiPatch is a development-only helper, not a production store contract.

Launching an assistant​

Interactive project setup​

Run gxdev init my-plugin and choose a detected assistant in the setup wizard, or finish setup and launch your assistant from the plugin root. gxdev init my-plugin --yes skips the interactive wizard, including agent selection. It still copies the instruction files.

The wizard detects Claude and Codex with which; that checks executable availability, not authentication, despite its "logged in" label. Gemini is offered interactively only when the Gemini CLI is available. Authenticate with the provider before launching.

The launcher runs Claude or Codex with the initial prompt as an argument, and Gemini with -i <prompt>. It gives the child the project working directory and terminal input/output. Its prompt asks the assistant to discover APIs, clarify the feature, and propose a plan. Those are agent instructions; the toolkit does not enforce a separate approval checkpoint. An interactive provider exit does not itself validate the project.

Before launching Claude or Codex, the toolkit makes a best-effort call to <provider> mcp add gxp-api mcp-serve. It omits explicit scope and suppresses registration errors. Its message calls this "user scope", but the actual scope follows the provider's defaults. It does not make this registration call for Gemini. Inspect the resulting client configuration.

Noninteractive generation​

Use --build for a prompt-based scaffold in a new project. Choose the provider explicitly; the default is Gemini.

gxdev init my-plugin --yes --provider codex \
--build "Create a welcome screen with editable heading and image"
ProviderToolkit invocation / selection
Claudeclaude --print -p <combined-prompt>
Codexcodex exec --sandbox read-only --color never --skip-git-repo-check -- <combined-prompt>
GeminiCLI first (gemini -p <prompt>), then GEMINI_API_KEY or GOOGLE_API_KEY, then a detected gcloud account

The toolkit parses the provider's JSON response and then writes files itself. Codex's read-only sandbox applies to the Codex process; it does not make the complete gxdev init --build workflow read-only.

Generation expects a components array containing path and content, plus an optional manifest. The application step merges only strings.default, assets, and settings. It does not merge generated dependencies, permissions, form capability flags, or admin configuration. Complete and validate those separately.

In 2.1.39 this step overwrites returned file paths without confirmation, does not confine ../ paths to the project, and does not roll back earlier writes if a later file or manifest update fails. Use a disposable new project and inspect the diff. A failed or unparseable provider response can leave the normal starter project in place; init does not propagate the generation result as a reliable success exit status. Check the output and files before treating generation as successful.

Gemini's API-key fallback hardcodes gemini-2.0-flash; its gcloud fallback hardcodes gemini-1.5-flash in us-central1. These are legacy paths: Google records the 2.0 shutdown on June 1, 2026, and retirement of the 1.5 Flash versions in 2025. Use an authenticated current CLI rather than relying on those fallback models. See Google's Gemini API deprecations and Vertex model lifecycle.

Claude Code Setup​

Subagent​

Keep CLAUDE.md, AGENTS.md, and the gxp-developer subagent definition in the project. To request the bundled specialist, ask:

Use the gxp-developer agent to plan this plugin. Discover the operation
schemas and installed components before proposing the implementation.

MCP Servers​

If you configured the project wrapper above, keep that gxp-api entry. The direct executable configuration below is an alternative.

The copied .mcp.json defines two independent servers. For a global toolkit installation, its configuration is:

{
"mcpServers": {
"gxp-api": {
"command": "mcp-serve",
"args": []
},
"gxp-app-ui-storybook": {
"type": "http",
"url": "http://localhost:6006/mcp"
}
}
}

If the toolkit is installed only in this project, set command to that project's absolute node_modules/.bin/mcp-serve path. An assistant started outside an npm script may not have local package binaries on PATH.

For explicit project registration, the current Claude CLI supports:

claude mcp add --scope project --transport stdio gxp-api -- mcp-serve
claude mcp list

Inspect an existing entry before adding another. Claude's default local scope differs from project and user scope. Use /mcp in the session to inspect connection status and approvals. Review the copied broad mcp__gxp-api permission rule if you want per-tool prompts for file writes or API tests. See Claude's MCP reference.

gxp-api tools (stdio)​

The reviewed toolkit advertises 33 tools. Discover the actual schemas through your client's tool list; names and parameters can change between versions.

ToolsPurpose and effect
get_openapi_spec, get_asyncapi_specFetch the selected environment's specifications
search_api_endpoints, get_endpoint_detailsSearch operations and inspect endpoint definitions
search_websocket_eventsSearch AsyncAPI messages and channels
get_api_environmentReport the MCP selector and resolved specification URLs
api_list_tags, api_list_operation_idsEnumerate available resources and operations
api_get_operation_parametersInspect parameters, bodies, responses, security, permissions, and relation binding metadata
api_find_endpoints_by_schemaFilter operations by request/response fields, path, method, or tag
api_find_events_for_operation, api_list_eventsDiscover declared event triggers; an empty result can mean missing metadata
api_generate_dependencyGenerate a dependency and possible admin picker; writes a manifest when writeTo is supplied
config_validateValidate a local configuration or manifest
config_list_field_types, config_list_card_types, config_get_field_schemaInspect installed configuration schemas
config_list_cards, config_list_fieldsRead local configuration and return JSON pointers
config_add_field, config_move_field, config_remove_fieldEdit a local field list and lint before saving
config_add_card, config_move_card, config_remove_cardEdit local card containers and lint before saving
config_extract_stringsScan source for datastore/directive/dependency/tracking usage; optionally merge into a manifest
docs_list_pages, docs_search, docs_get_pageRetrieve published documentation, independent of API environment
test_scaffold_component_testWrite a starter Vitest test file; it contains one existence assertion and unfinished test cases
test_api_routeSend a real HTTP request using an operation's method and path
describe_store_api, describe_data_modelsRead the bundled store reference or selected OpenAPI models

Configuration mutations normally reject an invalid result without saving. force: true bypasses that guard. Paths are resolved from the MCP process's working directory, and absolute or parent paths are accepted. Confirm the target project before using write tools.

api_generate_dependency requires usable model and structured permission metadata; relation operations also require an explicit parent binding key. It can refuse incomplete or incompatible operations. An omitted or empty operationIds list selects all operations under the tag; choose explicit IDs for a narrow dependency. It returns a possible configurationField but does not insert that field into configuration.json. Its optional manifest write is separate from the configuration tools' lint guard. Generated metadata is a declaration, not a grant of server permissions.

test_api_route defaults to http://localhost:3069/api, but accepts another baseUrl, custom headers, and request data. It executes the discovered method, including writes; it has no dry-run mode or automatic platform login. Check the resolved path and base URL together to avoid duplicated /api prefixes. Use an intended test target and supply only the credentials that target requires. A spec lookup does not prove that a request will be authorized.

Documentation search uses https://docs.gxp.dev, not unpublished files in your checkout. The sitemap cache lasts one hour and page text lasts 30 minutes; refresh requests a reload. First search can fetch the full sitemap, and failed page fetches are omitted. describe_store_api is a bundled reference, so check the deployed store contract when a helper is marked development-only.

gxp-app-ui-storybook tools (HTTP)​

The template's server name is gxp-app-ui-storybook. It connects to AppUI's local Storybook MCP endpoint, separate from the 33 toolkit tools. Start it from the plugin project:

gxdev storybook

While Storybook is running, use its discovered tool list to inspect components, documentation, story previews, and available story tests. The old toolkit list_appui_components tool is absent from this version. See AppUI Reference for the component catalog.

A stopped Storybook server causes a connection error for that server. The stdio API server can remain connected. If Storybook chooses another port, update the client's HTTP URL to the displayed endpoint and reconnect. The copied Gemini settings do not include Storybook; add its HTTP entry using Gemini's format below.

OpenAI Codex Setup​

If you registered the project wrapper above, keep that API registration; the direct mcp-serve registration below is an alternative.

Launch Codex from the plugin root so it reads AGENTS.md. Sign-in and MCP registration are separate:

codex login
codex login status
codex mcp add gxp-api -- mcp-serve
codex mcp list

For a local-only toolkit, replace the final mcp-serve argument with its absolute project binary path. Codex stores CLI server registrations in ~/.codex/config.toml; copied Claude .mcp.json files do not register Codex servers. To add local Storybook separately:

codex mcp add gxp-app-ui-storybook --url http://localhost:6006/mcp

See the official command reference for authentication and registration options, and OpenAI's MCP setup for connection verification.

Google Gemini Setup​

This toolkit integration launches Gemini CLI. Keep GEMINI.md and .gemini/settings.json in the project; finish the CLI's authentication before starting work. It is not an automatic configuration for an IDE's Gemini Code Assist extension.

The copied settings register only the stdio API toolkit. To include local Storybook, merge an HTTP entry into the existing mcpServers object:

Keep your existing gxp-api entry if it uses the project wrapper. Add only the Storybook entry from this example.

{
"mcpServers": {
"gxp-api": {
"command": "mcp-serve",
"args": []
},
"gxp-app-ui-storybook": {
"httpUrl": "http://localhost:6006/mcp"
}
}
}

Use an absolute stdio binary path for a local-only toolkit. Gemini uses httpUrl for streamable HTTP; its url property selects SSE. Current Gemini CLI also supports gemini mcp add and gemini mcp list, even though this toolkit's launcher does not call mcp add for Gemini. Verify the folder's trust and connection status with the client. See Gemini's MCP reference.

API Documentation URLs​

The local MCP selector differs from preview runtime routing. Its precedence in 2.1.39 is:

  1. A VITE_API_ENV=<word> match in .env in the MCP process cwd.
  2. The MCP child process's VITE_API_ENV, then API_ENV.
  3. develop when no value is found.

The file reader uses a simple regex, not dotenv: an API_ENV=mock line alone is ignored, quoted VITE_API_ENV values do not match, and even a commented matching line can be selected. Use one uncommented, unquoted setting and remove conflicting examples. Unknown selectors, including mock, produce an error. Confirm the result with get_api_environment.

SelectorOpenAPI / AsyncAPI specification origin
develophttps://api.zenith-develop.env.eventfinity.app
testinghttps://api.zenith-develop-testing.env.eventfinity.app
staginghttps://api.efz-staging.env.eventfinity.app
productionhttps://api.gramercy.cloud
localhttps://api.eventfinity.test

Append /api-specs/openapi.json or /api-specs/asyncapi.json to these origins. For local, the reported API base is separately https://dashboard.eventfinity.test; these legacy hostnames must resolve in your environment.

An operator can supply GXDEV_API_SPEC_BASE_URL in the MCP child process environment to select another specification origin. It must be HTTPS with no credentials, query, fragment, or non-root path. A .env line for this override is not loaded by the MCP selector. It changes resolved specification URLs and reported API base; it does not configure a plugin's runtime, grant access, or change test_api_route's default target.

Specification responses are cached in memory for five minutes per URL. Restart the server after a deployment if you need a fresh catalog. Successful discovery confirms metadata retrieval, not resource access or compatibility with every installed project.

Critical Rules for AI Assistants​

1. Never Use Raw HTTP Clients​

For new plugin calls to the GxP platform, use its store and declared operation bindings. Do not replace an unavailable binding with a raw fetch or axios call. The MCP's own fetcher and deliberate API test tool are separate from plugin runtime code. See Store Integration.

2. Use Declared Operation Bindings​

Discover the operation ID, parameters, permission requirements, model, and binding key from the selected catalog. Declare the dependency in app-manifest.json, expose its selector in configuration.json, and configure the resource for the installed app. Then use:

// Values come from the discovered operation and configured app binding.
await store.callApi(operationId, dependencyIdentifier, requestData)

This is a call pattern, not a complete runnable example. Request data must match the operation schema. A successful preview with mock data does not prove the installed app's token, attendee session, or resource permissions. The server remains authoritative.

Review generated store and data-access code​

Toolkit 2.1.40 expands describe_store_api guidance; the release does not add a new authorization mechanism. Ask the assistant to read that tool before writing store calls, then inspect the generated code:

  • hasPermission reads global UI flags. A missing flag must not be treated as proof that a declared dependency operation is forbidden; handle the actual server's safe denied response.
  • findDependency resolves a binding, while pluginVars.projectId supplies runtime team/project context. Keep the declared model/parent scope and do not use path overrides to cross tenants.
  • Empty visible-field lists are not redaction. Same-model declarations and matching rules can widen effective output; verify the exact principal/endpoint fields and nested resources before claiming minimization. Hiding rows while reading a count still transfers those rows.
  • Render fixed safe errors, clear stale results after context changes and validate count values with Number.isSafeInteger(total) && total >= 0.

These are implementation/review requirements. The tool's text and a successful mock test do not prove deployed permission or response filtering. See runtime store and permissions.

3. Use Dynamic Content Directives​

Declare admin-editable strings and assets instead of hardcoding content:

<h1 gxp-string="welcome_title">Welcome</h1>
<img gxp-src="hero_image" src="/placeholder.jpg" alt="Welcome illustration" />

Sync extracted keys into the manifest and add matching admin fields. Extraction does not create the complete configuration form, resource binding, or meaningful tests. For form-backed plugins, distinguish the manifest's form capability flag from optional starter question data; see Manifest and Configuration Forms.

4. WebSocket Events Through Store​

For new code, use listen and retain its cleanup function; use broadcast for the intended peer socket. These methods replace legacy listenSocket and emitSocket aliases:

The following is an illustrative peer-socket pattern, not a complete Vue component. store and handleCursor come from your component. Register unsubscribe with Vue's onUnmounted(unsubscribe) during setup; do not call it immediately after subscribing.

const unsubscribe = store.listen("primary", "cursor_moved", handleCursor)
// During setup, after importing onUnmounted from Vue:
onUnmounted(unsubscribe)

The development store also supports listen(eventName, permissionIdentifier, callback) for discovered platform events; that extra form is not supported by the reviewed platform implementation. For installed resource events, use the declared dependency event facade and its cleanup as described in the store reference. A declared event or local listener does not establish server subscription permission. broadcast's boolean return is not a delivery receipt; test an actual receiver. Follow WebSocket Events for transport and lifecycle checks.

Customizing Agent Files​

Add the feature's audience, screens, admin-editable content, installed package versions, discovered operations, binding keys, and expected errors to app-instructions.md or shared project instructions. Keep provider credentials and privileged platform tokens out of these files.

An effective request is specific about both behavior and verification:

Plan a welcome plugin with an editable heading and image. Discover the
installed AppUI components and store methods. List the manifest keys and
matching admin fields before implementing. Test the rendered content,
missing-image state, and configuration changes. Report which checks use
mocks and which still need an installed project.

Before releasing generated work, review the diff, validate both JSON configuration files, add behavior assertions to generated starter tests, and run the build. gxdev lint --all checks supported configuration schemas; it is not a proof of Vue behavior, permissions, or live delivery. Use Testing and Deployment for the full release path.

Troubleshooting​

MCP Server Not Working​

Verify the toolkit executable and its installed version first. For a global installation on a POSIX shell:

command -v mcp-serve
gxdev --version

For a project installation, check node_modules/.bin/mcp-serve and the absolute path in the client configuration. The legacy gxp-api-server binary forwards to mcp-serve with a deprecation notice on stderr.

Connect through an MCP-capable client, list tools, call get_api_environment, then call api_list_tags. The client performs initialization and tool discovery; piping one JSON-RPC line to the server or posting an isolated tools/list request to Storybook is not a complete MCP connection check.

If environment inspection works but tags fail, inspect the selected specification URL, DNS, certificates, network access, and response status. Check the MCP working directory and environment precedence before changing runtime settings. If tools appear but return ok: false, wrote: false, or a nested error, read that result: some handled failures are returned inside successful MCP transport responses.

For Storybook, start gxdev storybook, confirm its displayed port, and reconnect that server in the client. Update the actual server definition: Claude .mcp.json, Gemini .gemini/settings.json, or Codex's registered HTTP URL. Claude's .claude/settings.json is not where that URL belongs.

Agent Not Being Used​

Launch from the intended project root and check the provider's instruction file. Claude needs a valid subagent definition; Codex uses AGENTS.md; Gemini CLI uses GEMINI.md. Authentication, folder trust, MCP connection, and instruction loading are separate checks.

If generation finishes without the requested feature, inspect provider errors and the files written. A parse failure, retired model, suppressed registration failure, partial write, or placeholder test can leave a project that still builds. Review and complete the implementation before publishing it.