Skip to main content
Glama
AmAzing129
by AmAzing129

mcp-demo

一个最小可用的 MCP (Model Context Protocol) Server 示例,使用 TypeScript SDK 编写,演示 MCP 的三大核心原语:

原语

示例

说明

Tools

calculate / get_current_time / add_note

由模型调用的动作

Resources

info://server / note://{name}

客户端可读取的数据(含动态资源模板)

Prompts

code_review / summarize_notes

暴露给用户的提示词模板

通过 stdio 传输,可直接接入 Claude Desktop、Claude Code 或任何 MCP 客户端。

快速开始

npm install
npm run build
npm start          # 启动编译后的 server
# 或开发模式
npm run dev

Related MCP server: MCP Demo Server

使用 MCP Inspector 调试

npm run inspect

会启动一个网页版调试器,可以交互式地调用 tools、读取 resources、预览 prompts。

接入 Claude Code

claude mcp add mcp-demo -- node /path/to/mcp-demo/dist/index.js

接入 Claude Desktop

claude_desktop_config.json 中添加:

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

项目结构

src/
  index.ts    # 全部 server 逻辑:tools / resources / prompts 注册 + stdio 启动

示例交互

接入后可以试试:

  • “帮我算一下 123 × 456” → 触发 calculate 工具

  • “现在上海几点?” → 触发 get_current_time 工具

  • “记一条笔记 todo:明天写周报” → 触发 add_note,然后可通过 note://todo 资源读取

License

MIT

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A minimal demonstration server showcasing MCP protocol capabilities including tools, resources, and prompts with basic examples like hello world functionality.
    Last updated
    4
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    A demonstration MCP server showcasing tools (calculator, file operations, weather, timestamp), resources (server config, system info, documentation), and reusable prompt templates for code review, documentation, and debugging.
    Last updated
    Apache 2.0
  • A
    license
    -
    quality
    D
    maintenance
    A minimal template MCP server demonstrating basic tools, resources, and prompts functionality. Includes example implementations like a hello tool, history resource, and greet prompt for learning MCP development.
    Last updated
    4
    ISC
  • F
    license
    -
    quality
    B
    maintenance
    A simple MCP server demonstrating resources, tools, and prompts, including a greeting resource, an addition tool, and a calculation prompt.
    Last updated

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.

  • MCP server for generating rough-draft project plans from natural-language prompts.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AmAzing129/mcp-demo'

If you have feedback or need assistance with the MCP directory API, please join our Discord server