logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

mcp-ts-minimal-scaffold

A skeletal implementation of a Model Context Protocol (MCP) listener in TypeScript, featuring a rudimentary body mass index calculation utility and input schema assertion via the Zod library. It facilitates interaction over conventional standard input/output streams, serving as a barebones blueprint for bespoke MCP utilities.

Author

mcp-ts-minimal-scaffold logo

ChenReuven

No License

Quick Info

GitHub GitHub Stars 4
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

mcpprotocolapisprotocol mcpmcp toolsmcp server

Minimal MCP TypeScript Blueprint

This repository furnishes a lean TypeScript blueprint engineered for bootstrapping Model Context Protocol (MCP) service endpoints. It lays the groundwork for fabricating specialized MCP apparatuses designed for integration within advanced artificial intelligence ecosystems.

Conceptual Outline

This template embodies a rudimentary MCP host environment showcasing a trivial BMI computation module. Key demonstrations include:

  • Establishing an MCP host environment using TypeScript
  • Designating and realizing MCP operations complete with input validation leveraging Zod
  • Connecting the host service to system standard I/O channels for bidirectional data exchange

Prerequisites

  • Node.js runtime (version 20 or newer strongly suggested)
  • Package management tools: npm or yarn

Setup Instructions

  1. Acquire a local copy of this repository via cloning
  2. Install requisite external packages:

bash npm install

Directory Organization

  • index.ts - Primary service orchestration logic containing the initial sample tool
  • package.json - Manifest detailing project dependencies and execution scripts
  • tsconfig.json - TypeScript compiler configuration settings

Operational Guidance

Compilation and Launch

Initiate the build process and start the host service:

bash npm start

This command compiles the source TypeScript files into executable JavaScript and subsequently activates the MCP service listener.

Iterative Development

For active development cycles, developers may opt to:

  1. Modify the contents of index.ts to incorporate novel functional operations
  2. Execute the build directive for compilation:

bash npm run build

Implementing Novel Operations

To introduce a fresh operational capability, adhere to this structural template within index.ts:

typescript server.tool( "your-new-function-name", { // Define parameter contracts utilizing Zod assertions inputFieldLabel: z.number().min(1), // Integrate additional required fields as necessary }, async ({ inputFieldLabel }) => ({ content: [{ type: "text", text: "The outcome generated by your bespoke operation" }] }) );

Required Dependencies

  • @modelcontextprotocol/sdk - Essential framework components for MCP interaction
  • zod - Library utilized for rigorous input schema verification
  • dotenv - Utility for managing environment variables
  • typescript - The language compiler itself

Licensing

ISC License

Contribution Guidelines

We welcome external input! Feel empowered to submit a Pull Request detailing your enhancements.

See Also

`