mcp-py
Zero-dependency Model Context Protocol server in Python.
Dependency-free Model Context Protocol server in Python supporting tool, resource, and prompt registration alongside JSON Schema argument validation.
The problem
Protocol SDKs often pull in heavy dependency trees when a lightweight, inspectable Python server is all a tool needs.
Approach
Implements MCP tool, resource, and prompt registration plus JSON Schema argument validation using only the Python standard library.
Python developers building minimal, auditable MCP servers without third-party dependency overhead.
MCP Tool Registration & Schema Validation
How are tool arguments validated against JSON Schema before reaching a Python handler?
Protocol SDKs often pull in heavy dependency trees when a lightweight, inspectable Python server is all a tool needs.
Implements MCP tool, resource, and prompt registration plus JSON Schema argument validation using only the Python standard library.
- — Dependency-free Python MCP server implementation.
- — Supports tool, resource, and prompt registration.
- — Validates incoming tool arguments against JSON Schema.
Architecture & notes
Claims are labeled by evidence type. Details requiring direct source inspection are kept explicit.
Capabilities3
- — Dependency-free Python MCP server implementation.
- — Supports tool, resource, and prompt registration.
- — Validates incoming tool arguments against JSON Schema.
Design & implementation evidence2
Checks incoming tool arguments against declared JSON Schema constraints before handler invocation.
Conceptual schema validation flow illustrating valid vs. rejected payloads.
Scope & limitations1
- — Conceptual validation example does not execute Python code in the browser.
Related work
Shared concerns: making ai agents reliable