Skip to content

Pokemon455/fastmcp-python-repl-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐍 FastMCP Python REPL Server

Give any AI assistant the power to execute Python β€” via MCP.

Made with FastMCP Python Deploy on Render License: MIT


✨ What Is This?

A production-ready MCP (Model Context Protocol) server that exposes a Python REPL as an AI tool.

Plug it into Claude, Cursor, or any MCP-compatible AI β€” and watch it execute real Python code on demand.

You / AI Agent  β†’  MCP Tool Call  β†’  This Server  β†’  Live Python Output  β†’  Back to AI

πŸ”΄ Live Demo: This server is actively running and connected to Claude.ai as a custom tool.


πŸš€ Features

  • ⚑ One tool, infinite power β€” run_python executes any Python code and returns output
  • 🌐 Cloud-ready β€” deploy to Render, Railway, or any platform in minutes
  • πŸ”Œ Plug & Play β€” works with Claude, Cursor, and any MCP-compatible client
  • 🧰 Built on FastMCP β€” the fastest way to build MCP servers in Python
  • πŸ“¦ Minimal setup β€” 3 dependencies, ~10 lines of core code

πŸ› οΈ Quick Start

1. Clone & Install

git clone https://github.com/Pokemon455/fastmcp-python-repl-server.git
cd fastmcp-python-repl-server
pip install -r requirements.txt

2. Run Locally

python main.py

Server starts at: http://localhost:10000/mcp

3. Connect to Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "python-repl": {
      "url": "http://localhost:10000/mcp",
      "transport": "streamable-http"
    }
  }
}

☁️ Deploy on Render (Free)

  1. Fork this repo
  2. Go to render.com β†’ New Web Service
  3. Connect your GitHub repo
  4. Set start command: python main.py
  5. Done! Your MCP server is live πŸŽ‰

πŸ“¦ Tech Stack

Package Purpose
fastmcp MCP server framework
langchain-experimental Python REPL execution
uvicorn Lightning-fast ASGI server

πŸ”§ MCP Tool Reference

run_python(code: str) β†’ str

Executes any Python code string and returns the output.

Example:

# Input
code = "print(sum([1, 2, 3, 4, 5]))"

# Output
"15"

πŸ—ΊοΈ Roadmap

  • Python REPL via MCP
  • Render/Railway deployment support
  • API key authentication
  • Sandboxed execution environment
  • Support for file I/O & pip installs
  • Docker support

🀝 Contributing

PRs are welcome! If you have ideas to make this better β€” open an issue or submit a pull request.


πŸ‘€ Author

Pokemon455 β€” AI/ML & MCP Developer πŸ”— GitHub


⭐ If this saved you time, drop a star β€” it keeps the project alive! ⭐

About

🐍 A production-ready Python REPL MCP server using FastMCP + LangChain β€” deploy on Render in minutes!

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages