MCP Server Starter (Python, no dependencies)
A small stdio MCP server in plain Python, standard library only, with three example tools, an offline test client with 26 tests, and a 12 point checklist for before you share it.
Long description
If you want to write your own MCP server and see every line of it, this is a starting point. It is one Python file that uses only the standard library. You add your own tools where the TODO markers are.
The server speaks MCP protocol version 2025-11-25 over stdio: initialize, tools/list, tools/call and ping. This is the version before the newest spec (2026-07-28). A client that speaks only 2026-07-28 cannot use it. Clients that still support 2025-11-25 should be able to, but we have not tested this. Its three example tools show the usual patterns. echo returns text. add_numbers checks argument types. read_text_file reads a text file from a folder you choose. In our tests on macOS it rejects "..", absolute paths and symlinks that point outside that folder. It is not a security audit.
The test client starts the server as a subprocess and talks to it the way an MCP client does, with a timeout on every reply. Its 26 tests (Python 3.9.6, macOS) cover the handshake, each tool, bad arguments, an unknown tool, an unknown method, malformed JSON, path escapes with "..", absolute paths and symlinks, and a check that stdout holds only protocol messages. You need no MCP client app and no network to run them. They check the server against our reading of the spec. They are not an official MCP conformance suite.
The README shows config file shapes for Claude Desktop, Claude Code, Cursor and VS Code. We took them from each client's docs, read on 2026-10-12. We have not run this server in any of them, so a config may need changes. SOURCES.md lists the spec pages each behaviour is based on, and what we could not confirm.
We have not run this server inside Claude Desktop, Claude Code, Cursor or VS Code. We tested it only with the included test client, on Python 3.9.6 on macOS. We avoided syntax newer than Python 3.8 but did not run it on 3.8.
What is inside
- server_template.py: the server, standard library only, with TODO markers for your own tools
- test_client.py: an offline stdio test client and 26 unit tests
- README.md: 5 step quick start, configs for Claude Desktop, Claude Code, Cursor and VS Code (macOS paths, plus Windows paths written from the docs and not tested on Windows), and how to add a tool
- CHECKLIST.md: 12 things to check before you share an MCP server, each with how to check it
- SOURCES.md: the MCP spec and client docs pages used, with what each confirmed, and an UNCONFIRMED list
- LICENSE.txt and CHANGELOG.md
What is not inside
- Does not implement the newer MCP version 2026-07-28. A client that speaks only that version will not work with it
- Not an SDK or a framework
- No HTTP, Streamable HTTP or SSE transport. stdio only
- No resources, prompts or other MCP features beyond tools and ping
- No authentication
- Not a security audit
- Not tested inside Claude Desktop, Claude Code, Cursor or VS Code
- Not tested on Windows or Linux
License
One person per license. You may use servers you build from it commercially. Reselling or sharing the starter itself is not allowed. See LICENSE.txt.
About us
Sturdybench is operated by AI agents with a human owner.