Skip to main content
Glama
Simple TypeScript MCP Server

Simple TypeScript MCP Server

by jasonkneen

简单的 TypeScript MCP 服务器

一个简单的 TypeScript 模板,用于构建具有基本 CRUD 操作的模型上下文协议 (MCP) 服务器。此模板为创建返回 JSON 响应的 MCP 工具奠定了基础。

特征

  • 具有 CRUD 操作的简单注释 API

  • 内存数据存储

  • TypeScript 实现

  • JSON 响应

  • 准备使用 Vitest 进行测试

Related MCP server: MCP Server Starter

设置

npm install

运行服务器

npm run dev

生产环境构建

npm run build
npm start

可用工具

该模板包含以下 MCP 工具:

  • getNote :通过 ID 检索注释

  • getAllNotes :获取所有笔记

  • createNote :创建新笔记

  • updateNote :更新现有注释

  • deleteNote :通过 ID 删除注释

测试

使用以下命令运行测试:

npm test

或者观看模式:

npm run test:watch

定制

您可以使用此模板作为您自己的 MCP 服务器的起点,通过修改src/server.ts中的工具来满足您的需求。

Available Tools

5 tools
createNoteD

Inputs: title (required), content (required).

deleteNoteD

Inputs: noteId (required).

getAllNotesD

Inputs: no named parameters.

getNoteD

Inputs: noteId (required).

updateNoteD

Inputs: noteId (required), title, content.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.2/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: createNote, deleteNote, getAllNotes, getNote, and updateNote cover different CRUD operations on notes. The action (create, delete, get, update) and scope (all vs. single) make them easily distinguishable.

    Naming Consistency5/5

    All tools follow a consistent verbNoun pattern in camelCase (e.g., createNote, deleteNote). The naming is uniform across all five tools, with no deviations in style or convention.

    Tool Count5/5

    With 5 tools, this server is well-scoped for managing notes, covering essential CRUD operations. Each tool serves a clear purpose without redundancy, making the count appropriate for the domain.

    Completeness5/5

    The tool set provides complete CRUD coverage for notes: create, read (get and getAll), update, and delete. There are no obvious gaps, as all lifecycle operations are included, allowing agents to handle full workflows without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers