Mini ERP MCP Server
by Tyu0405
README.md
# Mini ERP MCP Server
A small [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server that lets an AI assistant (Claude, Devin, any MCP client) answer business questions from ERP data through **read-only tools**.
It is a demo of the pattern used to connect AI assistants to real ERP / EAM systems (Acumatica, IBM Maximo, Odoo...): the AI never gets raw database access, only a small set of well-described, read-only tools.
The data is fake and generated by `seed.py` (SQLite): customers, stock items and sales orders.
## Tools
| Tool | What it returns |
|---|---|
| `search_customers(name)` | Customers whose name contains the text |
| `get_order(order_id)` | One sales order with customer, status, lines and total |
| `low_stock_items()` | Items at or below their reorder point |
| `sales_summary(start_date, end_date)` | Revenue and order count per customer for a date range |
Resource: `erp://schema` exposes the table definitions so the AI understands the data model.
Example questions the AI can answer: *"Which items need reordering?"*, *"Who were our top customers in October?"*, *"What's in order SO0001?"*
## Design choices
- **Read-only by construction**: the database is opened with `mode=ro`, so no tool can modify data.
- **Parameterized SQL** only; tool inputs are never concatenated into queries.
- **Clear tool descriptions**: the docstring is what the model reads to decide which tool to call.
- **Errors the model can act on**: unknown IDs raise a `ToolError` with a readable message.
- Two transports: **stdio** for local clients and **Streamable HTTP** for remote clients.
## Quick start
Requires Python 3.12+ and [uv](https://docs.astral.sh/uv/).
```bash
uv venv
uv pip install "mcp==2.3.0"
python seed.py # create erp.db with demo data
python test_client.py # start the server over stdio, list tools and call each one
```
Run over HTTP (served at `http://127.0.0.1:3001/mcp`):
```bash
python server.py --http
```
## Use it from an MCP client (stdio)
```json
{
"mcpServers": {
"mini-erp": {
"command": "/path/to/mini-erp-mcp/.venv/bin/python",
"args": ["/path/to/mini-erp-mcp/server.py"]
}
}
}
```
## From demo to production
To connect a real ERP, replace the SQLite queries with calls to the ERP's REST API (for example Acumatica's contract-based REST API or Maximo's OSLC/REST API), then deploy the HTTP transport behind HTTPS with OAuth and an API user that has read-only permissions.
## License
MIT
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues