CFNEWS MCP服务器
CFNews API的MCP(模型上下文协议)服务器,用于查询公司金融、投资基金、公司和法国市场参与者的运营数据库。
🚀 安装
先决条件
- Python 3.10+
- 有效的CFNews API密钥
安装依赖项
pip install -r requirements.txt配置
- 复制文件
.env.example朝向.env:
cp .env.example .env- 编辑
.env并添加您的CFNews API密钥:
CFNEWS_API_KEY=votre_cle_api_ici🎯 使用
本地模式(stdio)
要将本地MCP服务器与Claude Desktop一起使用:
python server.py配置克劳德桌面
添加到配置文件Claude Desktop(claude_desktop_config.json):
{
"mcpServers": {
"cfnews": {
"command": "python",
"args": ["/chemin/vers/cfnews-mcp/server.py"],
"env": {
"CFNEWS_API_KEY": "votre_cle_api"
}
}
}
}服务器部署(用于灰尘)
选项1:使用FastMCP服务器部署
# Lancer le serveur HTTP
fastmcp run server.py --port 8000 --host 0.0.0.0选项2:使用Uvicorn部署
创建文件 run_server.py:
import uvicorn
from server import mcp
if __name__ == "__main__":
uvicorn.run(
mcp.get_asgi_app(),
host="0.0.0.0",
port=8000
)然后启动:
python run_server.py选项3:Docker部署
创建一个 Dockerfile:
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
ENV CFNEWS_API_KEY=""
ENV PORT=8000
EXPOSE 8000
CMD ["python", "run_server.py"]构建并运行:
docker build -t cfnews-mcp .
docker run -p 8000:8000 -e CFNEWS_API_KEY=votre_cle cfnews-mcp配置倒尘
在Dust中,添加带有部署服务器URL的MCP服务器:
http://votre-serveur:8000或者,如果使用隧道(例如ngrok)在本地部署:
https://votre-tunnel.ngrok.io🛠️ 可用工具
MCP服务器公开以下工具:
1. search_operations
研究运营(杠杆收购、并购、融资等)
设置 :
company_name:目标公司名称operation_types:交易类型(杠杆收购、发展资本、公司并购等)sectors:活动领域date_from,date_to:周期(格式DD/MM/YYYY)amount_min,amount_max:每月四欧元
示例:
search_operations(
operation_types=["LBO", "Capital Développement"],
sectors=["Biotechnologies"],
date_from="01/01/2024",
date_to="31/12/2024"
)2. search_funds
搜索投资工具(基金)
设置 :
fund_name:基金名称management_company:管理公司fund_types:类型(FCPR、FPCI等)segments:细分市场(杠杆收购、风险投资等)status:状态(已关闭、正在解除等)
示例:
search_funds(
segments=["Capital innovation / VC"],
status=["En cours de levée"],
amount_raised_min=50
)3. search_actors
寻找公司财务参与者
设置 :
actor_name:演员姓名actor_types:类型(投资基金、律师、银行家等)nationalities:代码付费(法国、美国、英国等)regions:法国地区is_tech_fund:过滤技术基金
示例:
search_actors(
actor_types=["Fonds d'investissement"],
regions=["Île-de-France"],
is_tech_fund=True
)4. search_companies
搜索公司
设置 :
company_name:公司名称company_types:类型(家族、杠杆收购等)sectors:活动领域revenue_min,revenue_max:加拿大货币基金组织is_tech:过滤技术公司
示例:
search_companies(
sectors=["Logiciel et services informatiques"],
revenue_min=10,
revenue_max=100,
is_tech=True
)5. search_people
寻找个性
设置 :
name:姓或名organization:组织精算师titles:标题/职能executives_only:高管过滤器with_email:电子邮件过滤器
示例:
search_people(
organization_types=["Fonds"],
executives_only=True,
regions=["Île-de-France"]
)6. search_news
新闻搜索CFNews
设置 :
title:标题中的单词themes:主题(杠杆收购、并购等)keywords:关键词date_from,date_to:出版期
示例:
search_news(
themes=["LBO", "Levée de Fonds"],
keywords=["fintech"],
date_from="2024-01-01"
)7. get_fund_portfolio
恢复基金的投资组合
设置 :
fund_id:基金IDportfolio_type:“当前”或“退出”
示例:
get_fund_portfolio(
fund_id=1625,
portfolio_type="current"
)📊 操作类型
接受的值 operation_types:
LBO(271)Capital Développement(273)Capital Innovation(274)M&A Corporate(272)Financement(29093)Immobilier(275)Infrastructure(199547)Restructuration(14447)Bourse(25006)
🏢 活动领域
主要部门:
Biotechnologies(124)Corporate Finance(19486)Services Financiers(305)Logiciel et services informatiques(297)Internet & ecommerce, eservices(296)Santé, beauté et services associés(302)
🌍 法国地区
区域代码:
Île-de-France(132336)Auvergne-Rhône-Alpes(132360)Occitanie(132354)Grand Est(132334)Hauts-de-France(132355)
🔒 安全
- 新委员会 从不 你的文件
.env使用API密钥 - 在生产中使用API密钥的环境变量
- 使用反向代理(nginx、traefik)限制对服务器的访问
- 为生产部署启用HTTPS
📝 日志与监控
要激活详细日志:
export FASTMCP_LOG_LEVEL=DEBUG
python server.py🐛 故障排除
错误“CFNEWS-API-KEY未定义”
- 检查文件是否
.env存在并包含密钥 - 如果在生产中,请检查服务器环境变量
API连接错误
- 检查API密钥的有效性
- 检查您的internet连接
- 查看您的CFNews订阅限制
请求超时
- 增加超时时间
cfnews_client.py(参数)timeout) - 减少结果的数量
max_results
📚 文档API CFNEWS
有关CFNews API的更多详细信息,请参阅 Documentation_API_CFNEWS_V1_3_9.txt.
🤝 支持
对于任何问题或问题:
- 查看FastMCP文档:https://gofastmcp.com
- 查看CFNews文档
- 在存储库中打开问题
📄 许可证
本项目按原样提供。确保您遵守CFNews API的使用条款。
