Templates / MCP Server Starter (TypeScript)

MCP Server Starter (TypeScript)

A TypeScript Model Context Protocol server built on the official @modelcontextprotocol/sdk, with four tools (notes CRUD and a safe URL fetcher), a resource, a prompt template and an end-to-end test suite that talks to the server over stdio. Connect it to Claude Code, Cursor or Claude Desktop in one line, then replace the example tools with your own.

Who it's for

Developers who want to give Claude, Cursor or another AI client access to their own data or API without starting from a blank file.

What goes in

  • Node.js 18+
  • An MCP client (Claude Code, Cursor, Claude Desktop or similar)

What comes out

  • A running stdio MCP server
  • Tools: add_note, search_notes, delete_note, fetch_url
  • Resource notes://all and prompt summarize_notes
  • Passing end-to-end tests

Setup in 4 steps

  1. npm install && npm test.
  2. Add it to your client, e.g. claude mcp add notes -- node /path/dist/index.js.
  3. Ask your AI to save and search a note to see the tools work.
  4. Copy the registerTool pattern to add your own tools; add a test for each.

Tool stack

Claude Code, Cursor, Windsurf

Cost per run

Free to run locally. Model usage is billed by the MCP client that calls the tools; fetch output is capped at 20,000 characters by default.

What's included

  • TypeScript MCP server (official SDK, zod schemas, stdio)
  • End-to-end tests + MCP Inspector script + AGENTS.md
  • README setup guide
  • Offline sample data + tests
  • Honest cost notes
  • Changelog

FAQ

What is an MCP server?

A Model Context Protocol server exposes tools, resources and prompts that AI clients like Claude Code, Cursor and Claude Desktop can call. This starter is a complete, tested example you can extend.

Which transport does it use?

stdio, which is how local MCP clients launch servers. For a remote server you'd add the SDK's Streamable HTTP transport and authentication.

Is the fetch tool safe?

It blocks localhost and private network addresses, re-checks every redirect, and caps responses at 1 MB, so a prompt can't make it read your internal services.

Can I use Python instead?

This starter is TypeScript. The structure (one registerTool per tool, zod-validated inputs, tests through a real client) maps directly to the Python SDK.