MCP Server TS Starter
This MCP server lets clients read the time, search built-in documentation, inspect their connection/identity, and optionally integrate with a notes backend over stdio or authenticated HTTP.
Get the current date/time in any IANA timezone, defaulting to UTC.
Search the server’s docs with a query and return up to 10 matching results with links/snippets.
Check who the caller is: transport, client ID, and OAuth scopes.
Run locally over stdio or remotely over stateless Streamable HTTP with OAuth or static-token auth.
Extend with custom tools/resources; README also documents optional
list_notesandcreate_notebackend API tools.
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 TS Starter create a note titled Grocery List with milk and eggs"
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 TS starter
A production-ready Model Context Protocol server in TypeScript, ready to customize with coding agents. It runs over stdio for local clients and Streamable HTTP for remote ones, with OAuth, tests through real MCP clients, and a release pipeline.
Features
Current protocol: built on the official MCP SDK v2, 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 scope challenges, or static tokens. It won't start without an auth mode, and it checks
HostandOriginheaders.Sample tools:
get_time,search_docs, andwhoami, with input and output schemas, annotations, and readable errors, plusdocs://resources.Backend integration:
list_notesandcreate_notecall a REST API with timeouts, validated responses, and errors the model can act on, as a service account or as each user through token exchange. See Connect a backend API.Production-ready: graceful drain on shutdown, readiness checks, and OpenTelemetry traces and metrics. See Deploy.
Real tests: every tool is called through a real MCP client over HTTP and stdio, on both protocol eras.
Publishing: releases to npm, the MCP Registry, and GHCR, with a scanned, attested image and a test that keeps
server.jsonandpackage.jsonin step.Agent-ready:
AGENTS.md, skills, and checks that run on every commit.
Related MCP server: MCP TypeScript Template
Quick start
You need Node 26 or later and pnpm:
git clone https://github.com/opikdev/mcp-server-ts-starter
cd mcp-server-ts-starter
pnpm install
pnpm inspectThe MCP Inspector opens in your browser. Connect, list the tools, and call get_time. To try the notes tools too, see Connect a backend API.
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.
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-ts-starter my-mcp-serverOr select Use this template on GitHub. That copy keeps the name mcp-server-ts-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, and repo checks |
|
Test the built package and Docker image |
|
Build the npm package |
|
To use the server from Claude Code, Claude Desktop, Cursor, or VS Code, see Connect a client. Before you serve over HTTP outside your machine, read Configure HTTP auth and Deploy. To ship a release, see Publish a release.
To add a tool:
Create a file in
src/tools/withdefineTool, likesrc/tools/time.ts. Give it ascopeif it reads or changes data that needs one.Add it to the list in
src/tools/index.ts.Test it through a real client in
test/integration/, liketools.test.ts.Add a call to it in
test/integration/stdio.test.ts.
Project structure
Path | Purpose |
| One file per tool, and the tool list in |
| Resources and their data |
| Clients for backend APIs the tools call, and the credential they send |
| The HTTP app, auth gate, and server startup |
| OAuth and static token verifiers |
| Unit, integration, and end-to-end tests |
| The demo realm for |
| 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 documentation and returns the best matches, with links to read each one.
Inputs: query (required), limit. Returns: results
whoamiWho am IARead-onlyIdempotent
Returns how the caller is connected and, over HTTP, the authenticated 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 separate concern: time retrieval, documentation search, and caller identity/introspection. There is no plausible way to confuse them, and the descriptions state distinct outputs.
get_time and search_docs follow a clean verb_noun snake_case pattern, and whoami is a widely understood conventional identifier. The single outlier is idiomatic rather than confusing, so consistency is only slightly imperfect.
Three tools is on the thin side even for a starter template, and none of them constitute a real domain workflow. It is defensible as a reference/demo surface but sits at the borderline of feeling sparse.
The apparent domain is self-documentation and diagnostics, which is covered at a basic level, but there is no direct fetch/read-doc tool (search only returns links) and no environment or capability-introspection call beyond whoami. Minor but notable gaps for a starter server.
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Hosted MCP server with managed OAuth for 15+ toolkits: Google Workspace, Fitbit, Oura, Kalshi, etc.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
One OAuth connector for your team's remote MCP servers, with Tool Packs, guardrails and logs.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceA production-ready TypeScript MCP server providing basic tools (add, echo, timestamp), resources (server info, greetings, data access), and prompt templates (analyze, code-review, summarize). Serves as a foundation for building custom MCP servers with extensible architecture.547 npm-
- AlicenseNot gradedqualityDmaintenanceA production-grade TypeScript template for building Model Context Protocol (MCP) servers with declarative tools/resources, authentication, storage abstraction, and support for both local and edge deployment. Provides example echo tools and resources to demonstrate MCP server development patterns.Apache 2.0
- AlicenseBqualityDmaintenanceA TypeScript starter template for building MCP servers with example tools (echo, math operations, time, flight status) and resources (server info, greetings). Provides a modular architecture for easily extending with custom tools and resources.4MIT
- AlicenseNot gradedqualityBmaintenanceA feature-complete MCP server template in TypeScript demonstrating tools, resources, prompts, and both stdio and HTTP transports.8MIT