MCP Server Demo logo

MCP Server Demo

by rectcircle

This is a demo server for the Model Context Protocol (MCP). It provides a basic example of how to set up and run an MCP server.

View on GitHub

Last updated: N/A

MCP Server Demo

# 创建并打开项目目录
mkdir mcp-server-demo
cd mcp-server-demo
npm init -y
code .

# 安装依赖
npm install @modelcontextprotocol/sdk zod
npm install -D @types/node typescript

# 创建源码目录和文件
mkdir -p src/cmd
touch src/cmd/time.ts
  • https://github.com/modelcontextprotocol/typescript-sdk
  • https://modelcontextprotocol.io/quickstart/server
  • https://github.com/modelcontextprotocol/servers/blob/main/src/filesystem/index.ts