A production-ready template for building NimbleBrain MCP servers in TypeScript + Node.js.
Use this template to wrap any third-party REST API as an MCP server that ships as an .mcpb bundle via mpak.
- TypeScript project wired up with
@modelcontextprotocol/sdk - Zod-validated tool inputs and API responses
- Stdio entrypoint (
src/index.ts) and HTTP entrypoint (src/server.ts) via Streamable HTTP - Dockerfile for running the HTTP server in Docker
- Makefile with
build,test,lint,format,typecheck,bundle, and version-sync targets - GitHub Actions: CI (lint + test + bundle smoke test), release bundler, MTF security scanner
- Vitest test setup using
InMemoryTransportfor integration testing without a live server - Skill markdown template for authoring Claude Code companion skills
- Node.js 24+
- npm
mpak(for local testing)- Docker (optional, for HTTP transport testing)
jq(used by the Makefile for version management)
cp -r mcp-server-template-node-ts mcp-YOUR_SERVER_NAME
cd mcp-YOUR_SERVER_NAME| Placeholder | Replace with |
|---|---|
YOUR_SERVER_NAME |
Short identifier, e.g. github, linear, slack |
YOUR_DISPLAY_NAME |
Human-readable name, e.g. GitHub |
YOUR_REPO_NAME |
GitHub repo name, e.g. mcp-github |
YOUR_API_BASE_URL |
API base URL, e.g. https://api.github.com |
YOUR_API_KEY_ENV_VAR |
Env var name, e.g. GITHUB_TOKEN |
YOUR_API_HOST |
Hostname for MTF permissions, e.g. api.github.com |
YOUR_GITHUB_USERNAME |
Your GitHub handle |
In order:
src/utils/types.ts— Zod schemas for each API response typesrc/utils/apiClient.ts— rename the class and add methods for each endpointsrc/utils/schemas.ts— Zod schemas for each tool's inputsrc/utils/formatters.ts— formatters that strip noisy fields from API responsessrc/handlers/— one file per tool, following theexampleHandler.tspatternsrc/app.ts— register each tool withserver.registerTool()src/utils/config.ts— rename the env varsrc/constants.ts— setSERVER_NAMEmanifest.json+server.json— fill in allTODOfieldstests/— add fixture data and write tests for each tool
npm install
make check # format + lint + typecheck + tests
make bundle # build .mcpb locallympak config set @nimblebraininc/YOUR_SERVER_NAME api_key=your_key_here
mpak run --local ./YOUR_SERVER_NAME.mcpbUse MCP Inspector for a GUI:
npx @modelcontextprotocol/inspector mpak run --local ./YOUR_SERVER_NAME.mcpbSee ARCHITECTURE.md for a deep dive into how each part of the codebase works.
For bundle creation, testing, and Docker workflows, see CLAUDE.md.