用于Financial Modeling Prep API的MCP服务器。使Claude能够访问实时股票数据、财务报表、加密货币信息和市场数据。
公司 (9个工具):概况、搜索、筛选、CIK/CUSIP/ISIN查询、股票列表、新闻搜索
市场 (7个工具):实时报价、历史价格、市盈率、行业/板块表现
加密货币 (6个工具):报价、列表、日内数据、每日历史数据、新闻、搜索新闻
财务 (4个工具):损益表、资产负债表、现金流量表、增长指标
git clone https://github.com/yourusername/fmp-mcp.git
cd fmp-mcp
pip install -e .
# 设置API密钥
cp .env.example .env
# 编辑.env并添加您的FMP_API_KEY
前提条件:Python 3.10+,FMP API密钥
在Claude Desktop配置中添加:
macOS:~/Library/Application Support/Claude/claude_desktop_config.json
Windows:%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"fmp": {
"command": "python",
"args": ["-m", "fmp_mcp.server"],
"env": {
"FMP_API_KEY": "your_api_key_here"
}
}
}
}
pytest # 运行测试
black src/ tests/ # 格式化代码
ruff check src/ tests/ # 检查代码
API密钥问题:验证.env或Claude配置中的密钥
连接问题:检查claude_desktop_config.json中的路径
调试:使用MCP Inspector
npx @modelcontextprotocol/inspector python -m fmp_mcp.server
MIT