Skip to content

MCP Server (TypeScript)

Scaffolds a Model Context Protocol server in TypeScript using the official @modelcontextprotocol/sdk. Produces a working server with example tools and optional resource endpoints, configurable for stdio or streamable-http transport. Includes MCP Inspector integration for interactive debugging during development.

Namemcp-server-ts
Version0.1.0
Categoryai-systems
LicenseApache-2.0
Personaengineering
Tagsmcp, typescript, ai, tools, server
Sourcetemplates/mcp-server-ts

Render it

Three front doors, one catalog. Pick whichever suits the caller.

# CLI
npx @nanohype/sdk render mcp-server-ts --out ./my-app

# SDK
import { LocalSource, renderTemplate } from "@nanohype/sdk";
const result = await renderTemplate(source, "mcp-server-ts", variables);

# MCP — from an agent
get_template({ name: "mcp-server-ts" })

Prerequisites

ToolVersionWhy
node>=22Node.js runtime for the MCP server
npmPackage management and script execution

Variables

Required

ProjectName string
Kebab-case project name, used as package name and directory Must be lowercase kebab-case starting with a letter.
ServerName string
Human-readable server name displayed in MCP client UIs

Optional

Description string — defaults to An MCP server
Short project description for package.json and README
Transport enum — defaults to stdio
Server transport protocol One of: stdiostreamable-http.
IncludeResources bool — defaults to true
Include example MCP resource endpoints

What it produces

18 files. Placeholder names such as __APP_NAME__ are what the renderer substitutes into.

.env.example
.gitignore
biome.json
package.json
README.md
src/__tests__/server.test.ts
src/__tests__/tools.test.ts
src/bootstrap.ts
src/index.ts
src/logger.ts
src/resources/example.ts
src/server.ts
src/tools/example.ts
src/transports/index.ts
src/transports/stdio.ts
src/transports/streamable-http.ts
tsconfig.json
vitest.config.ts

Composes with

Composites that use it

  • Agent Team — Multi-agent system with a central orchestrator, specialized agents for research and writing, an evaluation harness, and MCP tool server.
  • Chrome AI Extension — Chrome extension with AI sidepanel backed by MCP tool servers and optional prompt library..
  • Enterprise AI Infrastructure — Full enterprise AI stack with agents, tool servers, safety guardrails, evaluation, prompt management, observability, and Kubernetes deployment..
  • Internal Tool — CLI tool or browser extension backed by MCP servers for internal team use..
  • MCP Toolkit — MCP server with evaluation harness, prompt library, and deployment.
  • Multi-Agent System — Multi-agent architecture with A2A protocol peers, MCP tool servers, and an orchestrating agent.
  • VS Code AI Extension — VS Code extension with AI provider integration, MCP tool servers, and versioned prompt management..