apex-mcp enforces a strict lifecycle for creating APEX applications. Every tool call that creates a page, region, item, or any other component depends on the import session being properly initialized — and that session must be cleanly closed when you’re done. Understanding this four-phase lifecycle prevents the most common errors and ensures every application is committed correctly to the database.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/TechFernandesLTDA/apex-mcp/llms.txt
Use this file to discover all available pages before exploring further.
Lifecycle Phases
Connect
Call
apex_connect() to establish the Oracle database connection via your mTLS wallet. This must be done before any other operation — all subsequent tool calls require an active connection.apex_connect() uses the Oracle credentials and wallet path from your environment variables (ORACLE_DB_USER, ORACLE_DB_PASS, ORACLE_DSN, ORACLE_WALLET_DIR, ORACLE_WALLET_PASSWORD). Once connected, the ConnectionManager singleton keeps the connection alive and auto-reconnects on transient Oracle errors.Create App
Call After this call, the
apex_create_app(app_id, app_name) to initialize a new import session. This call does two things:- Starts the
wwv_flow_imp_pageimport sequence in Oracle, registering a new application under your APEX workspace. - Resets the
ImportSessionsingleton and theIdGenerator, clearing any state from a previous session.
ImportSession tracks every component you create. The IdGenerator starts fresh, producing IDs that won’t collide with any previously created components.Add Components
With an active session, call any combination of component tools to build out the application. Tools can be called in any order within this phase, though logical dependencies apply (for example, a region must exist before you can add items to it).Common operations in this phase include:
apex_add_page()— add a new pageapex_generate_login()— generate a standard login page (page 101)apex_add_region()— add a region to a pageapex_add_item()— add a form fieldapex_add_button()— add a buttonapex_add_lov()— add a List of Valuesapex_add_auth_scheme()— add an authorization schemeapex_add_nav_item()— add a navigation menu itemapex_generate_crud()— generate a full IR list + form page pairapex_generate_dashboard()— generate a dashboard with charts and KPIsapex_add_jet_chart(),apex_add_metric_cards()— add visualizations
Finalize
Call After finalization, the app is immediately accessible in APEX App Builder and can be run at
apex_finalize_app() to close the import session and commit all changes to the database. This is a required step — without it, the application will be incomplete or missing its closing import markers in Oracle.f?p={app_id} relative to your APEX base URL.Quick Build Pattern
The following pattern (from the apex-mcp system instructions) shows a complete, minimal app build from connect to finalize:MY_TABLE, and navigation — in a single round of tool calls.
Working with Existing Apps
Not every workflow requires creating a new app. To inspect or modify an existing application, you only need a connection — noapex_create_app() or apex_finalize_app() required:
Session State
Theapex://session MCP resource shows the current import session state at any point during the lifecycle. You can read it to confirm which components have been registered:
Item Naming Convention
All form items follow the APEX naming conventionP{page_id}_{COLUMN_NAME}. apex-mcp tools apply this prefix automatically — you pass the column name and the page ID, and the full item name is constructed for you. For example, adding an item for the EMPLOYEE_NAME column on page 10 produces the item P10_EMPLOYEE_NAME.