富士通ソーシャルデジタルツインMCPサーバ

このプロジェクトでは、富士通のソーシャルデジタルツインとデジタルリハーサルAPIをモデルコンテキストプロトコル(MCP)と統合し、大規模言語モデル(LLM)が自然言語を通じて富士通のデジタルリハーサルAPIにアクセスできるようにします。
概要
富士通のソーシャルデジタルツインは、実世界のデータに基づき、デジタル空間上の人やモノの状態だけでなく、経済・社会活動全体を再現します。その中核機能である「デジタルリハーサル」は、実世界での施策実施前に、デジタル空間上で人や社会の行動をシミュレーションし、その効果や影響を事前に検証することを可能にします。
このプロジェクトでは、MCP を使用して LLM と Digital Rehearsal API 間のギャップを埋め、ユーザーが自然言語を使用してシミュレーションを実行し、結果を分析できるようにします。
Related MCP server: Lark MCP Server
主な特徴
シミュレーションリストを取得して表示する
シミュレーションを開始する
シミュレーション結果を取得して分析する
シミュレーションデータの管理
交通シミュレーションを分析する
シナリオを比較する
自然言語からシミュレーション構成を生成する
前提条件
インストール
Smithery経由でインストール
Smithery経由で Claude Desktop 用の Fujitsu Social Digital Twin Server を自動的にインストールするには:
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 サーバーと直接対話するためのシンプルなクライアントも提供されています。
クライアントを起動すると、利用可能なリソースとツールのリストが表示され、コマンドラインから呼び出すことができます。
Claude Desktopでのセットアップ
Claude Desktop などの MCP 互換 LLM クライアントでサーバーを使用するには:
クロードデスクトップを開く
設定 > 開発者向け設定 > 設定ファイルの編集に移動します
次の設定を追加します。
"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デスクトップを再起動します
リソースとツール
リソース
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 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ファイルをご覧ください。
謝辞