MCP ExplorerExplorer

Mcp Server Typescript Template

@minimind-orgon 9 months ago
2 MIT
FreeCommunity
AI Systems
#ai#ai-tools#claude#mcp#mcp-server#server#template#typescript
MCP Server Typescript Template

Overview

What is Mcp Server Typescript Template

The mcp-server-typescript-template is a template for creating Model Context Protocol (MCP) servers using TypeScript. It provides a foundational structure for implementing a basic MCP server with custom tools.

Use cases

Use cases include developing custom AI applications, creating educational tools to demonstrate AI functionalities, and building prototypes for AI model integration.

How to use

To use the mcp-server-typescript-template, clone the repository, install the dependencies using npm or yarn, and configure the MCP client. Start the server by running the appropriate commands in the terminal.

Key features

Key features include a simple demonstration operation, an addition tool for adding two numbers, and the use of the Model Context Protocol SDK for communication between AI models and external tools.

Where to use

This template can be used in various fields that require integration of AI models with external tools, such as AI development, software engineering, and educational projects.

Content

MCP Server TypeScript Template

A template for creating Model Context Protocol (MCP) servers using TypeScript. This project demonstrates how to implement a simple MCP server with custom tools.

Overview

This template implements a basic MCP server that provides tools for:

  • Example operation: A simple demonstration operation
  • Addition: A tool that adds two numbers

The server uses the Model Context Protocol SDK to handle communication between AI models and external tools.

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn

Project Structure

The project is structured as follows:

mcp-server-typescript-template/
├── common/
│   ├── constant.ts     # Project constants
│   ├── errors.ts       # Error handling utilities
│   └── types.ts        # Type definitions
│   └── utils.ts        # Utility functions

├── operations/
│   └── example-operation.ts  # Implementation of example operations
├── index.ts            # Main server implementation
├── package.json
└── tsconfig.json

Installation

Clone the repository and install dependencies:

git clone <repository-url>
cd mcp-server-typescript-template
npm install
npm run test
npm run build
npm run start # this will start the server for testing

Configuration MCP Client (Claude Desktop)

edit your claude_desktop_config.json file to add the following:

{
  "mcpServers": {
    "example": {
      "command": "node",
      "args": [
        "/path/to/mcp-server-typescript-template/dist/index.js"
      ]
    }
  }
}

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers