EdgeZ MCP
Officialby edgez-ai
README.md
# Accounting: ERPNext + EdgeZ MCP
Run ERPNext locally from official **prebuilt Docker images**, with an independent Python MCP adapter calling its REST API. ERPNext owns the ledger, invoices, accounting rules and database. This repository owns deployment configuration and the adapter.
## First step: start ERPNext
Requires Docker Engine/Desktop with Compose v2. No ERPNext source build is needed.
```sh
python3 scripts/init-env.py
docker compose --profile setup pull
docker compose up -d
docker compose --profile setup run --rm create-site
```
Open http://localhost:8080. Log in as **Administrator** using `ERP_ADMIN_PASSWORD` from your private `.env` file. Complete ERPNext's setup wizard and create your company. Site initialization may take several minutes. Re-running initialization skips an existing site; a failed/partial initialization needs inspection before retrying. Normal restarts only need `docker compose up -d`.
The stack pins `frappe/erpnext:v16.62.0` and includes MariaDB, Redis, workers, scheduler, WebSocket service, backend and frontend. Only frontend port 8080 is published, bound to loopback. Named volumes persist sites, files, database, queue data and logs. `docker compose down` preserves data; `down --volumes` deletes it.
## GitHub Actions
[Validate ERPNext and MCP](https://github.com/edgez-ai/accounting/actions/workflows/test.yml) runs on pushes, pull requests and manual dispatch. It tests and builds the adapter, validates Compose, pulls the upstream ERPNext image, creates a disposable site, and verifies installation and Administrator login. Temporary passwords are generated inside the runner; databases and secrets are removed after the job. CI verifies a temporary deployment, not your local host or public edge route.
## Optional MCP adapter
1. In ERPNext create a dedicated API user with read access to Account, Sales Invoice, Purchase Invoice and Journal Entry. Restrict its company access with ERPNext User Permissions; avoid using Administrator.
2. Generate that user's API key and secret. Set `ERPNEXT_API_KEY`, `ERPNEXT_API_SECRET`, and `ERPNEXT_COMPANY` (the exact company name) privately in `.env`.
3. Start the optional adapter:
```sh
docker compose -f compose.yaml -f compose.mcp.yaml up --build -d
```
ERPNext continues to use the prebuilt image; only our small independent adapter is built. MCP is available at http://localhost:8090/mcp with the generated `ACCOUNTING_DEV_TOKEN` as a bearer token. Tools are `list_accounts`, `list_sales_invoices`, `list_purchase_invoices`, and `list_journal_entries`. Each supports `limit` (1–200) and `offset`. All are read-only, scoped to the configured company. ERPNext amounts use major currency units; journal totals use the company's currency. Draft status is included and must not be interpreted as a posted transaction.
The adapter uses one service identity and company, shared among permitted MCP users. Its allowlist is not a multi-tenant authorization system. `/healthz` reports process/configuration status; it does not prove upstream ERPNext connectivity.
For native adapter development:
```sh
uv sync --frozen
set -a
. ./.env
set +a
uv run uvicorn accounting.app:create_app --factory --host 127.0.0.1 --port 8090 --reload
uv run pytest
uv run ruff check .
```
## Edge and ChatGPT
```text
Browser → existing edge named domain → peer TCP forward → ERPNext:8080
ChatGPT → separate edge named domain → peer TCP forward → MCP adapter:8090
→ private ERPNext REST API
```
See [deployment](docs/deployment.md) for routing and OAuth. Public exposure is not automatically provisioned. The initial local Docker installation is not production hardening. Back up the ERPNext database and site files using Bench's supported backup tooling, copy backups off-device and verify restoration before storing real records.
## Licenses
Our independently written adapter is MIT. ERPNext is GPLv3 and is run as a separate, unmodified upstream image. Compose is adapted from the MIT-licensed [frappe_docker example](https://github.com/frappe/frappe_docker/blob/main/pwd.yml); attribution is in [third_party/frappe-docker-LICENSE](third_party/frappe-docker-LICENSE). Bundled image components retain their own licenses. This repository does not relicense ERPNext.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues