Show HN: Minimal Stdio Python MCP Server

3 days ago 3

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

  1. Clone the repo
git clone https://github.com/rcarmo/umcp
  1. 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.


🖥️ Using with VS Code & GitHub Copilot

  1. Update VS Code settings.json
  1. 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.

Read Entire Article