This is a lightweight, zero-overhead implementation of Model Context Protocol (MCP) in pure Python inspired by the original bash implementation by Muthukumaran Navaneethakrishnan.
Why? I found the idea of using the simplest possible implementation of MCP in a shell script fascinating, but I wanted to see how it would look in Python with true introspection capabilities.
- β Full JSON-RPC 2.0 protocol over stdio
- β Complete MCP protocol implementation
- β Dynamic tool discovery via function naming convention
- β Complete introspection of function signatures
- β Easy to extend with custom tools
- Python 3
- Clone the repo
git clone https://github.com/rcarmo/umcp- Try it out
echo '{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "get_movies"}, "id": 1}' | python ./movie_server.pyβββββββββββββββ βββββββββββββββββ
β MCP Host β β MCP Server β
β (AI System) βββββββββΊ β (myserver.py) β
βββββββββββββββ stdio βββββββββββββββββ
β
βββββββββββ΄βββββββββββ
βΌ βΌ
ββββββββββββββββββ ββββββββββββββββββ
β Protocol Layer β β Business Logic β
β (umcp.py) β β(tool_* methods)β
ββββββββββββββββββ ββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββ βββββββββββββββββ
β Introspection β β External β
βββββββββββββββββ β Services/APIs β
βββββββββββββββββ
This implementation includes two simple example servers that demonstrate how to use the MCP protocol, one for a movie booking system and another for a calculator.
Both are supplied in synchronous and asynchronous versions, showcasing how to implement tools and introspection.
- Update VS Code settings.json
- Use with GitHub Copilot Chat
/mcp my-weather-server get weather for New York
- No concurrency/parallel processing in synchronous version
- No streaming responses
- Not designed for high throughput
For AI assistants and local tool execution, these aren't blocking issues.
This project is licensed under the MIT License - see the LICENSE file for details.