ebs-query-mcp
# ebs-query-mcp
Lets Claude **read and work in Oracle E-Business Suite R12 (12.2, 12.1)**: ask
questions in plain language, check setups, and make changes through Oracle's
official APIs, always with a test run first and your explicit yes before
anything is saved.
It is the on-premise counterpart of the Fusion MCP. Fusion has no database
access; EBS does, so this server connects **directly to the EBS database** with
[`python-oracledb`](https://python-oracledb.readthedocs.io/).
---
## What it can do
**Read and explain**
* Answer questions with live data ("open POs for supplier X in OU Y", "who
approves requisitions above 25,000?").
* Find where anything is stored: tables, columns, flexfield prompts, foreign
keys, concurrent program parameters.
* Follow concurrent requests and workflow notifications.
**Know EBS**: `ebs_get_hints` gives join traps (MOAC, `_TL`, `_F`, items per
org) and **implementation guides** for Inventory, Purchasing, Sourcing/iSupplier:
the setup order, where each setup is stored, ready-made check queries, required
profiles, and common errors with their fixes.
**Act** (on test/UAT instances; every change = test run -> your yes -> commit)
| Area | Saved actions |
|---|---|
| Users and people | create user (no password; the person sets it in EBS), link user to employee, add responsibility, end-date user, create employee, create location |
| Responsibilities and profiles | copy a responsibility (menu, request group, exclusions, profiles; optionally assign it), set or remove a profile value |
| Purchasing | create requisition (Requisition Import), cancel PO, define buyer, create supplier, create supplier site |
| Inventory | create item from a template, assign item to an org, add a category to a category set, assign item to a category, create locator |
| Any program | submit / cancel a concurrent request (Replicate Seed Data, Fill Employee Hierarchy, Workflow Background Process ...), respond to your own notifications |
Setups with no official API (subinventories, organization parameters,
financials/purchasing/receiving options, approval groups, position hierarchies,
shipping networks, opening periods) are done in the EBS screens; the MCP checks
them afterwards.
---
## Team rules (read before installing)
1. **Use a read-only database user for reading** (`XX_MCP_RO`). Ask your DBA to
run `setup/create_mcp_readonly_user.sql`. Avoid giving everyone the APPS
password.
2. **Actions only on test/UAT.** An instance marked `production` refuses
actions unless `allow_on_production: true` is set on purpose.
3. **Your passwords stay on your laptop**, in `~/.ebs-query/.env`. Never send
them in chat or commit them. `.env` and `config.yaml` are git-ignored.
4. **Client-specific notes stay private**: put them in `~/.ebs-query/knowledge/`
(see below), not in the shared project.
5. Every call is logged locally to `~/.ebs-query/audit.jsonl`.
---
## Install (about 15 minutes)
### 0. What you need
* VPN / network access to your EBS database.
* From your DBA: **host, port, service name** of the EBS database, and a
**read user + password** (and for actions on test: the APPS password).
No DBA at hand? In EBS: *System Administrator > Oracle Applications Manager >
Dashboard > Hosts / Database status* shows the DB host; port and service are
in the database details.
* Your **EBS login name** and a responsibility it holds (actions run as you).
### 1. Tools (once per laptop)
```powershell
winget install --id astral-sh.uv -e
```
```powershell
winget install --id Git.Git -e
```
`uv` installs the right Python by itself.
### 2. Get the project
```powershell
git clone https://github.com/abosrie13/ebs-mcp.git EBS-MCP
```
```powershell
cd EBS-MCP; uv sync
```
### 3. Oracle Instant Client (only if needed)
Many EBS databases still use an old password type that the built-in driver
cannot handle; the setup wizard tells you if yours does (**DPY-3015**). Then
download **Instant Client Basic (19.x), Windows x64** from oracle.com, unzip it
to `C:\oracle\instantclient_19`, and run the wizard again. It finds the folder
automatically.
### 4. Run the setup wizard
```powershell
uv run ebs-query-mcp-setup
```
It asks for the instance name, test/production, host, port, service, users and
passwords (typed hidden), your EBS login and default responsibility, and an
optional default operating unit. It then **tests the connection**, checks your
EBS user and responsibility, writes `~/.ebs-query/config.yaml` and `.env`, and
prints the registration command. Run it again to add another instance (DEV,
PROD ...); earlier settings are kept with a backup.
### 5. Register with Claude
Run the command the wizard printed, typically:
```powershell
claude mcp add --scope user EBS -- "C:\path\to\EBS-MCP\.venv\Scripts\ebs-query-mcp.exe"
```
(Claude Desktop instead: add the same `command` under `mcpServers` in its
config file.)
### 6. Try it, in a new chat
1. "run ebs_health_check" -> shows your EBS release and user.
2. "what responsibilities do I have?" -> `ebs_my_access`.
3. "list the operating units" -> a live query.
4. "check the purchasing setup of operating unit X" -> setup hints + checks.
5. Optional, on test: "copy responsibility X as Y" -> you see a **test run**
first; answer no to leave EBS untouched.
---
## Private knowledge (your own notes, never shared)
Put YAML files in `~/.ebs-query/knowledge/`. They merge into the shared topics:
```yaml
setup_purchasing:
rules:
- "At client X approvals use AME, not the position hierarchy."
my_client_notes:
summary: Things specific to my client
rules:
- "Requisitions above 50k need the CFO approval group."
```
## Updating
```powershell
git pull; uv sync
```
Then start a new chat so Claude loads the new version. See `CHANGELOG.md`.
## Adding to the shared MCP
* **New action**: a YAML entry in `src/ebs_query_mcp/registry/` (PL/SQL block
using `:binds`, typed params, outputs, a `success` rule). Use official APIs
only, never direct table writes; test it with `dry_run=true` on UAT; add it
to the table above.
* **New know-how**: add rules to `src/ebs_query_mcp/knowledge/*.yaml`, general
and in your own words (no client names, accounts or copied documents).
* Run `uv run pytest` before sharing.
## Troubleshooting
| Message | Meaning / fix |
|---|---|
| DPY-3015 password verifier | Install Instant Client (step 3) and rerun the wizard. |
| ORA-12170 / DPY-6005 / timeout | VPN off, or wrong host/port. |
| ORA-01017 | Wrong user or password: rerun the wizard. |
| ORA-12514 | Host/port fine, wrong service name. |
| "Actions are disabled" | Actions are off for that instance (wizard: allow changes). |
| "marked production: actions are blocked" | By design. Use a test instance. |
| "Operating unit access is not allowed" | Run the action with a responsibility that can access that OU (`responsibility=` and `org_id=`). |
| Tools missing / old behaviour in Claude | Start a new chat (and `uv sync` after updating). |
## How it works (technical)
| Side | How |
|---|---|
| Read | One guarded `SELECT`/`WITH` per call: no DML/DDL/`DBMS_*`/`UTL_*`, denied tables, read-only transaction, always rolled back, row caps, sensitive columns redacted (passwords, bank accounts, national ids). `CURRENT_SCHEMA = APPS`; MOAC context via `org_id`. |
| Act | `FND_GLOBAL.APPS_INITIALIZE` as your EBS user + a responsibility it really holds, MO init, then the API with every value as a bind. `ebs_prepare_action` builds and can dry-run (execute + rollback); `ebs_commit_action(token, confirmed=true)` runs it for real with a single-use token (15 min), committing only when the API reports success. |
| Config | `~/.ebs-query/config.yaml` (or `EBS_MCP_CONFIG`), passwords in `.env` next to it. See `config.example.yaml`. |
Tests: `uv run pytest` (no database needed).
TDQS
Scored across 18 tools
The tools partition cleanly into session/health, read-only query and metadata discovery, concurrent request inspection, workflow notification inspection, and two-phase action execution. List-vs-detail pairs (requests/status, notifications/detail) and prepare-vs-commit are explicitly distinguished, so an agent can select the right tool.
All tools share the ebs_ prefix and mostly use verb_noun forms (list_instances, run_query, describe_table, prepare_action). A few are noun-first (my_access, health_check, request_status, notification_detail), which is a minor deviation but still readable and predictable.
18 tools is slightly above the typical 3-15 sweet spot, but the server spans several EBS subdomains: instance management, SQL/metadata discovery, concurrent requests, workflow, and safe actions. Each tool has a distinct role, so the count is justified though somewhat heavy.
The surface covers instance/session setup, access/health checks, read-only querying, table/column/flexfield discovery, concurrent programs/requests, workflow notifications, and generic prepare/commit actions. Minor gaps remain, such as retrieving concurrent request log/output content, but most core query and action workflows are covered.