Skip to main content
Glama
fichapao-mcp-server

fichapao-mcp-server

by kratos4ai

FichaPao MCP 服务器

用于 FichaPao AI 代理通过 Postgres 控制面包店技术表的 HTTP MCP 服务器。

该应用程序的目标是为代理提供安全工具,而不暴露原始 SQL。

架构

OpenWebUI
  -> Agente FichaPao AI
  -> MCP HTTP /mcp
  -> fichapao-mcp-server
  -> Postgres

Related MCP server: mcp-enterprise-starter

MCP 工具

  • search_recipe: 按名称搜索配方。

  • get_recipe: 通过 recipe_id、version_id 或名称查询配方。

  • create_recipe_draft: 创建 0.1 版本的草稿配方。

  • update_draft: 更新草稿或修订版本。

  • create_new_version: 创建新的草稿版本。

  • approve_version: 如果没有阻塞性待办事项,则批准版本。

  • list_pending_items: 列出待办事项。

  • register_production_test: 记录生产测试。

  • compare_versions: 比较两个版本。

  • archive_recipe: 归档配方。

  • get_database_stats: 数据库摘要。

已实现的规则

  • 新配方始终以 草稿 形式进入。

  • 初始版本为 0.1。

  • 已批准的配方不能直接编辑。

  • 对已批准配方的更改必须成为新的草稿版本。

  • 当存在关键待办事项时,批准将被阻止。

  • 0.x 版本的首次批准将变为 1.0。

  • 数据库区分:

    • current_version_id: 最新/正在处理的版本。

    • active_version_id: 生产中已批准的版本。

本地运行

cp .env.example .env
docker compose up --build

健康检查:

curl http://localhost:3001/health

MCP 端点:

http://localhost:3001/mcp

在 docker-compose.yml 中,本地端口映射为 3001:3000,以避免与已使用 3000 端口的常见应用程序冲突。

如果已填写 MCP_API_KEY,请发送:

Authorization: Bearer sua-chave

在 EasyPanel 上部署

创建两个服务:

  1. Postgres

  2. 指向此存储库的 Docker 应用程序

应用程序变量:

NODE_ENV=production
PORT=3000
DATABASE_URL=postgresql://usuario:senha@host:5432/fichapao
AUTO_MIGRATE=true
MCP_API_KEY=troque-por-uma-chave-forte
CORS_ORIGIN=*

发布后,进行验证:

https://seu-dominio/health

在 OpenWebUI 中:

Admin Settings -> External Tools -> Add MCP Server
URL: https://seu-dominio/mcp
Auth: Bearer token com o valor de MCP_API_KEY

数据库

主要迁移:

migrations/001_init.sql

表:

  • recipes

  • recipe_versions

  • pending_items

  • production_tests

  • change_history

开发

npm install
npm run typecheck
npm run build
npm run dev

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