富士通数字排演模拟分析工具
正文语言类型为英语。 翻译结果:使大型语言模型(LLMs)能够通过自然语言访问富士通的数字排演API,让用户可以在数字空间中运行和分析人类及社会行为的模拟。
服务介绍
富士通 Social Digital Twin MCP 服务器
该项目将 富士通的 Social Digital Twin 和 Digital Rehearsal API 与 Model Context Protocol (MCP) 集成,允许大型语言模型(LLMs)通过自然语言访问富士通的 Digital Rehearsal API。
概述
富士通的 Social Digital Twin 不仅基于现实世界的数据在数字空间中重现人和物体的状态,还重现了整个经济和社会活动。其核心功能“Digital Rehearsal”使用户能够在实际实施措施之前,在数字空间中模拟人类和社会行为,从而提前验证其效果和影响。
该项目使用 MCP 来连接 LLMs 和 Digital Rehearsal API,使用户能够使用自然语言运行模拟并分析结果。
主要功能
- 检索和显示模拟列表
- 启动模拟
- 检索和分析模拟结果
- 管理模拟数据
- 分析交通模拟
- 比较场景
- 从自然语言生成模拟配置
先决条件
- Python 3.13 或更高版本
- 访问富士通 API 网关(API 密钥)
- 兼容 MCP 的 LLM 客户端(例如 Claude Desktop)
安装
通过 Smithery 安装
要通过 Smithery 自动为 Claude Desktop 安装富士通 Social Digital Twin 服务器:
npx -y @smithery/cli install @3a3/fujitsu-sdt-mcp --client claude
1. 克隆仓库
git clone https://github.com/3a3/fujitsu-sdt-mcp.git
cd fujitsu-sdt-mcp
2. 设置环境
使用 uv(推荐):
首先,安装 uv:
# Install uv using pip
pip install uv
# Or using curl (Linux/macOS)
curl -sSf https://astral.sh/uv/install.sh | sh
然后,使用 uv 设置您的环境:
# Create virtual environment
uv venv
# Activate virtual environment
# Windows:
.venv\Scripts\activate
# Unix/MacOS:
source .venv/bin/activate
# Install dependencies
uv pip install -r requirements.txt
或者,您可以使用提供的设置脚本:
# Make the script executable
chmod +x setup.sh
# Run setup
./setup.sh
3. 设置环境变量
# Windows:
set FUJITSU_API_BASE_URL=https://apigateway.research.global.fujitsu.com/sdtp
set FUJITSU_API_KEY=your_api_key_here
# Unix/MacOS:
export FUJITSU_API_BASE_URL=https://apigateway.research.global.fujitsu.com/sdtp
export FUJITSU_API_KEY=your_api_key_here
或者,您也可以创建一个包含以下设置的 .env 文件:
FUJITSU_API_BASE_URL=https://apigateway.research.global.fujitsu.com/sdtp
FUJITSU_API_KEY=your_api_key_here
使用
启动 MCP 服务器
python -m fujitsu_sdt_mcp
服务器通过标准 I/O 与 MCP 客户端通信。
使用交互式客户端
还提供了一个简单的客户端,可以直接与 MCP 服务器交互:
python client.py
启动客户端时,将显示可用资源和工具的列表,您可以从命令行调用它们。
与 Claude Desktop 配合使用
要与兼容 MCP 的 LLM 客户端(如 Claude Desktop)一起使用服务器:
- 打开 Claude Desktop
- 转到设置 > 开发者设置 > 编辑配置文件
- 添加以下设置:
"command": "uvx",
"args": [
"fujitsu-sdt-mcp"
],
"env": {
"FUJITSU_API_BASE_URL": "https://apigateway.research.global.fujitsu.com/sdtp",
"FUJITSU_API_KEY": "your_api_key_here"
}
- 重启 Claude Desktop
资源和工具
资源
resource://digital_rehearsal_overview: 数字演练技术概览resource://simulation_metrics_explanation: 模拟指标说明resource://scenario_examples: 场景示例
工具
list_simulations: 获取模拟列表start_simulation: 开始模拟get_simulation_result: 获取模拟结果get_metrics: 获取模拟指标list_simdata: 获取模拟数据列表get_simdata: 获取模拟数据analyze_traffic_simulation: 分析交通模拟compare_scenarios: 比较场景create_natural_language_simulation_config: 从自然语言生成模拟设置
使用示例
获取模拟列表
tool list_simulations
开始模拟
tool start_simulation {"simdataId": "your_simdata_id"}
分析交通模拟
tool analyze_traffic_simulation {"simulationId": "your_simulation_id", "region": "Tokyo", "timeRange": "morning rush hour", "scenario": "traffic optimization"}
从自然语言生成模拟设置
tool create_natural_language_simulation_config {"description": "I want to run a traffic optimization simulation during morning rush hour in Tokyo"}
示例 LLM 交互
User: I want to run a traffic simulation during morning rush hour in Tokyo
Claude: I can help you run a traffic simulation for Tokyo's morning rush hour. Here's how we can set it up.
First, let's generate simulation settings from your natural language description:
[Tool execution: create_natural_language_simulation_config]
Generated settings:
{
"simulationType": "traffic",
"parameters": {
"region": "Tokyo",
"timeRange": "morning_rush"
},
"name": "traffic_20250416_123045"
}
Next, let's check available simulation data:
[Tool execution: list_simdata]
From this data, I can start a simulation using Tokyo's morning traffic data.
I've selected the appropriate simulation data ID and will start the simulation:
[Tool execution: start_simulation]
The simulation has started. The simulation ID is "sim_12345".
It will take some time for the results to be available. Once complete, I'll analyze them.
(After simulation completes)
Let's analyze the simulation results:
[Tool execution: analyze_traffic_simulation]
Analysis results:
- CO2 emissions: 1,250kg
- Average travel time: 42 minutes
- Total traffic volume: 15,700 vehicles
From these results, I can see that the Shibuya-Shinjuku route experiences particularly severe congestion.
Here are some potential improvements:
1. Optimize traffic signal control
2. Implement one-way traffic on certain roads during specific times
3. Increase public transportation frequency
Would you like to see a more detailed analysis?
贡献
请通过 GitHub Issues 报告错误或提出功能请求。欢迎提交拉取请求。
许可证
本项目在 MIT 许可证下发布。详情见 LICENSE 文件。
致谢
- 富士通公司 - 社会数字孪生技术的开发
- Model Context Protocol (MCP) - 实现与 LLM 的无缝集成