Python Local MCP Server

by Alec2435

Integrations

  • Provides an interactive Python REPL environment where code can be executed in persistent sessions, with each session maintaining separate state and preserving execution history.

python_local MCP サーバー

インタラクティブな Python REPL (Read-Eval-Print Loop) 環境を提供する MCP サーバー。

コンポーネント

リソース

サーバーは REPL セッション履歴へのアクセスを提供します。

  • セッション履歴にアクセスするためのカスタムrepl:// URI スキーム
  • 各セッションの履歴はテキスト/プレーンリソースとして表示できます
  • 履歴には、実行ごとに入力コードと対応する出力が表示されます。

ツール

サーバーは 1 つのツールを実装します。

  • python_repl : 永続セッションでPythonコードを実行する
    • 必須の引数としてcode (実行するPythonコード)とsession_idを取ります
    • 各セッションごとに個別の状態を維持する
    • 式と文の両方をサポート
    • stdout/stderr出力をキャプチャして返します

構成

インストール

クロードデスクトップ

MacOS の場合: ~/Library/Application\ Support/Claude/claude_desktop_config.json Windows の場合: %APPDATA%/Claude/claude_desktop_config.json

発達

建築と出版

配布用のパッケージを準備するには:

  1. 依存関係を同期し、ロックファイルを更新します。
uv sync
  1. パッケージディストリビューションをビルドします。
uv build

これにより、 dist/ディレクトリにソースとホイールのディストリビューションが作成されます。

  1. PyPI に公開:
uv publish

注: 環境変数またはコマンド フラグを使用して PyPI 資格情報を設定する必要があります。

  • トークン: --tokenまたはUV_PUBLISH_TOKEN
  • またはユーザー名/パスワード: --username / UV_PUBLISH_USERNAMEおよび--password / UV_PUBLISH_PASSWORD

デバッグ

MCPサーバーはstdio経由で実行されるため、デバッグが困難になる場合があります。最適なデバッグ環境を実現するには、 MCP Inspectorの使用を強くお勧めします。

次のコマンドを使用して、 npm経由で MCP Inspector を起動できます。

npx @modelcontextprotocol/inspector uv --directory /path/to/python_local run python-local

起動すると、ブラウザでアクセスしてデバッグを開始できる URL がインスペクタに表示されます。

-
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.

永続的なセッション状態を維持するインタラクティブな Python REPL 環境を提供し、ユーザーが Python コードを実行してセッション履歴にアクセスできるようにします。

  1. Components
    1. Resources
    2. Tools
  2. Configuration
    1. Install
  3. Development
    1. Building and Publishing
    2. Debugging

Related MCP Servers

  • -
    security
    A
    license
    -
    quality
    A Model Context Protocol server that allows execution of Python code within Daytona workspaces, providing a secure and isolated environment for executing and managing Python scripts.
    Last updated -
    1
    8
    Python
    Apache 2.0
    • Apple
  • -
    security
    F
    license
    -
    quality
    This is an MCP server that facilitates building tools for interacting with various APIs and workflows, supporting Python-based development with potential for customizable prompts and user configurations.
    Last updated -
    Python
  • A
    security
    A
    license
    A
    quality
    A server that provides a persistent Python REPL environment through the MCP protocol, allowing execution of Python code, variable management, and package installation.
    Last updated -
    3
    3
    Python
    MIT License
  • A
    security
    F
    license
    A
    quality
    A Python server implementing the Model Context Protocol to provide customizable prompt templates, resources, and tools that enhance LLM interactions in the continue.dev environment.
    Last updated -
    2
    Python

View all related MCP servers

ID: cuy4zc6k84