mcp-template
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-template
A template for building MCP servers in TypeScript that a model uses correctly on the first try — whether it runs in an agent harness that fetches tool schemas on demand or in a small local model that carries every schema on every turn.
It was extracted from a production MCP server and stripped of its domain. What is left is the machinery that made that server reliable, with an in-memory notes store standing in for a real backend so that every pattern has a working, tested example.
What you get
One-file tools. A tool is a definition plus a
run(args)that returns plain data. Dispatch, timing, the MCP envelope and error mapping live in one base class; the router,tools/listand the contract tests are all derived from the definitions, so a listed tool is always callable and tested.Honest annotations. All four MCP hints on every tool, held there by tests — including on the wire, which is what directories such as OpenAI's check.
Profiles.
MCP_PROFILEpicks which tools are listed and routable, so a small client carries a small menu andreadonlygenuinely cannot write.A response budget. An over-sized answer is replaced by valid JSON that names the next step, never by a fragment a model will retry.
A capability gate. Tools the backend cannot serve are withheld before
tools/listanswers, and every failure path fails open.Self-documentation. The guides in
docs/and the skills inskills/are served as MCP resources and throughreadServerGuide/readSkill, so an agent can look things up by itself.Session recovery. Connect on demand, reconnect and retry once after a dropped session, and never retry a refused credential — retries lock accounts.
Two transports. stdio, and Streamable HTTP with one backend session per caller's bearer token, sessions bound to their token, origin and host allow-lists, and a per-session rate limit.
Docs that cannot drift. The tool reference is generated and a test compares it;
server.jsonis checked against every environment variable the code reads.A container. A two-stage Dockerfile that ships the docs and skills the server reads at runtime.
Related MCP server: notes-box
Quick start
git clone --recurse-submodules <this repository> my-server
cd my-server
npm install
npm run build
npm test
npm run smoke # drives the built server over stdio
npm run dev # the MCP Inspector, against the buildRegister it with a client:
{
"mcpServers": {
"notes": {
"command": "node",
"args": ["C:/path/to/my-server/dist/index.js"]
}
}
}Making it yours
AGENTS.md has the step-by-step list. In short:
rename it in package.json and server.json, replace the backend in src/backend/ and the tools in
src/handlers/, rewrite the domain parts of the docs, and swap the example skill. Every place that
needs a decision is marked TEMPLATE::
grep -rn "TEMPLATE" --exclude-dir=node_modules --exclude-dir=dist .Asking an agent to do it? Point it at AGENTS.md first — it was written for exactly that.
Configuration
Everything is optional; the example runs with no configuration. See .env.example.
Variable | Default | Effect |
|
|
|
| per profile | Ceiling on one answer; |
| on |
|
|
|
|
|
| Where HTTP mode listens |
| none | Browser origins allowed; |
| any |
|
|
| Requests per minute per session |
| none | Example backend: bearer tokens HTTP callers may present |
Running it for a team, over HTTP or in Docker: docs/Hosting.md.
Documentation
Document | For |
Working on this code — conventions, layout, how to test, how to start a new server | |
How the server behaves: architecture, profiles, budget, gate, errors, troubleshooting | |
Which tool does what, in the words people use | |
Every tool and argument — generated, never edited by hand | |
stdio, Streamable HTTP, Docker | |
The bundled engineering skills | |
Vocabulary and design decisions |
The guides are served to clients too: ask the running server with readServerGuide.
Development
npm run build # tsc -> dist/
npm test # vitest, fully offline
npx tsc --noEmit # type check only
npm run docs:tools # regenerate docs/Tool-Reference.md after changing a tool (needs a build)
npm run smoke # the built server over real stdioLicense
MIT — see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Agent-native notes, tasks, dev-docs, vaults, sync & handoffs. MCP + OpenAPI dual surface.
Google Keep-style notes app with an MCP server for AI agents to read/write notes.
Host any HTTP API as MCP tools with a tamper-evident cross-agent settlement ledger.
Persistent memory layer for AI tools. Save and recall notes across Claude and other MCP clients.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables users to create, retrieve, update, delete, and list notes through an MCP server, with persistent JSON storage and atomic writes.MIT
- AlicenseNot gradedqualityCmaintenanceEnables creating, retrieving, updating, deleting, and listing notes through a simple MCP interface, with configurable note storage.MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP-compatible clients to create, list, search, and delete notes, read all notes as markdown, and use prompts to summarize or clean up notes.MIT
- AlicenseNot gradedqualityBmaintenanceProvides a TypeScript MCP server scaffold that exposes tested, one-file tools to models with profile-scoped listings, honest annotations, response budgets, capability gating, and self-served guides and skills. Ships an in-memory notes backend as a working example and runs over stdio or Streamable HTTP.7 npm2GPL 3.0