Skip to main content
Glama

Python REPL MCP Server

by hdresearch

Python REPL MCP サーバー

このMCPサーバーは、Python REPL(Read-Eval-Print Loop)ツールを提供します。これにより、MCPプロトコルを介して永続セッションでPythonコードを実行できます。

設定

セットアップは不要です。このプロジェクトでは依存関係の管理にuvを使用します。

サーバーの実行

次のコマンドを実行するだけです:

uv run src/python_repl/server.py

Claude Desktopでの使用

この構成を Claude Desktop 構成ファイルに追加します。

{ "mcpServers": { "python-repl": { "command": "uv", "args": [ "--directory", "/absolute/path/to/python-repl-server", "run", "mcp_python" ] } } }

サーバーは次の 3 つのツールを提供します。

  1. execute_python : 永続変数を使用してPythonコードを実行する
    • code : 実行するPythonコード
    • reset : セッションをリセットするためのオプションのブール値
  2. list_variables : 現在のセッション内のすべての変数を表示する
  3. install_package : pypiからパッケージをインストールする

変数を設定します。

a = 42

次の変数を使用します:

print(f"The value is {a}")

すべての変数を一覧表示します。

# Use the list_variables tool

セッションをリセットします:

# Use execute_python with reset=true

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。貢献できる方法は次のとおりです。

  • バグを報告する
  • 新機能を提案する
  • ドキュメントの改善
  • テストケースを追加する
  • コードの改善を送信する

PR を送信する前に、次の点を確認してください。

  1. コードは既存のスタイルに従います
  2. 必要に応じてドキュメントを更新しました
  3. いくつかテストを書いてみませんか?

大きな変更については、まず問題を開いて、何を変更したいのか話し合ってください。

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

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

MCP プロトコルを通じて永続的な Python REPL 環境を提供し、Python コードの実行、変数の管理、パッケージのインストールを可能にするサーバーです。

  1. 設定
    1. サーバーの実行
      1. Claude Desktopでの使用
          1. 貢献

            Related MCP Servers

            • -
              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
            • -
              security
              F
              license
              -
              quality
              Provides an interactive Python REPL environment that maintains persistent session state, allowing users to execute Python code and access session history.
              Last updated -
              49
              Python
              • Apple
            • A
              security
              F
              license
              A
              quality
              An MCP server implementation that enables interaction with the Unstructured API, providing tools to list, create, update, and manage sources, destinations, and workflows.
              Last updated -
              39
              28
              • Apple
            • -
              security
              F
              license
              -
              quality
              A demonstration server showing MCP implementation in Python with resource handling, tool operations, and reusable prompts for a simple user/post system with local database.
              Last updated -
              Python
              • Apple
              • Linux

            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/hdresearch/mcp-python'

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