Python REPL MCP Server

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Allows installation of Python packages directly from PyPI using the install_package tool, enabling access to additional Python libraries as needed.

  • Offers a persistent Python execution environment that maintains variable state between code executions, enabling multi-step programming workflows.

파이썬 REPL MCP 서버

이 MCP 서버는 Python REPL(Read-Eval-Print Loop)을 도구로 제공합니다. 이를 통해 MCP 프로토콜을 통해 Python 코드를 영구 세션으로 실행할 수 있습니다.

설정

설정이 필요 없습니다! 이 프로젝트는 종속성 관리를 위해 uv 사용합니다.

서버 실행

간단히 실행하세요:

지엑스피1

Claude Desktop과 함께 사용

Claude Desktop 구성 파일에 다음 구성을 추가하세요.

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

서버는 세 가지 도구를 제공합니다.

  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. 테스트를 몇 개 써보는 건 어떨까요?

중요한 변경 사항이 있는 경우, 먼저 이슈를 열어서 변경하고 싶은 사항을 논의하세요.

You must be authenticated.

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

MCP 프로토콜을 통해 지속적인 Python REPL 환경을 제공하는 서버로, Python 코드 실행, 변수 관리, 패키지 설치가 가능합니다.

  1. Setup
    1. Running the Server
      1. Usage with Claude Desktop
        1. Examples
          1. Contributing
            ID: jsorljnhdl