MCP ExplorerExplorer

Mcp Server Ts Template

@jasonkneenon a year ago
1 MIT
FreeCommunity
AI Systems
Example mcp server in typescript

Overview

What is Mcp Server Ts Template

mcp-server-ts-template is a simple TypeScript template designed for building Model Context Protocol (MCP) servers that support basic CRUD operations and return JSON responses.

Use cases

Use cases for mcp-server-ts-template include creating a notes application, developing a simple task manager, or building a backend service for a front-end application that requires data management.

How to use

To use mcp-server-ts-template, install the dependencies using ‘npm install’, run the server in development mode with ‘npm run dev’, and for production, build the project using ‘npm run build’ followed by ‘npm start’.

Key features

Key features include a simple notes API with CRUD operations, in-memory data storage, TypeScript implementation, JSON responses, and readiness for testing with Vitest.

Where to use

mcp-server-ts-template can be used in various fields where a lightweight server is needed for managing data through CRUD operations, such as note-taking applications, task management tools, or any JSON-based API service.

Content

Simple TypeScript MCP Server

A simple TypeScript template for building Model Context Protocol (MCP) servers with basic CRUD operations. This template provides a foundation for creating MCP tools that return JSON responses.

Features

  • Simple notes API with CRUD operations
  • In-memory data storage
  • TypeScript implementation
  • JSON responses
  • Ready for testing with Vitest

Setup

npm install

Running the server

npm run dev

Building for production

npm run build
npm start

Available Tools

This template includes the following MCP tools:

  • getNote: Retrieve a note by ID
  • getAllNotes: Get all notes
  • createNote: Create a new note
  • updateNote: Update an existing note
  • deleteNote: Delete a note by ID

Testing

Run the tests with:

npm test

Or watch mode:

npm run test:watch

Customizing

You can use this template as a starting point for your own MCP server by modifying the tools in src/server.ts to fit your needs.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers