
alec2435/python_mcp
Productivity workflow이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
alec2435/python mcp는 https://github.com/alec2435/python_mcp.]에서 수입된 MCP 서버 후보입니다
개요
alec2435/python mcp는 https://github.com/alec2435/python_mcp.]에서 수입된 MCP 서버 후보입니다
개요(AI 번역)
대화형 Python REPL(Read-Eval-Print Loop) 환경을 제공하는 MCP 서버.
부품
자원
서버는 REPL 세션 역사에 대한 액세스를 제공합니다:
- 사용자 정의
repl://세션 역사에 접근하기위한 URI 계획 - 각 세션의 역사는 text/plain resource로 볼 수 있습니다.
- History는 각 실행에 대한 입력 코드 및 대응 출력을 보여줍니다.
도구
서버는 하나의 도구를 구현합니다:
python_repl: persistent 세션에서 Python 코드를 실행code] (Python code to perform) 와session_id] 를 입력해야 한다.- 각 세션마다 별도의 상태를 유지
- 표현과 문 모두 지원
- 캡처 및 반환 stdout/stderr 출력
구성
설치
Claude 데스크탑
MacOS에서: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows에서: %APPDATA%/Claude/claude_desktop_config.json
개발/Unpublished 서버 구성
서버 구성
개발
건물 및 출판
배포 패키지를 준비하려면:
-
Sync 종점 및 갱신 lockfile:
-
포장 배급을 건설하십시오:
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
python_local MCP Server
An MCP Server that provides an interactive Python REPL (Read-Eval-Print Loop) environment.
Components
Resources
The server provides access to REPL session history:
- Custom
repl://URI scheme for accessing session history - Each session’s history can be viewed as a text/plain resource
- History shows input code and corresponding output for each execution
Tools
The server implements one tool:
python_repl: Executes Python code in a persistent session- Takes
code(Python code to execute) andsession_idas required arguments - Maintains separate state for each session
- Supports both expressions and statements
- Captures and returns stdout/stderr output
- Takes
Configuration
Install
Claude Desktop
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
Development
Building and Publishing
To prepare the package for distribution:
- Sync dependencies and update lockfile:
uv sync
- Build package distributions:
uv build
This will create source and wheel distributions in the dist/ directory.
- Publish to PyPI:
uv publish
Note: You’ll need to set PyPI credentials via environment variables or command flags:
- Token:
--tokenorUV_PUBLISH_TOKEN - Or username/password:
--username/UV_PUBLISH_USERNAMEand--password/UV_PUBLISH_PASSWORD
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm with this command:
npx @modelcontextprotocol/inspector uv --directory /path/to/python_local run python-local
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
설치
uvx python_local설정
"mcpServers": {
"python_local": {
"command": "uv",
"args": [
"--directory",
"/path/to/python_local",
"run",
"python_local"
]
}
}