Skip to main content
Glama

Model Coupling Platform Server

by EstebanIIT

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 xcolumn y (どちらもオプション)

II. セットアップ手順

  1. 仮想環境を作成する

uv venv -p python3.10 .venv\Scripts\activate # Unixの場合: source .venv/bin/activate

  1. 依存関係をインストールする

UVシンクUVロック

  1. 環境設定 このプロジェクトでは、依存関係の管理にpyproject.tomlを使用しています。主な依存関係は次のとおりです。

ファストAPI

ウビコーン

ピダンティック

パンダ

Matplotlib

パイテスト

Pytest-ascyncio

  1. MCPサーバーの実行

サーバーを起動します。cd src uvicorn server --reload

サーバーは次の場所で利用できます:

APIエンドポイント: http://localhost:8000/mcpヘルスチェック: http://localhost:8000/health

III テスト

  1. すべてのテストを実行します。

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

  1. リクエスト例 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 実装ノート

  1. モック実装:
  • HDF5 ファイルリストはシミュレートされたディレクトリ構造を使用します - Slurm ジョブの送信はモックジョブ ID を生成します - CPU コアのレポートは os.cpu_count() を使用します
  1. CSV 可視化:
  • plots_results ディレクトリにプロットを作成します - 指定されていない場合は最初の 2 列がデフォルトになります - 生成された PNG ファイルへのパスを返します
  1. エラー処理:
  • 適切な JSON-RPC 2.0 エラー応答 - すべてのパラメータの入力検証 - 不足しているファイル/無効なパスの適切な処理

GITHUB: https://github.com/EstebanIIT/cs550\_MCP.git

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

FastAPI ベースの JSON-RPC 2.0 サーバー実装。これにより、ユーザーは HDF5 ファイルの操作、Slurm ジョブの送信、CPU 情報の取得、標準化された API エンドポイントを介した CSV データの視覚化が可能になります。

Related MCP Servers

  • -
    security
    A
    license
    -
    quality
    A server implementing Model Coupling Protocol for HDF5 file operations, Slurm job management, hardware monitoring, and data compression.
    Last updated -
    Python
    MIT License
  • -
    security
    F
    license
    -
    quality
    A JSON-RPC 2.0 compliant server that enables interaction with HDF5 data files and Slurm job scheduling through standardized API endpoints.
    Last updated -
    Python
  • -
    security
    A
    license
    -
    quality
    A lightweight FastAPI server that allows remote execution of shell commands on Windows, with real-time output streaming and security features like API key authentication and rate limiting.
    Last updated -
    1
    Python
    MIT License

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EstebanIIT/CS550_MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server