
hdresearch/mcp-python
Productivity workflowЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
hdresearch/mcp-python - кандидат на сервер MCP, импортированный из https://github.com/hdresearch/mcp-python.
Обзор
hdresearch/mcp-python - кандидат на сервер MCP, импортированный из https://github.com/hdresearch/mcp-python.
Обзор (машинный перевод)
Этот MCP-сервер предоставляет в качестве инструмента Python REPL (Read-Eval-Print Loop). Он позволяет выполнять код Python через протокол MCP с постоянным сеансом.
Настройка
Никакой установки не нужно! Проект использует uv для управления зависимостью.
Запуск сервера
Просто беги:
Использование с Claude Desktop
Добавьте эту конфигурацию в файл конфигурации Claude Desktop:
Сервер предоставляет три инструмента:
execute_python: Выполнять код Python с постоянными переменными
- [[Т2]]: Код Python для выполнения
- [[Т3]]: Факультативный булеан для сброса сессии
-
[[Т4]]: Показать все переменные на текущей сессии
-
install_package: Установите пакет из pypi
Примеры
Установите переменную:
Используйте переменную:
Перечислите все переменные:
Перезагрузить сессию:
# Вклад
Взносы приветствуются! Пожалуйста, не стесняйтесь отправлять запрос Pull. Вот несколько способов, которыми вы можете внести свой вклад:
- Сообщить об ошибках
- Предложите новые функции Улучшить документацию Добавить тестовые случаи
- Улучшение кода
Перед отправкой PR, пожалуйста, убедитесь:
1 Ваш код соответствует существующему стилю 2. Вы обновили документацию по мере необходимости 3.Может, напишу тест?
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
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"
]
}
}
}