shap-mcp
SHAP MCP Server(shap-mcp)
SHAP(SHapley Additive exPlanations)によるモデル解釈可能性をエージェントから呼び出し可能なツールとして公開する、軽量で焦点を絞った**Model Context Protocol(MCP)**サーバーです。
AIアシスタント(Claude Desktopなど)と人間のデータサイエンティストが、共有インメモリセッションを通じてシームレスに協力できるように設計されています。
主な機能
デュアル同時トランスポート: Claude Desktop用の標準
stdioトランスポートと、Web GUIと生成された可視化を提供するポート8765上のStarletteHTTPトランスポート。統合インメモリセッション: Web GUIで分析を実行してClaudeで質問したり、Claudeに分析をトリガーさせて生成されたプロットをGUIギャラリーで即座に表示したりできます。
ユニバーサルモデルサポート:
tree: XGBoost、LightGBM、CatBoost、RandomForest、ExtraTrees用の正確なTreeExplainer。linear: ロジスティック回帰、Ridge、Lasso用の高速な閉形式LinearExplainer。deep: PyTorchニューラルネットワーク用のDeepExplainer。kernel: 自動kmeansクラスタリングを備えたモデル非依存のKernelExplainer。
出版品質の可視化: 6種類のプロットタイプ(
summary、bar、waterfall、force、dependence、heatmap)を生成・保存し、クリック可能なブラウザリンクとローカルファイルリンクを事前にフォーマットして提供します。URL&ファイル取り込み: ローカルパスまたは公開HTTP/HTTPS URLからモデルとCSVデータセットを取り込み、ストリーミングダウンロード、自動サイズ上限(
SHAP_MCP_MAX_DOWNLOAD_MB)、一時ファイルのクリーンアップを備えています。セキュリティ: HTTPエンドポイント向けに
SHAP_MCP_API_KEYによるオプションのAPIキー認証。
Related MCP server: my-mcp-server2
インストール
# Standard installation
pip install shap-mcp
# Optional extra for PyTorch DeepExplainer support
pip install shap-mcp[deep]Claude Desktopの設定
shap-mcpをclaude_desktop_config.jsonに追加します:
ユニバーサル推奨セットアップ(uvx経由)
{
"mcpServers": {
"shap-mcp": {
"command": "uvx",
"args": ["shap-mcp", "--no-ui"]
}
}
}直接Pip / Pipxセットアップ
{
"mcpServers": {
"shap-mcp": {
"command": "shap-mcp",
"args": ["--no-ui"]
}
}
}ツールリファレンス
ツール | 目的 | 主な入力 |
|
|
|
| データセット全体でSHAP値を計算 |
|
| 上位特徴量のグローバルランキング |
|
| 単一インスタンスのローカル帰属内訳 |
|
| ペアワイズ特徴量交互作用の強さ(ツリーモデル) |
|
| クリック可能なURL付きPNG可視化をレンダリング&保存 |
|
ランタイム設定
すべてのランタイム設定は環境変数で管理されます:
変数 | デフォルト | 説明 |
|
| HTTPサーバーポート(ビジー時は自動インクリメント、 |
| (未設定) | HTTP認証用のBearerトークン。未設定=localhostでは認証不要 |
|
| 生成されたプロットPNGを保存するルートディレクトリ |
|
| URLベースのモデル/データセットダウンロードに許可される最大サイズ上限 |
|
| 構造化JSONログレベル( |
Web GUI
shap-mcpで直接起動すると、サーバーは自動的にhttp://localhost:8765/ui/でWeb GUIを開きます:
設定フォーム: ローカルパスまたはURLを入力し、モデルアーキテクチャを選択して分析を実行。
リアルタイムバッジ: モデル読み込み状態、分析済み行数、アクティブなエクスプレイナータイプをライブ表示。
ダイナミックプロットギャラリー: ClaudeまたはGUIが可視化を生成すると、サムネイルが自動的に表示されます。
インスタンスエクスプレイナー: 個々の特徴量寄与度のインタラクティブなテーブル。
今後の機能とロードマップ
以下の機能が今後のリリースで計画されています:
save_analysis/load_analysis: 計算済みのSHAP値を.npzファイルにシリアライズし、再読み込み時の再計算をスキップしてチーム間で結果を共有。認証保護されたリモート取り込み: Hugging Faceトークン、プライベートS3/GCSバケット、presigned URLのサポート。
タブ型GUIとプログレッシブディスクロージャー: Web GUIをクリーンで焦点を絞ったタブに再設計し、分析の完了に応じて段階的にロックを解除。
インタラクティブな可視化:
mpld3を介したmatplotlibチャートでのパン、ズーム、ツールチップホバーサポート。プロット固有のガイド付きプロンプト: 6種類の可視化タイプそれぞれに合わせた専用のMCPプロンプト。
マルチテナントセッション分離: 共有マルチユーザーサーバーデプロイメント向けの接続分離されたセッション状態。
追加モデルフォーマット: ONNXランタイム、MLflowモデル、Weights & Biasesモデルレジストリのネイティブサポート。
公平性とバイアスの分解: サブグループごとの人口統計的パリティとスライスベースのSHAP分析。
MCP-UIインラインキャンバスとローカルドラッグ&ドロップ: MCP-UI / MCP Apps仕様によるチャット内キャンバスの直接レンダリングと、ローカルドラッグ&ドロップによるファイル取り込みで、外部ブラウザタブとクラウド添付の手間を排除。
ライセンス
MITライセンス。詳細はLICENSEを参照してください。
Maintenance
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that supports STDIO, SSE and Streamable HTTP protocols for AI model interactions.131MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server built with FastMCP that features dynamic tool loading and modular management via a dedicated tool directory. It supports both stdio and HTTP transport modes, enabling efficient development and deployment of custom MCP tools.
- AlicenseNot gradedqualityDmaintenanceModel Context Protocol server that standardizes tool discovery, execution, and context management for AI applications.MIT
- FlicenseNot gradedqualityDmaintenanceA robust, lightweight Model Context Protocol (MCP) server designed to empower your AI Agents with context-awareness, safe execution sandboxes, and dedicated thought logs.
Related MCP Connectors
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server exposing the Backtest360 engine API as tools for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Manas-maker/shap-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server