VOOZH about

URL: https://glama.ai/mcp/servers/yonaka15/mcp-pyodide?locale=ja-JP

⇱ mcp-ピオジド by yonaka15 | Glama


mcp-ピオジド

モデルコンテキストプロトコル(MCP)用のPyodideサーバー実装。このサーバーにより、大規模言語モデル(LLM)がMCPインターフェースを介してPythonコードを実行できるようになります。

特徴

  • Pyodide を使用した LLM 向け Python コード実行機能

  • MCP準拠のサーバー実装

  • stdio と SSE トランスポートモードの両方をサポート

  • TypeScriptで書かれた堅牢な実装

  • コマンドラインツールとして利用可能

Related MCP server: MCP Python Interpreter

インストール

npm install mcp-pyodide

使用法

サーバーとして

import { runServer } from "mcp-pyodide";

// Start the server
runServer().catch((error: unknown) => {
 console.error("Error starting server:", error);
 process.exit(1);
});

コマンドラインツールとして

stdio モードで起動します (デフォルト):

mcp-pyodide

SSE モードで起動します。

mcp-pyodide --sse

SSEモード

SSE モードで実行している場合、サーバーは次のエンドポイントを提供します。

  • SSE 接続: http://localhost:3020/sse

  • メッセージハンドラー: http://localhost:3020/messages

クライアント接続の例:

const eventSource = new EventSource("http://localhost:3020/sse");
eventSource.onmessage = (event) => {
 console.log("Received:", JSON.parse(event.data));
};

プロジェクト構造

mcp-pyodide/
├── src/
│ ├── formatters/ # Data formatting handlers
│ ├── handlers/ # Request handlers
│ ├── lib/ # Library code
│ ├── tools/ # Utility tools
│ ├── utils/ # Utility functions
│ └── index.ts # Main entry point
├── build/ # Build artifacts
├── pyodide-packages/ # Pyodide-related packages
└── package.json

依存関係

  • @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以上

設定

# Clone the repository
git clone <repository-url>

# Install dependencies
npm install

# Build
npm run build

スクリプト

  • npm run build : TypeScript をコンパイルし、実行権限を設定する

  • npm start : stdioモードでサーバーを実行する

  • npm run start:sse : SSEモードでサーバーを実行する

環境変数

  • PYODIDE_CACHE_DIR : Pyodide キャッシュのディレクトリ (デフォルト: "./cache")

  • PYODIDE_DATA_DIR : マウントされたデータのディレクトリ(デフォルト: "./data")

  • PORT : SSEサーバーのポート(デフォルト: 3020)

ライセンス

マサチューセッツ工科大学

貢献

  1. リポジトリをフォークする

  2. 機能ブランチを作成する ( git checkout -b feature/amazing-feature )

  3. 変更をコミットします ( git commit -am 'Add some amazing feature' )

  4. ブランチにプッシュする ( git push origin feature/amazing-feature )

  5. プルリクエストを作成する

重要な注意事項

  • このプロジェクトは開発中であり、APIは変更される可能性があります。

  • 実稼働で使用する前に徹底的にテストする

  • セキュリティ上の理由から、信頼できないコードを実行するときは注意してください

  • SSEモードを使用する場合は、必要に応じて適切なCORS構成を確認してください。

サポート

問題や質問については、問題追跡システムをご利用ください。

A
license - permissive license
B
quality
F
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity
Issues opened vs closed

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

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/yonaka15/mcp-pyodide'

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