mcp-python


Namemcp-python JSON
Version 0.1.4 PyPI version JSON
download
home_pageNone
SummaryMCP server providing a Python REPL with persistent session
upload_time2025-01-08 19:05:47
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords mcp python repl server
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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:

```bash
uv run src/mcp_python/server.py
```

## Usage with Claude Desktop

Add this configuration to your Claude Desktop config file:

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

The server provides three tools:

1. `execute_python`: Execute Python code with persistent variables

   - `code`: The Python code to execute
   - `reset`: Optional boolean to reset the session

2. `list_variables`: Show all variables in the current session

3. `install_package`: Install a package from pypi

## Examples

Set a variable:

```python
a = 42
```

Use the variable:

```python
print(f"The value is {a}")
```

List all variables:

```python
# Use the list_variables tool
```

Reset the session:

```python
# 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:

1. Your code follows the existing style
2. You've updated documentation as needed
3. Maybe write some tests?

For major changes, please open an issue first to discuss what you would like to change.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mcp-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "mcp, python, repl, server",
    "author": null,
    "author_email": "Tynan Daly <tynan@hdr.is>",
    "download_url": "https://files.pythonhosted.org/packages/e7/66/b6e5311c793b25b19ac9177bfbbabca867c1beb61b2cc813aa031574370d/mcp_python-0.1.4.tar.gz",
    "platform": null,
    "description": "# Python REPL MCP Server\n\nThis 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.\n\n## Setup\n\nNo setup needed! The project uses `uv` for dependency management.\n\n## Running the Server\n\nSimply run:\n\n```bash\nuv run src/mcp_python/server.py\n```\n\n## Usage with Claude Desktop\n\nAdd this configuration to your Claude Desktop config file:\n\n```json\n{\n  \"mcpServers\": {\n    \"python-repl\": {\n      \"command\": \"uv\",\n      \"args\": [\n        \"--directory\",\n        \"/absolute/path/to/mcp_python\",\n        \"run\",\n        \"mcp_python\"\n      ]\n    }\n  }\n}\n```\n\nThe server provides three tools:\n\n1. `execute_python`: Execute Python code with persistent variables\n\n   - `code`: The Python code to execute\n   - `reset`: Optional boolean to reset the session\n\n2. `list_variables`: Show all variables in the current session\n\n3. `install_package`: Install a package from pypi\n\n## Examples\n\nSet a variable:\n\n```python\na = 42\n```\n\nUse the variable:\n\n```python\nprint(f\"The value is {a}\")\n```\n\nList all variables:\n\n```python\n# Use the list_variables tool\n```\n\nReset the session:\n\n```python\n# Use execute_python with reset=true\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. Here are some ways you can contribute:\n\n- Report bugs\n- Suggest new features\n- Improve documentation\n- Add test cases\n- Submit code improvements\n\nBefore submitting a PR, please ensure:\n\n1. Your code follows the existing style\n2. You've updated documentation as needed\n3. Maybe write some tests?\n\nFor major changes, please open an issue first to discuss what you would like to change.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "MCP server providing a Python REPL with persistent session",
    "version": "0.1.4",
    "project_urls": {
        "Github": "https://github.com/hdresearch/mcp-python",
        "Homepage": "https://hdr.is",
        "Issues": "https://github.com/hdresearch/mcp-python/issues",
        "Repository": "https://github.com/hdresearch/mcp-python.git"
    },
    "split_keywords": [
        "mcp",
        " python",
        " repl",
        " server"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ed5f4d429de941b7b89fcf30940f4199055e334088f83729af904d141850b375",
                "md5": "4a213c4ebc3f81bfec9a476ef90b9e37",
                "sha256": "9c86bc3017c7317a4980dab2a8301fc58389c44dd8c0bd9a65832f9c3870d6b8"
            },
            "downloads": -1,
            "filename": "mcp_python-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4a213c4ebc3f81bfec9a476ef90b9e37",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 5780,
            "upload_time": "2025-01-08T19:05:45",
            "upload_time_iso_8601": "2025-01-08T19:05:45.601626Z",
            "url": "https://files.pythonhosted.org/packages/ed/5f/4d429de941b7b89fcf30940f4199055e334088f83729af904d141850b375/mcp_python-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e766b6e5311c793b25b19ac9177bfbbabca867c1beb61b2cc813aa031574370d",
                "md5": "ac29111337ed12c0e4c7f4dbb874cfb9",
                "sha256": "0a85ed659141126cc115da90fb139c542a9dbd0c107bc3273c3e8e8f23d8b6b1"
            },
            "downloads": -1,
            "filename": "mcp_python-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "ac29111337ed12c0e4c7f4dbb874cfb9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 15556,
            "upload_time": "2025-01-08T19:05:47",
            "upload_time_iso_8601": "2025-01-08T19:05:47.483185Z",
            "url": "https://files.pythonhosted.org/packages/e7/66/b6e5311c793b25b19ac9177bfbbabca867c1beb61b2cc813aa031574370d/mcp_python-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-08 19:05:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hdresearch",
    "github_project": "mcp-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mcp-python"
}
        
Elapsed time: 2.51370s