easy-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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.
Start here: your first contribution
Featured beginner issue #11: Write an offline walkthrough of the existing math example. Read CONTRIBUTING.md for setup, claiming an issue, and opening a draft PR.
Repository: easy-mcp; PyPI distribution: py-easy-mcp; Python import: easy_mcp.
Both py-easy-mcp and easy-mcp are installed CLI aliases.
Try this from a reviewed source checkout, in the repository root, with Python 3.8+. It uses synthetic inputs and needs no API key or network access:
from examples.basic_math import mcp
print(mcp.call_tool("add", {"a": 2, "b": 3}))Expected output:
{'content': [{'type': 'text', 'text': '5'}], 'isError': False}Related MCP server: MCP Python Server — API Wrapper
⚡ Why py-easy-mcp?
Zero dependencies: Written in 100% pure standard Python. No third-party runtime dependencies; review code and build tools before use.
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.pypy-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.<date>-<time>.bak) before changing an existing config.Register
my-serverpointing to your current Python environment.
If another script is already registered under the same name, the install stops instead of replacing it. Pick a different name with --name, or pass --force to replace it.
Restart Claude Desktop, and your tools will appear instantly!
🛠️ CLI Utilities & Dev Tools
Logging from tools
stdout carries the JSON-RPC stream, so while the server runs, print() inside a tool is sent to stderr, where Claude Desktop keeps its server logs. Error details and tracebacks also go to stderr; the model only sees the error type and message.
Dev Inspector (Offline Testing)
Inspect all registered schemas, parameter requirements, and docstrings:
py-easy-mcp dev my_server.pyDirect 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 -iScaffold 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- SQLite database inspector withlist_tables,describe_table,execute_query, and a schema DDL resource. It opensSQLITE_DB_PATHread-only and stops queries that run longer than 5 seconds.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
This server cannot be deployed
Maintenance
Related MCP Connectors
Convert, lint and generate LLM tool schemas for OpenAI, Anthropic, Gemini and MCP
Research-backed lint + generation for agent context files (CLAUDE.md, AGENTS.md) + prompt enhancer.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Build and run AI cloud functions in Python, with shared memories and connected services.
Related MCP Servers
- AlicenseDqualityDmaintenanceA foundation for building custom local Model Context Protocol (MCP) servers that provide tools accessible to AI assistants like Cursor or Claude Desktop.137MIT
- FlicenseNot gradedqualityDmaintenanceA Python server implementing the Model Context Protocol that exposes tools for querying external APIs, compatible with Claude Desktop and ChatGPT Desktop.-
- AlicenseNot gradedqualityDmaintenanceA universal framework for creating and deploying custom Model Context Protocol (MCP) tool servers with decorator-based tool registration, supporting multiple transports and automatic JSON schema generation for AI assistants.2MIT
- AlicenseNot gradedqualityFmaintenanceEnables standardized interactions between LLMs and CMMV applications using the Model Context Protocol, with decorator-based tool registration and flexible transport options.13 npmMIT