使用说明
三核MCP(兼容FastMCP云)
这是 核心FastMCP服务器 对于Tri-Tender生态系统,已更新
与Python 3.9+兼容(否 dict | None 语法,仅 Optional[...]).
它公开了一套小型的、可用于生产的工具,您的LLM (ChatGPT/Dyad/自定义代理)可以在用户上传时调用 招标相关文件。
暴露的工具
-
detect_document(file)
轻量级分类器,返回标签,如tender,pricing_schedule,scope_of_work,terms_and_conditions,evaluation_criteria,compliance_document,brand_asset或unknown. -
extract_tender_metadata(file)
提取高级招标元数据(标题、参考号、, 买方、截止日期、摘要、检测到的部分)。 -
pricing_engine(file, user_inputs)
读取XLS/XLSX/CSV定价表并返回结构化 包含列名、行和计算总数的JSON有效负载 (带有可选标记)。 -
detect_brand(file)
从上传的徽标图像推断出一个非常简单的品牌调色板 (PNG/JPG)或退回到基于文件名的启发式方法。 -
compile_output(documents, brand, pricing)
将最终投标回复汇编成 单一HTML 文档 可以转换为PDF。它使用品牌颜色并嵌入 提供解析后的定价表。
地方发展
git clone <your-repo-url>
cd tri_tender_core_mcp
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
然后在本地运行MCP服务器:
python server.py
根据您的FastMCP工具,您现在可以指向MCP主机
在该服务器上(通常 http://localhost:8000 或类似,取决于
关于如何启动它)。有关确切说明,请参阅FastMCP文档。
FastMCP云部署
- 压缩此文件夹(以便
server.py位于ZIP的根)。 - 去你的 FastMCP云 仪表板。
- 创建新 Python MCP服务器.
- 上传ZIP并部署。
- 部署后,FastMCP Cloud将为您提供:
- MCP端点URL
- API密钥
- 运行工具的测试控制台
在Tri-Tender/Dyad中使用这些值,例如:
mcpServers:
tri_tender_core_mcp:
url: "https://api.fastmcp.com/your-server-id"
apiKey: "YOUR-KEY"
GitHub使用情况
此文件夹已被构造为干净的存储库:
cd tri_tender_core_mcp
git init
git add .
git commit -m "Initial Tri-Tender core MCP (FastMCP Cloud compatible)"
git branch -M main
git remote add origin git@github.com:<you>/tri_tender_core_mcp.git
git push -u origin main
备注
- 所有类型提示都与Python 3.9兼容。
- 服务器暴露
mcp = FastMCP(...)在模块级别,即 FastMCP Cloud在加载服务器时所期望的。 - 您可以安全地扩展工具,而无需担心更新 云运行时可能不支持的语法。