Add Hermes API and MCP access

This commit is contained in:
2026-05-31 21:35:50 +01:00
parent 865c4a78ea
commit 3e2501721a
10 changed files with 653 additions and 1 deletions

View File

@@ -0,0 +1,50 @@
# OptiqueStock Hermes MCP
This MCP server gives a Hermes agent safe, token-scoped access to OptiqueStock.
## Environment
Set the same key on the Next.js app and the MCP server:
```bash
HERMES_API_KEY=change-me
OPTICZ_API_BASE=http://192.168.1.30:3000
```
In local development only, the fallback key is:
```text
hermes-demo-key-change-me
```
## Run
```bash
node mini-services/hermes-mcp/server.mjs
```
## MCP Tools
- `opticz_status`
- `opticz_summary`
- `opticz_search_clients`
- `opticz_search_products`
- `opticz_create_client`
- `opticz_create_repair_sale`
## Direct REST API
All endpoints require:
```http
Authorization: Bearer <HERMES_API_KEY>
```
Available endpoints:
- `GET /api/hermes/status`
- `GET /api/hermes/summary`
- `GET /api/hermes/clients?q=amina`
- `POST /api/hermes/clients`
- `GET /api/hermes/products?q=monture`
- `POST /api/hermes/sales/repair`