Leasey
Starter

MCP Server Starter

Production-shaped MCP server template in TypeScript: auth, scoping, rate limits, tracing, and deploy targets for Lambda, Azure Functions, and Cloudflare Workers.

All resources8 min read

Shape your surface first

MCP exposes three things: resources (read), tools (write), and prompts (templates). Before writing code, list exactly which of each your server needs and the audience (internal, partner, public). Scope determines auth.

Auth at the gateway, scoping in the server

Put OAuth / SSO at the edge. Inside the server, enforce per-user scopes on every tool call. Never trust the client to filter results — the server owns authorization.

Rate limits and quotas

Per-user and per-tenant limits. One bad client should never take the server down for everyone. Quotas also make cost attribution trivial.

Transport: stdio vs HTTP/SSE

Local users (Claude Desktop power users) get stdio. Teams and partners get HTTP/SSE deployed to Lambda, Azure Functions, or Cloudflare Workers. The starter supports both.

Version contracts explicitly

MCP is evolving fast. Version your server surface and document what changed between versions. Clients break less often when contracts are explicit.

Observe every tool call

Trace input, scope, output, tokens, latency, and cost. The resulting dataset is gold for capacity planning and for catching misbehaving clients.

GitHub
View the starter repo
Want us to run this for you?

We turn these playbooks into paid engagements. Book a call and we'll scope it.

See engagements

Ready to accelerate your tech growth?

Schedule your free consultation today and let's discuss how we can help your business scale efficiently.

Tech growth illustration
Ready when you are

Let’s ship your AI system.

Whether you’re scoping a new LLM product, hardening an existing one, or standing up the infra behind it — we’ll map the shortest path to production.

Email the teamOther ways to reach us