In the last AI Lab post I compared Oracle’s own agents in AI Agent Studio with bringing your own agent. This post builds the second path with MCP: a small server over Oracle’s agentic REST APIs, about 300 lines of Python, most of them guardrails, read only by design.
Oracle’s November 2026 update (26.11) widened this path. It ships Oracle’s own EPM Agent Skills for ChatGPT and Claude, downloaded from any EPM or EDM environment, with no AI Agent Studio required. They are not an MCP server. They call EPM’s REST APIs through bundled scripts, sign in with basic authentication from a plain text configuration file, and cover administration as much as analysis, from snapshots and security to data exploration for Planning and FreeForm. They are not read only: the administration skills can run a service recreate or an environment restore once you approve it in the chat. As of 26.11, Oracle ships no official MCP server for EPM.
Building your own gives you exact control over what the agent can reach. Every tool here is read only by construction, limited to the forms and cubes you name, and logged in a way your controls team can review. It also speaks MCP, so any MCP host can use it, AI Agent Studio included once it runs as a shared service over Streamable HTTP. If Oracle’s skills cover your use case and your security team accepts them, start there. The design rules below apply either way.
The design choices matter more than the code. An agent that reads your forecast is useful, but one that can change it without a person in the loop is a control failure that an auditor will eventually find.
The three APIs Oracle built for agents
The 26.04 update added these, and they are the foundation of everything that follows.
| API | Returns | When an agent uses it |
|---|---|---|
| Get Application Summary | An AI oriented markdown description of the application: cubes, dimensions, hierarchies | First, to learn what the application contains and what things are called |
| Export Form Data | A JSON grid for the slice a form defines | For anything a planner would recognize, and for asymmetric forms where the full intersection is hard to describe |
| Export Data | A JSON grid for an explicit POV, rows, and columns | For ad hoc questions no form answers |
The calls, in the same order:
GET /HyperionPlanning/rest/v3/applications/{app}/summary
GET /HyperionPlanning/rest/v3/applications/{app}/forms/{form}/data
POST /HyperionPlanning/rest/v3/applications/{app}/plantypes/{cube}/exportdata
Oracle’s documentation for the summary endpoint is clear about its audience: the response format may change significantly between releases, because it is designed for AI use rather than for stable programmatic consumption. In other words, Oracle now writes a description of your application for a model to read. That is a new idea, and it saves the server a great deal of work.
Six design rules before any code
1. Read only. The server has no tool that writes. When an agent needs to change data, the right pattern is that the agent proposes, a person approves, and a Groovy rule makes the change with its own validation. The write boundary belongs in the application, where your validation rules already live, and not in an agent tool.
2. The service account is the real boundary. The server runs as one EPM user. Give it a read only role and only the access permissions the use case needs. Everything else in this list is a second line of defense, and this is the one that holds when the others fail.
3. Allowlist what the agent can reach. The form tool reads only forms you name, and the slice tool queries only cubes you name. Both lists fail closed: leave one empty and its tool reads nothing, rather than everything. An agent does not need your payroll detail to answer a revenue question. There is one limit to keep in mind: a cube on the list exposes every intersection in it through the slice tool. If payroll detail sits in the same cube as revenue, the cube allowlist will not keep it out. EPM security on the service account, rule 2, will. The summary tool is the exception to both lists: it describes the whole application. If member names are sensitive themselves, such as employee names in a hierarchy, check what the service account’s summary shows before you connect an agent.
4. Cap what comes back. A large grid fills the model’s context and exposes more data than the question needed. The server keeps whole rows up to a cell budget and tells the agent when it cut something, so the agent narrows the question instead of guessing. A single row wider than the budget, or a response in a shape the server does not recognize, is refused outright, so the cap cannot be stepped around. Below the cell cap sit a byte cap and a deadline on every EPM call, so a huge or trickling response is cut off before it is ever parsed.
5. Audit every call, and never log values. One audit line per tool call that reaches the server, rejected calls included: the outcome, the exact parameters, and a keyed hash (HMAC) of what came back. One more line per EPM request: endpoint, status, and time. That answers “what did the agent look at, and what did it see” without a single figure in the log. The hash is keyed with a secret kept apart from the log, because a plain hash of a small result can be reversed by guessing numbers until one matches.
6. Validate the input. Reject requests that name too many members or implausibly long names before they reach EPM. It is a cheap first gate, not a size guarantee: one member function can still expand to a large grid, so the caps and the deadline in rule 4 are the backstop.
These line up closely with the NSA’s May 2026 guidance on MCP security design, which names financial information among the data that should be explicitly controlled and segregated, and recommends logging every tool invocation with its exact parameters and, where feasible, a hash of the result. It is worth reading in full if you are putting any agent near financial data.
The server

Setup
You need Python 3.10 or later.
pip install "mcp[cli]" requests
This code uses version 2 of the official MCP Python SDK, the current stable release, where the server class is MCPServer. Most tutorials you will find still show version 1, where the same class was called FastMCP. Since pip install mcp now installs version 2, copying a version 1 example fails on the first import.
Configuration comes from environment variables, kept in a .env file that never goes into source control. Use the plain user name, without the Cloud account name in front of it. Starting with the November 2026 update (26.11), Oracle no longer accepts the accountName.userName form in REST calls or the EPM Automate login. The service account must be allowed password based REST sign in. An account that requires multifactor authentication for basic REST authentication cannot use it, which is one more reason to move to OAuth 2.0 before production.
EPM_BASE_URL=https://your-environment-host
EPM_APPLICATION=YourPlanningApp
EPM_USER=svc_ai_read
EPM_PASSWORD=change-me
EPM_ALLOWED_FORMS=Revenue by Entity,Opex Summary
EPM_ALLOWED_CUBES=Plan1
EPM_AUDIT_KEY=change-me-to-a-random-secret
EPM_MAX_CELLS=5000
EPM_AUDIT_KEY keys the hash in the audit log. Generate it once with python -c "import secrets; print(secrets.token_hex(32))" and store it where the people who read the log cannot. The server refuses to start with a key shorter than 32 characters, with the placeholder above, or with a base URL that is not https://, so a typo in a config file cannot quietly switch off a control.
The four pieces that carry the design
The complete server, about 300 lines, is on GitHub with its configuration example and the 43 offline tests. Most of it is configuration and plumbing. Four pieces carry the design, and they are the ones worth reading here.
Three choices in the configuration matter before any of them. Every log line goes to stderr, and that is not a style choice: with the stdio transport, the host reads protocol messages from the server’s stdout, so a single stray print breaks the session. And the server hands the model an instructions string that ends with the most important line in the file: “Every figure you report must come from a tool result, never from estimation.” Each tool also carries ToolAnnotations marking it read only and non destructive. Hosts use these hints to decide how much to ask the user before running a tool. They are hints, not enforcement, which is exactly why rule 2 exists.
1. A tool, end to end. Here is the slice tool.
@mcp.tool(title="Export a data slice", annotations=READ_ONLY)
def export_data(
cube: str,
pov: dict[str, str],
rows: dict[str, list[str]],
columns: dict[str, list[str]],
) -> dict[str, Any]:
"""Export an explicit slice of a cube as a JSON grid.
cube: plan type name, for example the main planning cube.
pov: one member per dimension, for example {"Scenario": "Forecast", "Version": "Working"}.
rows and columns: dimension to member list, for example {"Entity": ["ILvl0Descendants(\\"Total Entity\\")"]}.
Member lists accept Planning member functions. Every dimension in the cube must appear on exactly
one of pov, rows, or columns. Use get_application_summary to find valid names.
"""
def fetch() -> dict[str, Any]:
if cube not in ALLOWED_CUBES: # fail closed: an empty allowlist permits nothing
raise Rejected(f"Cube {cube!r} is not on this server's allowlist. Queryable cubes: {sorted(ALLOWED_CUBES)}")
validate_members(pov, rows, columns)
payload = build_export_request(pov, rows, columns)
grid = _json(_call("POST", f"{API_ROOT}/plantypes/{quote(cube, safe='')}/exportdata", json=payload))
return cap_cells(grid, MAX_CELLS)
return audited("export_data", {"cube": cube, "pov": pov, "rows": rows, "columns": columns}, fetch)
The model reads the docstring to decide which tool to call and how, so write it the way you would brief a new analyst: what the tool is for, what to call first, and what the arguments look like. The type hints do real work too. In the MCP Python SDK, pov: dict[str, str] and the rest become the tool’s input schema, with no JSON Schema to write by hand.
The order inside fetch reflects the whole design. The allowlist check and validate_members run before anything reaches EPM. validate_members caps the number of members in one request and rejects empty or implausibly long names, which is cheap protection against both a confused agent and a crafted input. build_export_request turns three plain mappings into Oracle’s grid definition JSON, so the agent never writes it. The less structure the model has to build, the less it can get wrong. When the agent asks for a cube outside the allowlist, the error lists the cubes it can query, so the next attempt succeeds.
2. One place for every EPM call.
def _call(method: str, url: str, **kwargs: Any) -> bytes:
"""One place for every EPM call: a size cap, a deadline, timing, and errors without data."""
started = time.monotonic()
try:
response = session.request(method, url, timeout=TIMEOUT_SECONDS, stream=True, **kwargs)
except requests.RequestException:
log.info("EPM %s %s status=none seconds=%.1f", method, url.removeprefix(BASE_URL), time.monotonic() - started)
raise ToolError("EPM did not respond. Try again or narrow the request.") from None
body = bytearray()
try:
if response.status_code < 400:
for chunk in response.iter_content(chunk_size=65536):
body += chunk
if len(body) > MAX_RESPONSE_BYTES:
raise ToolError("EPM's response is larger than this server accepts. Narrow the request.")
if time.monotonic() - started > DEADLINE_SECONDS:
raise ToolError(f"EPM did not finish within {DEADLINE_SECONDS} seconds. Narrow the request.")
except requests.RequestException:
raise ToolError("EPM stopped responding partway through. Try again or narrow the request.") from None
finally:
response.close()
# Audit line: what was asked and how it went. Never log data values or credentials.
log.info("EPM %s %s status=%s bytes=%d seconds=%.1f", method, url.removeprefix(BASE_URL),
response.status_code, len(body), time.monotonic() - started)
if response.status_code >= 400:
# Oracle's error body can echo data, and the message below reaches both the model and
# the log, so only the status leaves this function. The detail stays in EPM's own logs.
raise ToolError(f"EPM returned HTTP {response.status_code}. Check names with get_application_summary.")
return bytes(body)
Every failure the server expects is raised as the SDK’s ToolError, and its subclass Rejected marks the ones refused before any call to EPM. If EPM does not answer, or stops partway through a response, the server still writes its EPM line and tells the model so. That choice matters in version 2 of the SDK. The model sees the text of a ToolError, so it can correct its request. Any other exception reaches the model only as “Error executing tool”, while the SDK writes the full traceback to the log. The SDK also logs every ToolError message, so none of them ever carries a figure. That is why _call passes on only the HTTP status of a failed request and never Oracle’s error body, which can echo data back.
3. A cap that tells the agent what it cut.
def cap_cells(grid: Any, max_cells: int) -> dict[str, Any]:
"""Keep whole rows until the cell budget is spent, and say so when anything was cut.
A response in any other shape is refused, so the cap can never be skipped."""
all_rows = grid.get("rows") if isinstance(grid, dict) else None
if not isinstance(all_rows, list) or not all(isinstance(r, dict) and isinstance(r.get("data", []), list) for r in all_rows):
raise ToolError("EPM returned a grid in a shape this server does not recognize, so it was not passed on.")
kept: list[Any] = []
cells = 0
for row in all_rows:
width = len(row.get("data") or [])
if cells + width > max_cells:
break
kept.append(row)
cells += width
if all_rows and not kept:
raise ToolError(f"One row holds {len(all_rows[0].get('data') or [])} cells, over the cap of {max_cells}. Request fewer columns.")
capped = dict(grid)
capped["rows"] = kept
if len(kept) < len(all_rows):
capped["truncated"] = {
"rowsReturned": len(kept),
"rowsAvailable": len(all_rows),
"maxCells": max_cells,
"hint": "Narrow the request with fewer members or a page member filter.",
}
return capped
The truncated block includes a hint. When the agent sees it, it knows the answer is partial and what to do about it. Without that hint, an agent can end up confidently summing half a grid.
4. An audit line for every call, with no figures in it.
def audit(tool: str, params: dict[str, Any], result: Any, outcome: str) -> None:
"""One audit line per tool call that reaches this server: the exact parameters and a keyed hash
(HMAC-SHA256) of the result. The key lives outside the log, so nobody reading the log can
guess a figure and confirm it against the hash, yet a saved transcript can be verified later."""
digest = "-"
if result is not None:
body = result if isinstance(result, str) else json.dumps(result, sort_keys=True, default=str)
digest = hmac.new(AUDIT_KEY, body.encode("utf-8"), hashlib.sha256).hexdigest()
log.info("TOOL %s outcome=%s params=%s result_hmac=%s", tool, outcome, json.dumps(params, sort_keys=True), digest)
def audited(tool: str, params: dict[str, Any], fetch: Callable[[], Any]) -> Any:
"""Run one tool call and audit it, including calls that are rejected or fail.
A rejected request is often the first sign of a confused agent or an injected prompt."""
try:
result = fetch()
except Rejected:
audit(tool, params, None, "rejected")
raise
except Exception:
audit(tool, params, None, "error")
raise
audit(tool, params, result, "ok")
return result
audited wraps every tool, so each call writes exactly one line whether it succeeds, is rejected, or fails: the tool name, the outcome, its exact parameters, and an HMAC of the result. A rejected call matters most, since a request for a form outside the allowlist is often the first sign of a confused agent or an injected prompt. One gap to know about: arguments of the wrong type, a number where a member name belongs, are refused by the SDK’s own validation before the tool runs. The SDK logs those with the field names only, and audited never sees them.
The HMAC is what makes this log useful. The log never holds a figure, yet if anyone later asks what the agent saw, you can take the saved transcript from the host, compute its HMAC with the key, and show it matches the log. The host shows the result as indented JSON, so load it and serialize it again the way the server does, with json.dumps(result, sort_keys=True, default=str), before computing the HMAC. Planning data moves, so rerunning the call later would not prove anything; the key and the transcript do. The summary tool returns text, so hash that text as it is.

The other three tools follow the same shape. The form tool checks the form allowlist, the summary tool caps its threshold and its length, and the list tool returns the allowlist itself. All four are on GitHub with the rest of the server.
Connect it to a host
For Claude Desktop, the SDK can register the server for you and load the .env file. It launches the server through uv, so install uv first and name the server’s one extra dependency:
mcp install epm_mcp_server.py --name "Oracle EPM" --with requests -f .env
Be aware of what that does: it copies the values from .env into Claude Desktop’s configuration file, password included, in plain text. Oracle’s own Agent Skills make the same trade with their configuration file. That is acceptable on a locked down workstation for a test application. For anything else, use OAuth 2.0, or pull the secret from a secrets manager at startup, as the next AI Lab post covers.
To test the tools by hand first, set the variables from .env in your shell, then run mcp dev epm_mcp_server.py --with requests. The CLI loads the server once before it opens the Inspector, so the variables must already be set. If the server then fails to connect from the Inspector, enter them in its environment variables panel too. Keep the Inspector current. The NSA guidance cites a remote code execution flaw in it, CVE-2025-49596, fixed in version 0.14.1. Current releases need Node 22.23.4 or newer on Node 22, or 24.22.1 or newer on Node 24.

Other MCP hosts use the same launch command in their own configuration. For a team, run it as a shared service over Streamable HTTP with mcp.run(transport="streamable-http", port=3001), keep it inside your network, and put real authentication in front of it before anyone else can reach it.
What a session looks like
Ask the agent something a finance partner would ask: how does first quarter revenue in the forecast compare with plan for the European entities?
A well behaved agent works through it in order. It calls get_application_summary to learn what the cube is called, how the Entity hierarchy is shaped, and what the Scenario members are named. It calls list_allowed_forms, and if a revenue form covers the question, it reads that with export_form_data. If no form fits, it builds a slice with export_data. Then it answers, and every number in the answer is traceable to a cell in a grid it retrieved.

That traceability is the point. The agent finds and assembles the data rather than inventing it, and the instructions string, the read only tools, and the traceability keep it that way.
Before you take this to production
This server is deliberately small so the design is easy to see. Before real use, add four things:
- OAuth 2.0 instead of a password. EPM supports it, and a token you can revoke beats a password in a file.
- A secrets manager for whatever credential you use.
- Authentication in front of any shared deployment. A Streamable HTTP server without it is an open door to your forecast.
- Tests against a real application. The request shapes follow Oracle’s documented examples. Confirm them against your own application before anyone relies on the answers.
If you are building this for real on Planning or FreeForm, look at Oracle’s Implementation Success Program for Conversational Interface. It gives expedited access to Cloud EPM Development for design reviews, including your prompts and skills, and one of its stated goals is finding REST API gaps. If your agent needs something the APIs cannot do yet, that is the place to say so.
Conclusion
Most of the technology to connect agents to EPM arrived in 2026: the agentic REST APIs in 26.04, and Oracle’s own Agent Skills in 26.11. Connecting them safely is still up to each team. Start read only, keep the boundary in EPM security, and make every number traceable to a cell. The rest can be added once that foundation is in place.
Next in the AI Lab: securing an agent that can see your forecast, the controls around this server. Later, adding a write path the right way, where the agent proposes a change, a person approves it, and a Groovy rule applies it with its own validation.
As always, feel free to reach out with questions or share how you are connecting agents to EPM.








