mcp-ピオジド
モデルコンテキストプロトコル(MCP)用のPyodideサーバー実装。このサーバーにより、大規模言語モデル(LLM)がMCPインターフェースを介してPythonコードを実行できるようになります。
特徴
Pyodide を使用した LLM 向け Python コード実行機能
MCP準拠のサーバー実装
stdio と SSE トランスポートモードの両方をサポート
TypeScriptで書かれた堅牢な実装
コマンドラインツールとして利用可能
インストール
使用法
サーバーとして
コマンドラインツールとして
stdio モードで起動します (デフォルト):
SSE モードで起動します。
SSEモード
SSE モードで実行している場合、サーバーは次のエンドポイントを提供します。
SSE 接続:
http://localhost:3020/sse
メッセージハンドラー:
http://localhost:3020/messages
クライアント接続の例:
プロジェクト構造
依存関係
@modelcontextprotocol/sdk
: MCP SDK (^1.4.0)pyodide
: Python ランタイム環境 (^0.27.1)arktype
: 型検証ライブラリ (^2.0.1)express
: SSE サポート用の Web フレームワークcors
: SSE サポート用の CORS ミドルウェア
発達
要件
Node.js 18以上
npm 9以上
設定
スクリプト
npm run build
: TypeScript をコンパイルし、実行権限を設定するnpm start
: stdioモードでサーバーを実行するnpm run start:sse
: SSEモードでサーバーを実行する
環境変数
PYODIDE_CACHE_DIR
: Pyodide キャッシュのディレクトリ (デフォルト: "./cache")PYODIDE_DATA_DIR
: マウントされたデータのディレクトリ(デフォルト: "./data")PORT
: SSEサーバーのポート(デフォルト: 3020)
ライセンス
マサチューセッツ工科大学
貢献
リポジトリをフォークする
機能ブランチを作成する (
git checkout -b feature/amazing-feature
)変更をコミットします (
git commit -am 'Add some amazing feature'
)ブランチにプッシュする (
git push origin feature/amazing-feature
)プルリクエストを作成する
重要な注意事項
このプロジェクトは開発中であり、APIは変更される可能性があります。
実稼働で使用する前に徹底的にテストする
セキュリティ上の理由から、信頼できないコードを実行するときは注意してください
SSEモードを使用する場合は、必要に応じて適切なCORS構成を確認してください。
サポート
問題や質問については、問題追跡システムをご利用ください。
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
モデル コンテキスト プロトコル (MCP) を介して大規模言語モデル (LLM) によって Python コードを実行するための Pyodide サーバー。
Related Resources
Related MCP Servers
- -securityAlicense-qualityA Python-based MCP server that allows Claude and other LLMs to execute arbitrary Python code directly through your desktop Claude app, enabling data scientists to connect LLMs to APIs and executable code.Last updated -26MIT License
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server implementation for the Didlogic API. This server allows Large Language Models (LLMs) to interact with Didlogic services through a standardized interface.Last updated -221MIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that allows LLMs to interact with Python environments, execute code, and manage files within a specified working directory.Last updated -974
- -securityAlicense-qualityA Python implementation of the Model Context Protocol that allows applications to provide standardized context for LLMs, enabling creation of servers that expose data and functionality to LLM applications through resources, tools, and prompts.Last updated -MIT License