YM

yzfly/mcp-python-interpreter

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

104 stars 35 forks 품질 78 트렌드 35NOASSERTION

yzfly/mcp-python-interpreter는 [[T0]에서 가져오는 MCP 서버 후보입니다.

개요

yzfly/mcp-python-interpreter는 [[T0]에서 가져오는 MCP 서버 후보입니다.

개요(AI 번역)

LLM이 Python 환경과 상호작용하고, 파일을 읽고 쓰며, Python 코드를 실행하고, 개발 워크플로우를 관리할 수 있도록 하는 모델 컨텍스트 프로토콜(MCP) 서버입니다.

특징

  • 환경 관리: 다양한 Python 환경(시스템 및 콘다) 목록 및 사용
  • 코드 실행: 사용 가능한 환경에서 Python 코드나 스크립트를 실행하세요
  • 패키지 관리: 설치된 패키지를 나열하고 새 패키지를 설치하기
  • 파일 연산:
  • 텍스트, 소스 코드, 바이너리 등 모든 유형의 파일 읽기
  • 텍스트 및 바이너리 파일 작성
  • Python 프롬프트: 함수 생성 및 디버깅과 같은 일반적인 Python 작업을 위한 템플릿

설치

pip를 사용하여 MCP Python 인터프리터를 설치할 수 있습니다:

또는 UV를 사용해서:

클로드 데스크톱에서의 사용

  1. Claude 데스크톱 설치
  2. Claude Desktop을 열고 메뉴를 클릭한 후 설정을 선택하세요
  3. 개발자 탭으로 가서 "설정 편집"을 클릭하세요
  4. claude_desktop_config.json에 다음 항목을 추가하세요:

윈도우용:

  1. 클로드 데스크톱 재시작
  2. 이제 채팅 인터페이스에서 MCP 도구 아이콘을 볼 수 있을 것입니다

--dir 매개변수는 필수이며 모든 파일이 저장되고 실행될 위치를 지정합니다.

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

MCP Python Interpreter

A Model Context Protocol (MCP) server that allows LLMs to interact with Python environments, read and write files, execute Python code, and manage development workflows.

Features

  • Environment Management: List and use different Python environments (system and conda)
  • Code Execution: Run Python code or scripts in any available environment
  • Package Management: List installed packages and install new ones
  • File Operations:
    • Read files of any type (text, source code, binary)
    • Write text and binary files
  • Python Prompts: Templates for common Python tasks like function creation and debugging

Installation

You can install the MCP Python Interpreter using pip:

pip install mcp-python-interpreter

Or with uv:

uv tool install mcp-python-interpreter

Usage with Claude Desktop

  1. Install Claude Desktop
  2. Open Claude Desktop, click on menu, then Settings
  3. Go to Developer tab and click “Edit Config”
  4. Add the following to your claude_desktop_config.json:
{
  "mcpServers": {
    "mcp-python-interpreter": {
        "command": "uvx",
        "args": [
            "mcp-python-interpreter",
            "--dir",
            "/path/to/your/work/dir",
            "--python-path",
            "/path/to/your/python"
        ],
        "env": {
            "MCP_ALLOW_SYSTEM_ACCESS": "0"
        }
    }
  }
}

For Windows:

{
  "mcpServers": {
    "python-interpreter": {
      "command": "uvx",
      "args": [
        "mcp-python-interpreter",
        "--dir",
        "C:\\path\\to\\your\\working\\directory",
        "--python-path",
        "/path/to/your/python"
      ],
        "env": {
            "MCP_ALLOW_SYSTEM_ACCESS": "0"
        }
    }
  }
}
  1. Restart Claude Desktop
  2. You should now see the MCP tools icon in the chat interface

The --dir parameter sets the working directory (default: the directory where the server starts). File tools and run_python_code(save_as=...) restrict paths to this directory unless MCP_ALLOW_SYSTEM_ACCESS=1 is set. It is not a sandbox for executed Python code.

Prerequisites

  • Make sure you have uv installed. If not, install it using:
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  • For Windows:
    powershell -ExecutionPolicy Bypass -Command "iwr -useb https://astral.sh/uv/install.ps1 | iex"
    

Available Tools

The Python Interpreter provides the following tools:

Environment and Package Management

  • list_python_environments: List all available Python environments (system and conda)
  • list_installed_packages: List packages installed in a specific environment
  • install_package: Install a Python package in a specific environment

Code Execution

GitHub에서 전체 README 보기

설치

uvx mcp-python-interpreter --dir /path/to/your/work/dir --python-path /path/to/your/python
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "mcp-python-interpreter": { "command": "uvx", "args": [ "mcp-python-interpreter", "--dir", "/path/to/your/work/dir", "--python-path", "/path/to/your/python" ], "env": { "MCP_ALLOW_SYSTEM_ACCESS": "0" } } } }