
hdresearch/mcp-python
Productivity workflowこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
hdresearch/mcp-python は [https://github.com/hdresearch/mcp-python. からインポートされた MCP サーバーの候補です
概要
hdresearch/mcp-python は [https://github.com/hdresearch/mcp-python. からインポートされた MCP サーバーの候補です
概要(AI 翻訳)
この MCP サーバーは、Python REPL (Read-Eval-Print Loop) をツールとして提供しています。 持続的なセッションでMCPプロトコルを介してPythonコードを実行できます。
セットアップ
セットアップ不要! プロジェクトは、依存関係管理のためにuvを使用します。
サーバーの実行
単に実行:
Claudeデスクトップでの使用
この設定をClaudeデスクトップ設定ファイルに追加します。
サーバは3つのツールを提供しています。
- [
execute_python: 永続変数で Python コードを実行する
- [
code: 実行する Python コード - [
reset]: セッションをリセットするオプションの boolean
-
[[
list_variables]: 現在のセッションのすべての変数を表示 -
[
install_package:pypiからパッケージをインストールする
例
変数を設定する:
変数を使う:
すべての変数のリスト:
セッションのリセット:
投稿
ご協力のほどよろしくお願いします! プルリクエストを提出してください。 あなたが貢献することができるいくつかの方法は次のとおりです。
- バグ報告
- 新しい機能を提案する
- ドキュメントの改善
- テストケースの追加
- コードの改善を提出する
広報を提出する前に、必ずお知らせください。
- 既存のスタイルに従うコード
- 必要に応じて文書を更新
- 多分テストを書くか?
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
Python REPL MCP Server
This MCP server provides a Python REPL (Read-Eval-Print Loop) as a tool. It allows execution of Python code through the MCP protocol with a persistent session.
Setup
No setup needed! The project uses uv for dependency management.
Running the Server
Simply run:
uv run src/python_repl/server.py
Usage with Claude Desktop
Add this configuration to your Claude Desktop config file:
{
"mcpServers": {
"python-repl": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/python-repl-server",
"run",
"mcp_python"
]
}
}
}
The server provides three tools:
-
execute_python: Execute Python code with persistent variablescode: The Python code to executereset: Optional boolean to reset the session
-
list_variables: Show all variables in the current session -
install_package: Install a package from pypi
Examples
Set a variable:
a = 42
Use the variable:
print(f"The value is {a}")
List all variables:
# Use the list_variables tool
Reset the session:
# Use execute_python with reset=true
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. Here are some ways you can contribute:
- Report bugs
- Suggest new features
- Improve documentation
- Add test cases
- Submit code improvements
Before submitting a PR, please ensure:
- Your code follows the existing style
- You’ve updated documentation as needed
- Maybe write some tests?
For major changes, please open an issue first to discuss what you would like to change.
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers": {
"python-repl": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/python-repl-server",
"run",
"mcp_python"
]
}
}
}