Skip to main content
Glama

AURON MCP — v1(只读、多租户、精简生产)

AI 主机/代理与 AURON Suite 后端(api_peluqueria)之间的 MCP 网关。身份、租户和 RBAC 均通过真实的 AURON REST API 解析——模型无法操控它们。

这是什么

  • 只读:每个工具都是对已验证 AURON 端点的 GET 请求。不暴露任何创建/更新/删除操作。

  • 真实身份:通过 GET /api/auth/verify/ + GET /api/tenants/current/ 解析已认证的 AURON 主体(Bearer 令牌或 /api/auth/login/ 颁发的 httpOnly 认证 Cookie)。

  • 失败关闭的 RBAC:角色 → 权限映射(policy/roles.py)源自 AURON 的规范角色。未知角色获得零权限;AURON 自身的授权(403)仍会覆盖该表。

  • 租户委托给 AURON:适配器绝不发送 tenant_id 或 X-Auron-Tenant 标头。上游通过其 TenantMiddleware 从会话中推导租户,与 AURON 自己的客户端完全一致。

  • 错误边界:任何内部信息(消息、令牌、上游主体、堆栈跟踪)都不会到达模型——参见 errors/normalize_error。

  • 每次调用审计:每次工具调用(成功或拒绝)都会写入仅追加的 JSONL 审计日志和标准输出。

  • 速率限制:每次调用前,在策略检查之前,会检查每个(用户、工具)的滑动窗口限制器。

Related MCP server: DataGate

工具

工具

端点

auron_sales_summary

GET /api/pos/summary/daily/

auron_appointments_today

GET /api/appointments/appointments/today/

auron_clients_search(query, limit)

GET /api/clients/clients/?search=&limit=(最大 100)

auron_inventory_alerts

GET /api/inventory/alerts/low-stock/

auron_employee_performance(employee_id)

GET /api/reports/employees/

auron_services_list

GET /api/services/services/

auron_employees_list

GET /api/employees/employees/

auron_branches_list

GET /api/settings/branches/

auron_products_list

GET /api/inventory/products/

auron_dashboard_stats

GET /api/pos/dashboard/stats/

auron_daily_review

复合:销售 + 预约 + 库存 + 员工绩效

auron_inventory_review

复合:产品 + 低库存预警

auron_revenue_analysis

复合:仪表盘统计 + 今日销售额

auron_employee_performance_review

复合:绩效 + 员工名册

auron_system_health

GET /api/healthz/

此外还有一个 auron://context/current 资源和一个 daily_business_review 提示。

快速开始

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

将 .env.example 复制为 .env 并设置真实值:

AURON_ADAPTER=http
AURON_API_BASE_URL=http://localhost:8000

认证一次(这将为网关存储 AURON 的 httpOnly 认证 Cookie):

auron-manage login --email caja@salon.test --subdomain salon-uno
auron-manage status        # verify the resolved identity/role

运行服务器:

auron-mcp          # stdio (default; what local MCP hosts expect)

改为通过 Streamable HTTP(规范 2026-07-28)运行:

AURON_MCP_TRANSPORT=streamable-http \
AURON_MCP_HTTP_HOST=127.0.0.1 \
AURON_MCP_HTTP_PORT=8765 \
auron-mcp          # serves the MCP endpoint at http://127.0.0.1:8765/mcp

HTTP 部署会验证 MCP-Protocol-Version / Mcp-Method / Mcp-Name 请求标头与 JSON-RPC 主体是否匹配(400 + -32020 HeaderMismatch),拒绝非 POST 请求(405),并启用 DNS 重新绑定保护。有关完整端点契约,请参见 docs/CONNECTING.md;有关 SDK 传输之上的规范层,请参见 src/auron_mcp/http_app.py。

使用 AURON_ADAPTER=mock(默认值)时,服务器在离线状态下使用固定的开发身份(u-mock-1 / t-mock-1 / CLIENT_ADMIN)进行开发和测试。

测试

pytest -q          # 78 tests: policy, rbac, audit, ratelimit, adapters,
                   # identity provider, tools, MCP stdio handshake, and the
                   # 2026-07-28 Streamable HTTP header rules
ruff check src tests

布局

src/auron_mcp/
  auth/          identity.py (AuronIdentity) + provider.py (resolve via AURON)
  policy/        roles.py (RBAC mirror) + engine.py (PolicyEngine, fail-closed)
  audit/         AuditLogger (JSONL + stdout)
  adapters/      base.py (interface) / http.py (httpx2 + cookies) / mock.py
  tools/         AuronTools (policy + rate-limit + audit around every read)
  errors/        normalize_error (model-safe error boundary)
  server.py      MCPServer wiring (stdio / streamable-http / sse)
  http_app.py    Streamable HTTP deployment: 2026-07-28 header validation,
                 DNS-rebinding settings, optional bearer token
  manage.py      operator CLI: login / status / clean

安全原则

  1. 永远不要信任 LLM 提供的租户 ID 作为授权边界。

  2. 从已认证的身份和服务器端策略解析租户/范围。

  3. 工具是只读的;副作用在 v1 中故意不在范围内。

  4. 每个敏感操作都是可审计的——包括被拒绝的尝试。

  5. MCP 调用稳定的 AURON 应用程序 API,而不是原始 SQL。

  6. 永远不要向模型暴露密钥、JWT、上游响应主体或堆栈跟踪。

  7. 工具调用有成本——对其进行速率限制。

参见 docs/mcp-integration-audit.md(对真实 AURON 后端的审计)、docs/ARCHITECTURE.md、docs/CONNECTING.md 和 docs/ROADMAP.md。

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      A secure, read-only MCP server that enables AI assistants to inspect transactions, vendor performance, wallet balances, and analytics through validated REST API calls.
      19
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides a secure, policy-driven read-only gateway that exposes multiple databases to AI tools via MCP, with governed select, search, and aggregate operations and no free-form SQL.
      Apache 2.0
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP-compatible AI clients to securely read data from customers' ERPNext/Frappe sites through a multi-tenant OAuth-protected gateway, with tools for listing, searching, counting, retrieving, and reporting on documents.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants and LLM agents to query operational databases through a read-only MCP gateway with table whitelisting, automatic row limits, sensitive-data masking, and audit logging.
      1
      MIT