py-easy-mcp ⚡🤖
Ultra-lightweight, zero-dependency Python framework for Model Context Protocol (MCP). Build MCP servers for Claude in seconds.
Turn standard Python functions (both sync and async def) into Model Context Protocol tools, resources, and prompt templates for Claude Desktop and Claude Code with simple decorators.
⚡ Why py-easy-mcp?
- Zero dependencies: Written in 100% pure standard Python. Instant startup, zero supply-chain risk.
- Sync & Async Support: Supports both standard
defand modernasync deftool, resource, and prompt handlers. - Full MCP Protocol Support (v0.3.0): Tools (
@mcp.tool()), Resources (@mcp.resource()), and Prompts (@mcp.prompt()). - 1-Click Claude Desktop Installer: Run
py-easy-mcp install server.pyto auto-detect and configureclaude_desktop_config.jsonwith automatic backup. - Dev Inspector & Interactive REPL: Test your tools in the terminal with
py-easy-mcp dev server.pywithout needing Claude Desktop open. - Automatic Schema Inspection: Docstrings and type annotations are automatically converted into standard JSON Schemas.
- Offline & Safe: Standard I/O (stdio) JSON-RPC 2.0 communication.
📦 Installation
pip install py-easy-mcp
(Note: Both CLI commands py-easy-mcp and easy-mcp are available)
🚀 30-Second Quickstart
1. Write your server (my_server.py)
from easy_mcp import EasyMCP
mcp = EasyMCP(name="my-server", version="0.3.0")
# 1. Register a Sync or Async Tool
@mcp.tool()
async def fetch_weather(city: str) -> dict:
"""Fetch weather forecast for a given city.
Args:
city: The city name (e.g. 'Tokyo', 'San Francisco')
"""
return {"city": city, "temp": "22°C", "condition": "Sunny"}
# 2. Register a Resource (readable context)
@mcp.resource("memo://guidelines")
def guidelines() -> str:
"""Engineering principles."""
return "1. Keep it simple.\n2. Zero external dependencies.\n3. Write clear tests."
# 3. Register a Prompt Template
@mcp.prompt()
def code_review(code: str, language: str = "python") -> str:
"""Review code for bugs and maintainability."""
return f"Please review this {language} snippet:\n\n{code}"
if __name__ == "__main__":
mcp.run()
2. 1-Click Install to Claude Desktop
Simply run:
py-easy-mcp install my_server.py
py-easy-mcp will:
- Locate your OS Claude config (
%APPDATA%\Claude\claude_desktop_config.jsonon Windows,~/Library/Application Support/Claude/...on macOS). - Create a timestamped backup (
claude_desktop_config.json.bak). - Register
my-serverpointing to your current Python environment.
Restart Claude Desktop, and your tools will appear instantly!
🛠️ CLI Utilities & Dev Tools
Dev Inspector (Offline Testing)
Inspect all registered schemas, parameter requirements, and docstrings:
py-easy-mcp dev my_server.py
Direct Tool Execution
Test a tool directly from your command line:
py-easy-mcp dev my_server.py --call fetch_weather -a '{"city": "Tokyo"}'
Interactive REPL
Start an interactive terminal session to explore tools and resources:
py-easy-mcp dev my_server.py -i
Scaffold a New Project
py-easy-mcp init weather-server
📂 Production MCP Examples
Check out our ready-to-run examples in examples/:
examples/sqlite_server.py- Full SQLite database inspector withlist_tables,describe_table,execute_query(read-only), and schema DDL resource.examples/basic_math.py- Arithmetic calculation tools.examples/pii_shield_mcp.py- AI data privacy sanitizer for Claude.
🤝 Contributing for Hacktoberfest
We welcome beginner-friendly contributions! Add new lightweight tool examples or protocol extensions. See CONTRIBUTING.md to get started.
📄 License
MIT License © 2026 lui01212
Release files for py-easy-mcp 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py_easy_mcp-0.3.0.tar.gz | 23.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_easy_mcp-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.7 kB
Release files / py_easy_mcp-0.3.0.tar.gz
| Download URL | py_easy_mcp-0.3.0.tar.gz |
|---|---|
| Size | 23.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1ecf5a297566a6a4d9de7e88c07a2e1c0672beb156ef7839bac1e98a098339f
|
|
BLAKE2b-256 checksum How to use checksums |
62f7f56b343f93b18bcc9740182c8ed0ba52ce5578c5898a82502216ed77122e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / py_easy_mcp-0.3.0-py3-none-any.whl
| Download URL | py_easy_mcp-0.3.0-py3-none-any.whl |
|---|---|
| Size | 17.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef478eb2e26f3cb4cec7d39cebf16d01f9f10019776b32a2329838f2ec8337ee
|
|
BLAKE2b-256 checksum How to use checksums |
6514fa4a2b3e507bb00d20ea3645141c9dc9b55eae0ac1c4d9843a565162d785
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency log