.env.example 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # 如果 auth 与 tools 在同一个域名,可只保留 FMS_API_BASE
  2. # FMS_API_BASE=http://chenjiacheng.base.dahuo.fudingri.com
  3. # 当前本地开发推荐:同一个 IP,不同域名由 hosts + Web 服务器 Host 分发到不同项目。
  4. # base 项目:负责 auth_code / mcp_token 授权换票
  5. FMS_AUTH_BASE=http://chenjiacheng.base.dahuo.fudingri.com
  6. # fmsoperate 项目:负责 query_order 等工具接口
  7. FMS_TOOLS_BASE=http://chenjiacheng.fmsoperate.dahuo.fudingri.com
  8. FMS_CLIENT_TYPE=workbuddy
  9. FMS_TIMEOUT_SECONDS=10
  10. FMS_MAX_IN_FLIGHT_PER_TOOL=5
  11. FMS_REFRESH_SKEW_SECONDS=120
  12. FMS_LOG_LEVEL=info
  13. # 推荐:共享 app.py 场景下使用 Redis 保存 token,不要把 token 文件放到 \192.168.1.241\mcp\ 共享目录。
  14. FMS_TOKEN_STORE=redis
  15. FMS_REDIS_HOST=192.168.1.241
  16. FMS_REDIS_PORT=6379
  17. FMS_REDIS_DB=20
  18. FMS_REDIS_PASSWORD=
  19. FMS_REDIS_PREFIX=fms:mcp:workbuddy:
  20. # 通常不要在共享 .env 里写死 FMS_SESSION_KEY。
  21. # Gateway 会自动用员工本机 COMPUTERNAME/USERNAME 生成隔离 key。
  22. # 只有在单机排障时才手动指定,例如:
  23. # FMS_SESSION_KEY=pc-name:windows-user
  24. # 如果临时退回文件存储,再改为:
  25. # FMS_TOKEN_STORE=file
  26. # FMS_TOKEN_STORE_PATH=C:/fms-mcp/.mcp_token.json
  27. # Workbuddy 启动脚本路径使用网络 UNC:\\192.168.1.241\mcp\app.py
  28. # 不要使用开发机映射盘路径 Y:\mcp\app.py。
  29. # ============================================================================
  30. # Public Gateway mode (for production deployment behind HTTPS)
  31. # ============================================================================
  32. # Keep Redis private and do not store real passwords in this example file.
  33. # Gateway mode: 'local' for single-user desktop, 'public' for multi-tenant server
  34. FMS_GATEWAY_MODE=public
  35. # Public gateway base URL (used for client configuration)
  36. FMS_GATEWAY_PUBLIC_BASE=https://mcp.example.com
  37. # Gateway session TTL in seconds (default: 2592000 = 30 days)
  38. FMS_GATEWAY_SESSION_TTL_SECONDS=2592000
  39. # Redis prefix for public mode (must differ from local mode to avoid conflicts)
  40. FMS_REDIS_PREFIX=fms:mcp:gateway:
  41. # tools/call rate limiting (default: 60 requests/minute per device session and tool)
  42. # initialize and tools/list are not rate limited
  43. # MCP diagnosis events are sent asynchronously to support. Keep disabled until
  44. # the support collector and matching HMAC key are deployed.
  45. MCP_DIAGNOSIS_ENABLED=false
  46. MCP_DIAGNOSIS_URL=https://support.example.com/internal/mcp-diagnostics/events
  47. MCP_DIAGNOSIS_KEY_ID=gateway-current
  48. MCP_DIAGNOSIS_SECRET=
  49. MCP_DIAGNOSIS_ALLOW_INSECURE_HTTP=false
  50. MCP_DIAGNOSIS_QUEUE_SIZE=1000
  51. MCP_DIAGNOSIS_BATCH_SIZE=100
  52. MCP_DIAGNOSIS_TIMEOUT_SECONDS=0.5
  53. MCP_DIAGNOSIS_INITIAL_BACKOFF_SECONDS=0.25
  54. MCP_DIAGNOSIS_MAX_BACKOFF_SECONDS=5.0