MCP Tool Template logo

MCP Tool Template

by zubhav

This is a template repository for building Model Context Protocol (MCP) tools. It provides a foundation for creating MCP-compatible tools that can be used with AI agents.

View on GitHub

Last updated: N/A

MCP Tool Template

A template repository for building Model Context Protocol (MCP) tools.

Overview

This template provides a foundation for creating MCP-compatible tools that can be used with AI agents. Each tool follows the Model Context Protocol specification for standardized AI tool interactions.

Installation

npm install

Creating New Tools

Tools are defined in the src/tools directory. Each tool should:

  1. Define input/output schemas using Zod
  2. Implement the MCP protocol interface
  3. Include comprehensive tests

Tool Structure

src/
    └── calculator/
        ├── tools/
        │   ├── index.ts
        │   ├── add.ts
        │   └── subtract.ts
        ├── index.ts
        ├── prompt.ts
        └── schema.ts

Testing

Run the test suite:

npm run test