MCP server Python starter
You can run a secure MCP server that exposes time, docs-search, identity, and optional notes-backend tools to local or remote MCP clients.
Call
get_timeto get the current time in UTC or an IANA time zone.Call
search_docsto search the server’s docs and return matching links and snippets.Call
whoamito see the transport and, over HTTP, the client ID and scopes.Read
docs://resources and, when configured, uselist_notesandcreate_notewith a REST notes API.Connect over stdio or stateless Streamable HTTP, with OAuth/static-token auth, readiness, telemetry, and production packaging.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP server Python starter List my notes and create one titled 'Ideas' with today's plan."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP server Python starter
A production-ready Model Context Protocol server in Python, ready to customize with coding agents. It runs over stdio for local clients and Streamable HTTP for remote ones, with OAuth, sample tools that include calls to a backend API, tests through real MCP clients, and a release pipeline.
Features
Current protocol: built on the official MCP Python SDK v2 and its
MCPServerAPI, for the 2026-07-28 spec, while still serving older clients.Two transports: stdio for Claude Code, Claude Desktop, and Cursor, plus stateless Streamable HTTP that scales horizontally.
Secure HTTP: OAuth per the MCP authorization spec, with per-tool scopes and
403scope challenges, or static tokens. It won't start without an auth mode, and it blocks DNS rebinding.Typed tools:
get_time,search_docs, andwhoamiuse type hints and Pydantic models as their schemas, with annotations and readable errors, plusdocs://resources.Backend integration:
list_notesandcreate_notecall any REST API that meets a documented notes contract, with deadlines, validated responses, and errors the model can act on. They use a service account, or act as each user through token exchange. See Connect a backend API.Production ready: readiness and graceful drain, OpenTelemetry traces and metrics, and a deploy guide with proxy, TLS, and identity provider setup.
Real tests: tools are tested through real MCP clients in process, over stdio, and over HTTP, on both protocol eras, plus the built wheel and the Docker image.
Strict gates: Ruff, mypy in strict mode, and 90% coverage.
Publishing: releases to PyPI, the MCP Registry, and GHCR, with digest-pinned base images, a vulnerability scan before push, an SBOM, and provenance. A test keeps
server.json,pyproject.toml, and the image label in step.Agent-ready:
AGENTS.md, skills, and checks that run on every commit.
Related MCP server: McpHub
Quick start
You need uv, which installs Python 3.15 for you, and Node for the MCP Inspector:
git clone https://github.com/opikdev/mcp-server-python-starter
cd mcp-server-python-starter
make sync
make inspectThe MCP Inspector opens in your browser. Connect, list the tools, and call get_time. To try the notes tools too, pass the UPSTREAM_* settings, as Connect a backend API shows.
To run it over HTTP in Docker instead:
docker compose up --build --wait mcpThe server is now at http://localhost:3000/mcp, with the dev token dev-token-change-me-0123. To connect Claude Code, Claude Desktop, Cursor, or VS Code, see Connect a client.
Start your own project
Create a renamed copy with pik. It downloads this starter's latest release, then sets your project name and GitHub owner:
pik new mcp-server-python-starter my-mcp-serverOr select Use this template on GitHub. That copy keeps the name mcp-server-python-starter and the owner opikdev, so follow pik.yaml by hand: swap the replace text, delete the exclude paths, and run the setup commands.
Usage
Task | Command |
Try the tools in the MCP Inspector |
|
Serve over HTTP on your machine |
|
Run lint, types, tests with coverage, and repo checks |
|
Test the built wheel, the Docker image, and an example backend |
|
Fix formatting and lint you can fix automatically |
|
To work in a dev container, open the folder in one: .devcontainer/ has Python, uv, and jq, so make verify runs inside it. make e2e needs Docker on the host. Over HTTP, the server needs an auth mode. See Configure HTTP auth.
To add a tool, create a module in src/mcp_app/tools/ with a register_* function, call it from src/mcp_app/server.py, and test it in tests/integration/test_tools.py. Before you release, read Publish a release.
Project structure
Path | Purpose |
| Entry point: stdio by default, or HTTP with |
| Builds the server with every tool and resource |
| One module per tool, or a small related set |
|
|
| The HTTP app, health and readiness, token verifiers, and scope challenges |
| Clients for backend APIs, and the credential each call uses |
| A local Keycloak for OAuth and token exchange |
| Unit, integration, and end-to-end tests |
| MCP Registry metadata |
| Architecture, guides, and decisions |
Contributing
Read CONTRIBUTING.md before opening a pull request, and follow the code of conduct.
Security
Report vulnerabilities privately, as described in SECURITY.md.
License
Released under the MIT License.
Available Tools
3 toolsget_timeGet the current timeARead-onlyIdempotent
Returns the current date and time in an IANA time zone, such as Europe/Berlin.
Inputs: timezone. Returns: iso, local, timezone
search_docsSearch the docsARead-onlyIdempotent
Searches this server's docs and returns the best matches, with links to read each.
Inputs: query (required), limit. Returns: results
whoamiWho am IARead-onlyIdempotent
Returns how the caller is connected and, over HTTP, the client and its scopes.
Inputs: no named parameters. Returns: scopes, clientId, transport
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool targets a completely distinct concern: current time, documentation search, and caller identity. There is no plausible scenario where an agent would confuse one for another.
get_time and search_docs follow a clean verb_noun snake_case convention. whoami deviates from that pattern, though it is a widely recognized idiom and remains unambiguous.
Three tools is thin even for a starter/demo server, and they are unrelated utility functions rather than a coherent domain surface. It is defensible as a template but feels under-scoped.
The tools are self-contained read-only utilities, so there is no CRUD lifecycle to complete, but the surface offers little beyond diagnostics. A starter server would benefit from at least one example of a stateful or parameterized operation to demonstrate extension patterns.
Maintenance
Related MCP Connectors
Generate a typed SDK, CLI, and MCP server from any OpenAPI or GraphQL spec, and keep them current.
Build, test, publish, and run Kovca workflows from AI agents over remote MCP.
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
Agent-native notes, tasks, dev-docs, vaults, sync & handoffs. MCP + OpenAPI dual surface.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables building agent-ready APIs that expose tools as both HTTP and MCP endpoints from a single server definition, with automatic OpenAPI, discovery docs, and interactive API reference.5Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI tools to uniformly discover, inspect, and call tools, prompts, and resources from multiple upstream MCP servers through a small set of fixed MCP tools, over stdio or HTTP.2MIT
- AlicenseNot gradedqualityBmaintenanceEnables developers to expose a single set of tool definitions as MCP server tools over stdio or Streamable HTTP, so Claude Code, Codex, Claude Desktop and Cursor can call them with risk-based annotations, human-approved irreversible writes, typed structured results and long-running job handling built in. It also ships the same tools as a CLI from one source, keeping both surfaces in parity.629 npmApache 2.0
- AlicenseBqualityBmaintenanceEnables Python developers to define MCP tools via decorators, auto-generate schemas and tests, and package compliant MCP servers with CLI scaffolding and JSON-RPC 2.0 stdio transport.2MIT