Model Coupling Platform Server
MCPサーバーの実装
名前: エステバン・ニコラス 学生ID: A20593170
I. 実装されたMCP機能
1 データリソース 1.1 HDF5 ファイル一覧
ディレクトリ構造内の模擬 HDF5 ファイルを一覧表示します
パラメータ:
path_pattern(オプションのファイルパスパターン)
2 ツール 2.1 Slurm ジョブの送信
Slurm スケジューラへのジョブの送信をシミュレートします
パラメータ:
script_path(必須)、cores(オプション、デフォルト = 1)
2.2 CPUコアレポート
システムで利用可能なCPUコアの数を報告します
パラメータは必要ありません
2.3 CSVの可視化
CSV ファイルから 2 つの列をプロットします (デフォルトは最初の 2 列)
パラメータ:
csv_path(必須)、column x、column y(どちらもオプション)
II. セットアップ手順
仮想環境を作成する
uv venv -p python3.10 .venv\Scripts\activate # Unixの場合: source .venv/bin/activate
依存関係をインストールする
UVシンクUVロック
環境設定 このプロジェクトでは、依存関係の管理にpyproject.tomlを使用しています。主な依存関係は次のとおりです。
ファストAPI
ウビコーン
ピダンティック
パンダ
Matplotlib
パイテスト
Pytest-ascyncio
MCPサーバーの実行
サーバーを起動します。cd src uvicorn server:app --reload
サーバーは次の場所で利用できます:
APIエンドポイント: http://localhost:8000/mcpヘルスチェック: http://localhost:8000/health
III テスト
すべてのテストを実行します。
pytest テスト/特定のテストファイルを実行します:
pytest テスト/test_capabilities_plot_vis.py pytest テスト/test_capabilities_hdf5.py pytest テスト/test_capabilities_cpu_core.py pytest テスト/test_capabilities_slurm.py pytest テスト/test_mcp_handler.py
リクエスト例 2.1 利用可能なリソースの一覧
curl -X POST http://localhost:8000/mcp
-H "コンテンツタイプ: application/json"
-d '{"jsonrpc":"2.0","method":"mcp/listResources","id":1}'
2.2 HDF5ファイルのリスト
curl -X POST http://localhost:8000/mcp
-H "コンテンツタイプ: application/json"
-d '{"jsonrpc":"2.0","method":"mcp/callTool","params":{"tool":"hdf5_file_listing","path_pattern":"/data/sim_run_123"},"id":2}'
2.3 Slurmジョブの送信
curl -X POST http://localhost:8000/mcp
-H "コンテンツタイプ: application/json"
-d '{"jsonrpc":"2.0","method":"mcp/callTool","params":{"tool":"slurm_job_submission","script_path":"/jobs/analysis.sh","cores":4},"id":3}'
2.4 CSV列のプロット
curl -X POST http://localhost:8000/mcp
-H "コンテンツタイプ: application/json"
-d '{"jsonrpc":"2.0","method":"mcp/callTool","params":{"tool":"plot_vis_columns","csv_path":"data.csv","列x":"時間","列y":"温度"},"id":4}'
IV 実装ノート
モック実装:
HDF5 ファイルリストはシミュレートされたディレクトリ構造を使用します - Slurm ジョブの送信はモックジョブ ID を生成します - CPU コアのレポートは os.cpu_count() を使用します
CSV 可視化:
plots_results ディレクトリにプロットを作成します - 指定されていない場合は最初の 2 列がデフォルトになります - 生成された PNG ファイルへのパスを返します
エラー処理:
適切な JSON-RPC 2.0 エラー応答 - すべてのパラメータの入力検証 - 不足しているファイル/無効なパスの適切な処理
This server cannot be deployed
Maintenance
Related MCP Connectors
QuLab MCP remote server (Streamable HTTP) for computational science and lab tools.
Remote ChromaDB vector database MCP server with streamable HTTP transport
Safety-first EVM and Bitcoin RPC tools for balances, contracts, blocks, and transactions
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA server implementing Model Coupling Protocol for HDF5 file operations, Slurm job management, hardware monitoring, and data compression.MIT
- FlicenseNot gradedqualityDmaintenanceA JSON-RPC 2.0 compliant server that enables interaction with HDF5 data files and Slurm job scheduling through standardized API endpoints.-
- FlicenseNot gradedqualityDmaintenanceA FastAPI-based server that provides tools for local file management and Databricks operations, enabling users to create/edit files locally and interact with Databricks clusters, jobs, and DLT pipelines.-
- FlicenseBqualityDmaintenanceA demonstration server that implements JSON-RPC 2.0 methods for basic arithmetic using FastAPI. It provides integration examples for the Model Context Protocol (MCP) using FastMCP to connect with Claude Desktop.1-