From 6e8a93c8e9b2a1b456c6745488925362ad6bee42 Mon Sep 17 00:00:00 2001 From: CHE LIANG ZHAO Date: Fri, 16 Jan 2026 18:21:32 +0800 Subject: [PATCH] Initial commit --- .github/copilot-instructions.md | 53 ++ .gitignore | 32 + .vscode/mcp.json | 13 + README.md | 157 ++++ demo.db | Bin 0 -> 20480 bytes golang/demo.db | Bin 0 -> 20480 bytes golang/go.mod | 14 + golang/go.sum | 16 + golang/main.go | 293 ++++++ typescript/package-lock.json | 1162 ++++++++++++++++++++++++ typescript/package.json | 32 + typescript/src/index.ts | 29 + typescript/src/prompts/index.ts | 15 + typescript/src/prompts/list-skills.ts | 74 ++ typescript/src/prompts/math-helper.ts | 35 + typescript/src/prompts/process-text.ts | 59 ++ typescript/src/resources/index.ts | 9 + typescript/src/resources/skills.ts | 56 ++ typescript/src/resources/tool-info.ts | 123 +++ typescript/src/server.ts | 7 + typescript/src/tools/calculator.ts | 56 ++ typescript/src/tools/echo.ts | 24 + typescript/src/tools/index.ts | 21 + typescript/src/tools/random.ts | 39 + typescript/src/tools/string.ts | 51 ++ typescript/src/tools/time.ts | 48 + typescript/tsconfig.json | 23 + 27 files changed, 2441 insertions(+) create mode 100644 .github/copilot-instructions.md create mode 100644 .gitignore create mode 100644 .vscode/mcp.json create mode 100644 README.md create mode 100644 demo.db create mode 100644 golang/demo.db create mode 100644 golang/go.mod create mode 100644 golang/go.sum create mode 100644 golang/main.go create mode 100644 typescript/package-lock.json create mode 100644 typescript/package.json create mode 100644 typescript/src/index.ts create mode 100644 typescript/src/prompts/index.ts create mode 100644 typescript/src/prompts/list-skills.ts create mode 100644 typescript/src/prompts/math-helper.ts create mode 100644 typescript/src/prompts/process-text.ts create mode 100644 typescript/src/resources/index.ts create mode 100644 typescript/src/resources/skills.ts create mode 100644 typescript/src/resources/tool-info.ts create mode 100644 typescript/src/server.ts create mode 100644 typescript/src/tools/calculator.ts create mode 100644 typescript/src/tools/echo.ts create mode 100644 typescript/src/tools/index.ts create mode 100644 typescript/src/tools/random.ts create mode 100644 typescript/src/tools/string.ts create mode 100644 typescript/src/tools/time.ts create mode 100644 typescript/tsconfig.json diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..6566cc6 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,53 @@ +# MCP Demo Server - Copilot Instructions + +## 项目概述 + +这是一个 Model Context Protocol (MCP) 服务器示例项目,使用 TypeScript 编写。 + +## 技术栈 + +- **语言**: TypeScript +- **运行时**: Node.js +- **MCP SDK**: @modelcontextprotocol/sdk +- **Schema 验证**: Zod + +## 项目结构 + +- `src/index.ts` - MCP 服务器主入口文件 +- `build/` - 编译后的 JavaScript 文件 +- `.vscode/mcp.json` - VS Code MCP 服务器配置 + +## 开发指南 + +### 添加新工具 + +使用 `server.registerTool()` 方法注册新工具: + +```typescript +server.registerTool( + "tool_name", + { + description: "工具描述", + inputSchema: { + // 使用 Zod schema 定义参数 + }, + }, + async (params) => { + // 实现工具逻辑 + return { + content: [{ type: "text", text: "结果" }], + }; + } +); +``` + +### 常用命令 + +- `npm run build` - 编译 TypeScript +- `npm start` - 运行 MCP 服务器 +- `npm run dev` - 开发模式(监听文件变化) + +## MCP 参考文档 + +- SDK 文档: https://github.com/modelcontextprotocol/typescript-sdk +- 协议规范: https://modelcontextprotocol.io/ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30c4cc2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +# Dependencies +node_modules/ + +# Build outputs +typescript/build/ + +# Go binaries +golang/*.exe +golang/*.dll +golang/*.so +golang/*.dylib + +# IDE +.idea/ +*.swp +*.swo +.DS_Store + +# Logs +*.log +npm-debug.log* + +# Environment +.env +.env.local +.env.*.local + +# Temporary files +*.tmp +*.temp + +*.db diff --git a/.vscode/mcp.json b/.vscode/mcp.json new file mode 100644 index 0000000..b302319 --- /dev/null +++ b/.vscode/mcp.json @@ -0,0 +1,13 @@ +{ + "servers": { + "mcp-demo-ts": { + "type": "stdio", + "command": "node", + "args": ["typescript/build/index.js"] + }, + "mcp-demo-go": { + "type": "stdio", + "command": "${workspaceFolder}/golang/mcp-demo-go.exe" + } + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..eee4ac8 --- /dev/null +++ b/README.md @@ -0,0 +1,157 @@ +# MCP Demo Server + +一个使用 TypeScript 构建的 Model Context Protocol (MCP) 服务器示例,展示了如何创建和注册各种工具。 + +## 功能特性 + +此 MCP 服务器提供以下示例工具: + +| 工具名称 | 描述 | +|---------|------| +| `echo` | 回显传入的消息 | +| `calculator` | 执行基本数学运算(加、减、乘、除) | +| `get_current_time` | 获取当前日期和时间(支持时区) | +| `random_number` | 在指定范围内生成随机数 | +| `string_utils` | 字符串处理工具(大小写转换、反转、计数等) | + +## 快速开始 + +### 安装依赖 + +```bash +npm install +``` + +### 编译项目 + +```bash +npm run build +``` + +### 运行服务器 + +```bash +npm start +``` + +## 在 VS Code 中使用 + +项目已配置好 `.vscode/mcp.json`,可以直接在 VS Code 中使用此 MCP 服务器: + +1. 确保已编译项目 (`npm run build`) +2. 在 VS Code 中打开此项目 +3. MCP 服务器会自动被识别并可用 + +## 配置示例 + +### Claude Desktop 配置 + +将以下内容添加到 Claude Desktop 的配置文件中: + +**Windows**: `%APPDATA%\Claude\claude_desktop_config.json` +**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json` + +```json +{ + "mcpServers": { + "mcp-demo": { + "command": "node", + "args": ["D:\\Projects\\McpDemo\\build\\index.js"] + } + } +} +``` + +## 工具使用示例 + +### Echo 工具 +``` +输入: { "message": "Hello, MCP!" } +输出: "Echo: Hello, MCP!" +``` + +### Calculator 工具 +``` +输入: { "operation": "add", "a": 10, "b": 5 } +输出: "10 add 5 = 15" +``` + +### Get Current Time 工具 +``` +输入: { "timezone": "Asia/Shanghai" } +输出: "Current time: 1/16/2026, 2:30:00 PM" +``` + +### Random Number 工具 +``` +输入: { "min": 1, "max": 100 } +输出: "Random number between 1 and 100: 42" +``` + +### String Utils 工具 +``` +输入: { "operation": "uppercase", "text": "hello world" } +输出: "HELLO WORLD" +``` + +## 项目结构 + +``` +McpDemo/ +├── src/ +│ └── index.ts # MCP 服务器主文件 +├── build/ # 编译输出目录 +├── .vscode/ +│ └── mcp.json # VS Code MCP 配置 +├── package.json +├── tsconfig.json +└── README.md +``` + +## 开发指南 + +### 添加新工具 + +在 `src/index.ts` 中使用 `server.registerTool()` 添加新工具: + +```typescript +server.registerTool( + "tool_name", + { + description: "工具描述", + inputSchema: { + param1: z.string().describe("参数1描述"), + param2: z.number().describe("参数2描述"), + }, + }, + async ({ param1, param2 }) => { + // 工具逻辑 + return { + content: [ + { + type: "text", + text: "结果", + }, + ], + }; + } +); +``` + +### 开发模式 + +使用 watch 模式进行开发: + +```bash +npm run dev +``` + +## 相关资源 + +- [MCP 官方文档](https://modelcontextprotocol.io/) +- [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk) +- [MCP 服务器示例](https://github.com/modelcontextprotocol/servers) + +## 许可证 + +MIT diff --git a/demo.db b/demo.db new file mode 100644 index 0000000000000000000000000000000000000000..0b953ea1a055abdb56abaf60ef58235a2494c4f6 GIT binary patch literal 20480 zcmeI(&r1|x7zgn8o!Qk^(zi$&q@e@t&6}Z4t-qgcX-)HCRjf1|t5t5gK^vYf=qW?zMrtaf z^B~Fxx+0N?ZSi!@(C_L6o-d@cslp<^r!VqU(U?o;WL{R!8N=QO>t;=GLw{iK+?=e% zOvVqdH0-kAa{PAJZ93)3&k<+z*;FxO@R%H6Ft2uKLql}YpQ5{3m5;9_SFE-~y(~_2 zL&qk3;^KfelVO=TxH(HZHBF;i6@Sc@D;lnUP>$vMp+B=)Q8VpoTcMas&lh#yz+4i+ zlKp0+TENlRXE!ANEE9?hWAq219avFnyt|FK-N)pY!R z$)A5I?l-Eu(Jpv5oA)rTGK;Wx?73`EAOHafKmY;|fB*y_009U<00Iy=qd-FKAboL~ zJluY=|K{nMSzlUfO^S81wo(-%WvAAch$Y6Nv3N8-#$)3XiLr_JcubKwQJVbpV*6lc zr)sz{} zfB*y_009U<00Izz00bcL*95Mrar*0Sg4(M_>B$WPMN>y3r|k)NzyB-jkg%`vfC2#s zKmY;|fB*y_009U<00Izzz zW=!y6A_ z;E%0JNw4wz{}fB*y_009U<00Izzz`qq(z2)&K9UXK{sp^l4#zMs^)bdrko_ohKYD`nP78^~d zyxz(?oBV#iS>W-MrruLCJe`RrW0@I#U!CExtTq`>iMXVi(t4a9mi3asHT9v!QO?G?(0EXE(3O@OlW>Yx8cOHQT7z?nyck?>7CN*%~F?EFLOkQ}L;+>Kf>? zMt#a|Jzp{Os!_;^h55K}*WyW)*D1!bnT#OKIgQg=ESYv_x}*l>u0n}fE*Q&4)75KL z%dO|!@#jKrCW{BH(RtVcEKWSEg|JU-gB4hdC?Y`s0uX=z1Rwwb2tWV=5P$##E`mV6 zw}G?`(8%uVXL}p#%cgFX%<}Arv8{9J`cWozQ!b8#UP*4&vy)?4-a(#DmvuN7p z@d$oKL_a+m_V%ltcTZO4#NXI@`FPZgGoqTW?Srl9bAN4j5$I80uX=z z1Rwwb2tWV=5P$##&Xd43d4Qg^0pYxs@AX`jL-hCE1i4l2rKdLxBt;(ZpS368yo@ig zeZszr6A}a<009U<00Izz00bZa0SG_<0{^qXB}wj}^)EJLKa~~geh1)n*8ej5K-f3- zRb)sIfB*y_009U<00Izz00bZa0SKH+fmYc|Zc9?ktfZ}i&C?ajH%~scNKPwF>iJR2 bns-{GFTz)-m)w-7nVz%C1`iFiKPdbJ%{U+v literal 0 HcmV?d00001 diff --git a/golang/go.mod b/golang/go.mod new file mode 100644 index 0000000..6ffac8b --- /dev/null +++ b/golang/go.mod @@ -0,0 +1,14 @@ +module mcp-demo-go + +go 1.23.0 + +require ( + github.com/mattn/go-sqlite3 v1.14.24 + github.com/modelcontextprotocol/go-sdk v1.2.0 +) + +require ( + github.com/google/jsonschema-go v0.3.0 // indirect + github.com/yosida95/uritemplate/v3 v3.0.2 // indirect + golang.org/x/oauth2 v0.30.0 // indirect +) diff --git a/golang/go.sum b/golang/go.sum new file mode 100644 index 0000000..e20e865 --- /dev/null +++ b/golang/go.sum @@ -0,0 +1,16 @@ +github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= +github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/jsonschema-go v0.3.0 h1:6AH2TxVNtk3IlvkkhjrtbUc4S8AvO0Xii0DxIygDg+Q= +github.com/google/jsonschema-go v0.3.0/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE= +github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM= +github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/modelcontextprotocol/go-sdk v1.2.0 h1:Y23co09300CEk8iZ/tMxIX1dVmKZkzoSBZOpJwUnc/s= +github.com/modelcontextprotocol/go-sdk v1.2.0/go.mod h1:6fM3LCm3yV7pAs8isnKLn07oKtB0MP9LHd3DfAcKw10= +github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= +github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= +golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= +golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= +golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= +golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= diff --git a/golang/main.go b/golang/main.go new file mode 100644 index 0000000..2bfd1f2 --- /dev/null +++ b/golang/main.go @@ -0,0 +1,293 @@ +package main + +import ( + "context" + "database/sql" + "encoding/json" + "fmt" + "log" + "os" + "path/filepath" + "strings" + + _ "github.com/mattn/go-sqlite3" + "github.com/modelcontextprotocol/go-sdk/mcp" +) + +var db *sql.DB + +// ==================== 数据库初始化 ==================== + +func initDB() error { + // 获取可执行文件所在目录 + execPath, err := os.Executable() + if err != nil { + execPath = "." + } + dbPath := filepath.Join(filepath.Dir(execPath), "demo.db") + + // 如果数据库不存在,使用当前目录 + if _, err := os.Stat(dbPath); os.IsNotExist(err) { + dbPath = "demo.db" + } + + db, err = sql.Open("sqlite3", dbPath) + if err != nil { + return err + } + + // 创建示例表 + _, err = db.Exec(` + CREATE TABLE IF NOT EXISTS users ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + email TEXT UNIQUE, + age INTEGER, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP + ); + + CREATE TABLE IF NOT EXISTS products ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + price REAL, + stock INTEGER DEFAULT 0 + ); + `) + if err != nil { + return err + } + + // 插入示例数据(如果表为空) + var count int + db.QueryRow("SELECT COUNT(*) FROM users").Scan(&count) + if count == 0 { + _, err = db.Exec(` + INSERT INTO users (name, email, age) VALUES + ('张三', 'zhangsan@example.com', 28), + ('李四', 'lisi@example.com', 32), + ('王五', 'wangwu@example.com', 25); + + INSERT INTO products (name, price, stock) VALUES + ('iPhone 15', 6999.00, 100), + ('MacBook Pro', 14999.00, 50), + ('AirPods Pro', 1899.00, 200); + `) + if err != nil { + return err + } + } + + return nil +} + +// ==================== 工具输入结构 ==================== + +// ListTablesInput - 列出所有表 +type ListTablesInput struct{} + +// QueryInput - 执行 SQL 查询 +type QueryInput struct { + SQL string `json:"sql" mcp:"SQL query to execute (SELECT only for safety)"` +} + +// GetUserInput - 获取用户 +type GetUserInput struct { + ID int `json:"id" mcp:"User ID to retrieve"` +} + +// AddUserInput - 添加用户 +type AddUserInput struct { + Name string `json:"name" mcp:"User name"` + Email string `json:"email" mcp:"User email address"` + Age int `json:"age" mcp:"User age"` +} + +// DeleteUserInput - 删除用户 +type DeleteUserInput struct { + ID int `json:"id" mcp:"User ID to delete"` +} + +// ==================== 辅助函数 ==================== + +func textResult(text string) (*mcp.CallToolResult, any, error) { + return &mcp.CallToolResult{ + Content: []mcp.Content{ + &mcp.TextContent{Text: text}, + }, + }, nil, nil +} + +func errorResult(text string) (*mcp.CallToolResult, any, error) { + return &mcp.CallToolResult{ + Content: []mcp.Content{ + &mcp.TextContent{Text: text}, + }, + IsError: true, + }, nil, nil +} + +// ==================== 工具实现 ==================== + +// ListTables - 列出数据库中的所有表 +func ListTables(ctx context.Context, req *mcp.CallToolRequest, input ListTablesInput) (*mcp.CallToolResult, any, error) { + rows, err := db.Query("SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'") + if err != nil { + return errorResult(fmt.Sprintf("Failed to list tables: %v", err)) + } + defer rows.Close() + + var tables []string + for rows.Next() { + var name string + rows.Scan(&name) + tables = append(tables, name) + } + + result, _ := json.MarshalIndent(tables, "", " ") + return textResult(fmt.Sprintf("Tables in database:\n%s", string(result))) +} + +// QueryDB - 执行 SQL 查询 +func QueryDB(ctx context.Context, req *mcp.CallToolRequest, input QueryInput) (*mcp.CallToolResult, any, error) { + // 安全检查:只允许 SELECT 查询 + sqlUpper := strings.ToUpper(strings.TrimSpace(input.SQL)) + if !strings.HasPrefix(sqlUpper, "SELECT") { + return errorResult("Only SELECT queries are allowed for safety") + } + + rows, err := db.Query(input.SQL) + if err != nil { + return errorResult(fmt.Sprintf("Query failed: %v", err)) + } + defer rows.Close() + + // 获取列名 + columns, _ := rows.Columns() + + // 读取所有行 + var results []map[string]interface{} + for rows.Next() { + values := make([]interface{}, len(columns)) + valuePtrs := make([]interface{}, len(columns)) + for i := range values { + valuePtrs[i] = &values[i] + } + + rows.Scan(valuePtrs...) + + row := make(map[string]interface{}) + for i, col := range columns { + row[col] = values[i] + } + results = append(results, row) + } + + jsonResult, _ := json.MarshalIndent(results, "", " ") + return textResult(fmt.Sprintf("Query results (%d rows):\n%s", len(results), string(jsonResult))) +} + +// GetUser - 获取单个用户 +func GetUser(ctx context.Context, req *mcp.CallToolRequest, input GetUserInput) (*mcp.CallToolResult, any, error) { + var id int + var name, email string + var age int + var createdAt string + + err := db.QueryRow("SELECT id, name, email, age, created_at FROM users WHERE id = ?", input.ID). + Scan(&id, &name, &email, &age, &createdAt) + if err == sql.ErrNoRows { + return errorResult(fmt.Sprintf("User with ID %d not found", input.ID)) + } + if err != nil { + return errorResult(fmt.Sprintf("Query failed: %v", err)) + } + + user := map[string]interface{}{ + "id": id, + "name": name, + "email": email, + "age": age, + "created_at": createdAt, + } + + jsonResult, _ := json.MarshalIndent(user, "", " ") + return textResult(string(jsonResult)) +} + +// AddUser - 添加用户 +func AddUser(ctx context.Context, req *mcp.CallToolRequest, input AddUserInput) (*mcp.CallToolResult, any, error) { + result, err := db.Exec("INSERT INTO users (name, email, age) VALUES (?, ?, ?)", + input.Name, input.Email, input.Age) + if err != nil { + return errorResult(fmt.Sprintf("Failed to add user: %v", err)) + } + + id, _ := result.LastInsertId() + return textResult(fmt.Sprintf("User added successfully with ID: %d", id)) +} + +// DeleteUser - 删除用户 +func DeleteUser(ctx context.Context, req *mcp.CallToolRequest, input DeleteUserInput) (*mcp.CallToolResult, any, error) { + result, err := db.Exec("DELETE FROM users WHERE id = ?", input.ID) + if err != nil { + return errorResult(fmt.Sprintf("Failed to delete user: %v", err)) + } + + affected, _ := result.RowsAffected() + if affected == 0 { + return errorResult(fmt.Sprintf("User with ID %d not found", input.ID)) + } + + return textResult(fmt.Sprintf("User with ID %d deleted successfully", input.ID)) +} + +// ==================== 主函数 ==================== + +func main() { + // 初始化数据库 + if err := initDB(); err != nil { + log.Fatalf("Failed to initialize database: %v", err) + } + defer db.Close() + + // 创建 MCP Server + server := mcp.NewServer( + &mcp.Implementation{ + Name: "mcp-demo-go", + Version: "1.0.0", + }, + nil, + ) + + // 注册工具 + mcp.AddTool(server, &mcp.Tool{ + Name: "list_tables", + Description: "List all tables in the SQLite database", + }, ListTables) + + mcp.AddTool(server, &mcp.Tool{ + Name: "query_db", + Description: "Execute a SELECT SQL query on the database", + }, QueryDB) + + mcp.AddTool(server, &mcp.Tool{ + Name: "get_user", + Description: "Get a user by ID from the users table", + }, GetUser) + + mcp.AddTool(server, &mcp.Tool{ + Name: "add_user", + Description: "Add a new user to the database", + }, AddUser) + + mcp.AddTool(server, &mcp.Tool{ + Name: "delete_user", + Description: "Delete a user from the database by ID", + }, DeleteUser) + + // 运行服务器 + log.Println("MCP Demo Go Server (SQLite) is running...") + if err := server.Run(context.Background(), &mcp.StdioTransport{}); err != nil { + log.Fatalf("Server error: %v", err) + } +} diff --git a/typescript/package-lock.json b/typescript/package-lock.json new file mode 100644 index 0000000..d57c4df --- /dev/null +++ b/typescript/package-lock.json @@ -0,0 +1,1162 @@ +{ + "name": "mcp-demo-server", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "mcp-demo-server", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@modelcontextprotocol/sdk": "^1.12.0", + "zod": "^3.24.0" + }, + "bin": { + "mcp-demo": "build/index.js" + }, + "devDependencies": { + "@types/node": "^22.10.0", + "typescript": "^5.7.0" + } + }, + "node_modules/@hono/node-server": { + "version": "1.19.9", + "resolved": "https://registry.npmmirror.com/@hono/node-server/-/node-server-1.19.9.tgz", + "integrity": "sha512-vHL6w3ecZsky+8P5MD+eFfaGTyCeOHUIFYMGpQGbrBTSmNNoxv0if69rEZ5giu36weC5saFuznL411gRX7bJDw==", + "license": "MIT", + "engines": { + "node": ">=18.14.1" + }, + "peerDependencies": { + "hono": "^4" + } + }, + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.25.2", + "resolved": "https://registry.npmmirror.com/@modelcontextprotocol/sdk/-/sdk-1.25.2.tgz", + "integrity": "sha512-LZFeo4F9M5qOhC/Uc1aQSrBHxMrvxett+9KLHt7OhcExtoiRN9DKgbZffMP/nxjutWDQpfMDfP3nkHI4X9ijww==", + "license": "MIT", + "dependencies": { + "@hono/node-server": "^1.19.7", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "eventsource-parser": "^3.0.0", + "express": "^5.0.1", + "express-rate-limit": "^7.5.0", + "jose": "^6.1.1", + "json-schema-typed": "^8.0.2", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.25 || ^4.0", + "zod-to-json-schema": "^3.25.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@cfworker/json-schema": "^4.1.1", + "zod": "^3.25 || ^4.0" + }, + "peerDependenciesMeta": { + "@cfworker/json-schema": { + "optional": true + }, + "zod": { + "optional": false + } + } + }, + "node_modules/@types/node": { + "version": "22.19.7", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.19.7.tgz", + "integrity": "sha512-MciR4AKGHWl7xwxkBa6xUGxQJ4VBOmPTF7sL+iGzuahOFaO0jHCsuEfS80pan1ef4gWId1oWOweIhrDEYLuaOw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/body-parser": { + "version": "2.2.2", + "resolved": "https://registry.npmmirror.com/body-parser/-/body-parser-2.2.2.tgz", + "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.1", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/content-disposition/-/content-disposition-1.0.1.tgz", + "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmmirror.com/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmmirror.com/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmmirror.com/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventsource": { + "version": "3.0.7", + "resolved": "https://registry.npmmirror.com/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", + "license": "MIT", + "dependencies": { + "eventsource-parser": "^3.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/eventsource-parser": { + "version": "3.0.6", + "resolved": "https://registry.npmmirror.com/eventsource-parser/-/eventsource-parser-3.0.6.tgz", + "integrity": "sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmmirror.com/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express-rate-limit": { + "version": "7.5.1", + "resolved": "https://registry.npmmirror.com/express-rate-limit/-/express-rate-limit-7.5.1.tgz", + "integrity": "sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw==", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": ">= 4.11" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/fast-uri/-/fast-uri-3.1.0.tgz", + "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hono": { + "version": "4.11.4", + "resolved": "https://registry.npmmirror.com/hono/-/hono-4.11.4.tgz", + "integrity": "sha512-U7tt8JsyrxSRKspfhtLET79pU8K+tInj5QZXs1jSugO1Vq5dFj3kmZsRldo29mTBfcjDRVRXrEZ6LS63Cog9ZA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/jose": { + "version": "6.1.3", + "resolved": "https://registry.npmmirror.com/jose/-/jose-6.1.3.tgz", + "integrity": "sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/json-schema-typed": { + "version": "8.0.2", + "resolved": "https://registry.npmmirror.com/json-schema-typed/-/json-schema-typed-8.0.2.tgz", + "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==", + "license": "BSD-2-Clause" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmmirror.com/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmmirror.com/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.3.0", + "resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-8.3.0.tgz", + "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/pkce-challenge": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/pkce-challenge/-/pkce-challenge-5.0.1.tgz", + "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==", + "license": "MIT", + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmmirror.com/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.14.1", + "resolved": "https://registry.npmmirror.com/qs/-/qs-6.14.1.tgz", + "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmmirror.com/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-to-json-schema": { + "version": "3.25.1", + "resolved": "https://registry.npmmirror.com/zod-to-json-schema/-/zod-to-json-schema-3.25.1.tgz", + "integrity": "sha512-pM/SU9d3YAggzi6MtR4h7ruuQlqKtad8e9S0fmxcMi+ueAK5Korys/aWcV9LIIHTVbj01NdzxcnXSN+O74ZIVA==", + "license": "ISC", + "peerDependencies": { + "zod": "^3.25 || ^4" + } + } + } +} diff --git a/typescript/package.json b/typescript/package.json new file mode 100644 index 0000000..ffe93d1 --- /dev/null +++ b/typescript/package.json @@ -0,0 +1,32 @@ +{ + "name": "mcp-demo-server", + "version": "1.0.0", + "description": "A demo MCP server with example tools", + "type": "module", + "bin": { + "mcp-demo": "./build/index.js" + }, + "scripts": { + "build": "tsc", + "start": "node build/index.js", + "dev": "tsc --watch" + }, + "files": [ + "build" + ], + "dependencies": { + "@modelcontextprotocol/sdk": "^1.12.0", + "zod": "^3.24.0" + }, + "devDependencies": { + "@types/node": "^22.10.0", + "typescript": "^5.7.0" + }, + "keywords": [ + "mcp", + "model-context-protocol", + "ai", + "tools" + ], + "license": "MIT" +} diff --git a/typescript/src/index.ts b/typescript/src/index.ts new file mode 100644 index 0000000..03a2c74 --- /dev/null +++ b/typescript/src/index.ts @@ -0,0 +1,29 @@ +#!/usr/bin/env node + +/** + * MCP Demo Server - TypeScript + * + * A demonstration MCP server with modular architecture: + * - Tools: echo, calculator, time, random, string utilities + * - Resources: skills capabilities, tool info + * - Prompts: list-skills, process-text, math-helper + */ + +import { server } from "./server.js"; +import { registerAllTools } from "./tools/index.js"; +import { registerAllResources } from "./resources/index.js"; +import { registerAllPrompts } from "./prompts/index.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; + +// Register all modules +registerAllTools(); +registerAllResources(); +registerAllPrompts(); + +// Start the server +async function main() { + await server.connect(new StdioServerTransport()); + console.error("MCP Demo Server (TypeScript) running on stdio"); +} + +main().catch(console.error); diff --git a/typescript/src/prompts/index.ts b/typescript/src/prompts/index.ts new file mode 100644 index 0000000..0408253 --- /dev/null +++ b/typescript/src/prompts/index.ts @@ -0,0 +1,15 @@ +import { registerListSkillsPrompt } from "./list-skills.js"; +import { registerProcessTextPrompt } from "./process-text.js"; +import { registerMathHelperPrompt } from "./math-helper.js"; + +export function registerAllPrompts() { + registerListSkillsPrompt(); + registerProcessTextPrompt(); + registerMathHelperPrompt(); +} + +export { + registerListSkillsPrompt, + registerProcessTextPrompt, + registerMathHelperPrompt, +}; diff --git a/typescript/src/prompts/list-skills.ts b/typescript/src/prompts/list-skills.ts new file mode 100644 index 0000000..0c6b361 --- /dev/null +++ b/typescript/src/prompts/list-skills.ts @@ -0,0 +1,74 @@ +import { server } from "../server.js"; +import { z } from "zod"; + +export function registerListSkillsPrompt() { + server.registerPrompt( + "list-skills", + { + description: + "List all available skills and capabilities of this MCP server", + argsSchema: { + format: z + .enum(["brief", "detailed"]) + .optional() + .describe("Output format: 'brief' or 'detailed'"), + }, + }, + async ({ format }) => { + const isDetailed = format === "detailed"; + + const briefContent = `This MCP server provides 5 tools: +1. echo - Echo messages +2. calculator - Math operations (+, -, *, /) +3. get_current_time - Current time with timezone support +4. random_number - Random number generation +5. string_utils - String manipulation`; + + const detailedContent = `# MCP Demo Server - Complete Skills Guide + +## Tools Overview + +### 1. echo +Echo back any message you send. +\`\`\`json +{"message": "Hello!"} +\`\`\` + +### 2. calculator +Perform basic math: add, subtract, multiply, divide. +\`\`\`json +{"operation": "add", "a": 10, "b": 5} +\`\`\` + +### 3. get_current_time +Get current time, optionally in a specific timezone. +\`\`\`json +{"timezone": "Asia/Shanghai"} +\`\`\` + +### 4. random_number +Generate random numbers in a range. +\`\`\`json +{"min": 1, "max": 100} +\`\`\` + +### 5. string_utils +String operations: uppercase, lowercase, reverse, length, word_count. +\`\`\`json +{"operation": "uppercase", "text": "hello world"} +\`\`\``; + + return { + messages: [ + { + role: "user", + content: { + type: "text", + text: isDetailed ? detailedContent : briefContent, + }, + }, + ], + }; + } + ); +} diff --git a/typescript/src/prompts/math-helper.ts b/typescript/src/prompts/math-helper.ts new file mode 100644 index 0000000..240d951 --- /dev/null +++ b/typescript/src/prompts/math-helper.ts @@ -0,0 +1,35 @@ +import { server } from "../server.js"; +import { z } from "zod"; + +export function registerMathHelperPrompt() { + server.registerPrompt( + "math-helper", + { + description: "Generate a prompt for mathematical calculations", + argsSchema: { + problem: z.string().describe("The math problem to solve"), + }, + }, + async ({ problem }) => { + return { + messages: [ + { + role: "user", + content: { + type: "text", + text: `Please help solve this math problem: ${problem} + +Use the calculator tool to perform the calculations. Show your work step by step. + +Available operations: +- add (a + b) +- subtract (a - b) +- multiply (a * b) +- divide (a / b)`, + }, + }, + ], + }; + } + ); +} diff --git a/typescript/src/prompts/process-text.ts b/typescript/src/prompts/process-text.ts new file mode 100644 index 0000000..ce0bfde --- /dev/null +++ b/typescript/src/prompts/process-text.ts @@ -0,0 +1,59 @@ +import { server } from "../server.js"; +import { z } from "zod"; + +export function registerProcessTextPrompt() { + server.registerPrompt( + "process-text", + { + description: "Generate a prompt for text processing tasks", + argsSchema: { + text: z.string().describe("The text to process"), + task: z + .enum(["analyze", "transform", "summarize"]) + .optional() + .describe("Processing task: 'analyze', 'transform', or 'summarize'"), + }, + }, + async ({ text, task }) => { + const taskType = task || "analyze"; + + const prompts: Record = { + analyze: `Please analyze the following text and provide insights: + +Text: "${text}" + +Use the string_utils tool to: +1. Get the length of the text +2. Count the words +3. Show the text in uppercase and lowercase`, + + transform: `Please transform the following text: + +Text: "${text}" + +Use the string_utils tool to: +1. Convert to UPPERCASE +2. Convert to lowercase +3. Reverse the text`, + + summarize: `Please provide a summary of the following text: + +Text: "${text}" + +First, use string_utils to get basic stats (length, word_count), then provide your analysis.`, + }; + + return { + messages: [ + { + role: "user", + content: { + type: "text", + text: prompts[taskType] || prompts["analyze"], + }, + }, + ], + }; + } + ); +} diff --git a/typescript/src/resources/index.ts b/typescript/src/resources/index.ts new file mode 100644 index 0000000..e8d7002 --- /dev/null +++ b/typescript/src/resources/index.ts @@ -0,0 +1,9 @@ +import { registerSkillsResource } from "./skills.js"; +import { registerToolInfoResource, AVAILABLE_TOOLS } from "./tool-info.js"; + +export function registerAllResources() { + registerSkillsResource(); + registerToolInfoResource(); +} + +export { registerSkillsResource, registerToolInfoResource, AVAILABLE_TOOLS }; diff --git a/typescript/src/resources/skills.ts b/typescript/src/resources/skills.ts new file mode 100644 index 0000000..70f052f --- /dev/null +++ b/typescript/src/resources/skills.ts @@ -0,0 +1,56 @@ +import { server } from "../server.js"; + +const SKILLS_CONTENT = `# MCP Demo Server Skills + +## Available Tools + +### 1. echo +- **Description**: Echo back the provided message +- **Use Case**: Testing connectivity, message relay + +### 2. calculator +- **Description**: Perform basic mathematical operations (add, subtract, multiply, divide) +- **Use Case**: Mathematical calculations + +### 3. get_current_time +- **Description**: Get the current date and time with optional timezone +- **Use Case**: Time queries, timezone conversions + +### 4. random_number +- **Description**: Generate a random number within a specified range +- **Use Case**: Random selection, gaming, testing + +### 5. string_utils +- **Description**: Perform string operations (uppercase, lowercase, reverse, length, word_count) +- **Use Case**: Text processing, string manipulation + +## Capabilities Summary +- Basic I/O operations +- Mathematical calculations +- Time and date handling +- Random number generation +- String manipulation + +## How to Use +Call any tool with its required parameters. Use the \`list-skills\` prompt for interactive guidance. +`; + +export function registerSkillsResource() { + server.registerResource( + "skills-capabilities", + "mcp-demo://skills/capabilities", + { + description: "Complete list of server capabilities and skills", + mimeType: "text/markdown", + }, + async () => ({ + contents: [ + { + uri: "mcp-demo://skills/capabilities", + mimeType: "text/markdown", + text: SKILLS_CONTENT, + }, + ], + }) + ); +} diff --git a/typescript/src/resources/tool-info.ts b/typescript/src/resources/tool-info.ts new file mode 100644 index 0000000..4d52feb --- /dev/null +++ b/typescript/src/resources/tool-info.ts @@ -0,0 +1,123 @@ +import { server } from "../server.js"; +import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js"; + +interface ToolMetadata { + name: string; + description: string; + parameters: Record; + examples: string[]; +} + +const TOOL_METADATA: Record = { + echo: { + name: "echo", + description: "Echo back the provided message", + parameters: { + message: "string - The message to echo back", + }, + examples: ['{"message": "Hello, World!"}'], + }, + calculator: { + name: "calculator", + description: "Perform basic mathematical operations", + parameters: { + operation: "enum - add, subtract, multiply, divide", + a: "number - First operand", + b: "number - Second operand", + }, + examples: [ + '{"operation": "add", "a": 10, "b": 5}', + '{"operation": "multiply", "a": 3, "b": 7}', + ], + }, + get_current_time: { + name: "get_current_time", + description: "Get the current date and time", + parameters: { + timezone: "string (optional) - Timezone like 'Asia/Shanghai'", + }, + examples: ["{}", '{"timezone": "America/New_York"}'], + }, + random_number: { + name: "random_number", + description: "Generate a random number within a range", + parameters: { + min: "number - Minimum value (inclusive)", + max: "number - Maximum value (inclusive)", + }, + examples: ['{"min": 1, "max": 100}'], + }, + string_utils: { + name: "string_utils", + description: "Perform string operations", + parameters: { + operation: "enum - uppercase, lowercase, reverse, length, word_count", + text: "string - The text to process", + }, + examples: [ + '{"operation": "uppercase", "text": "hello"}', + '{"operation": "word_count", "text": "Hello World"}', + ], + }, +}; + +export const AVAILABLE_TOOLS = Object.keys(TOOL_METADATA); + +export function registerToolInfoResource() { + server.registerResource( + "tool-info", + new ResourceTemplate("mcp-demo://tools/{toolName}", { + list: async () => ({ + resources: AVAILABLE_TOOLS.map((name) => ({ + uri: `mcp-demo://tools/${name}`, + name: `Tool: ${name}`, + description: TOOL_METADATA[name].description, + mimeType: "application/json", + })), + }), + complete: { + toolName: async (value: string) => + AVAILABLE_TOOLS.filter((name) => + name.toLowerCase().startsWith(value.toLowerCase()) + ), + }, + }), + { + description: "Detailed information about a specific tool", + mimeType: "application/json", + }, + async (uri: URL) => { + const toolName = uri.pathname.split("/").pop() || ""; + const metadata = TOOL_METADATA[toolName]; + + if (!metadata) { + return { + contents: [ + { + uri: uri.href, + mimeType: "application/json", + text: JSON.stringify( + { + error: `Tool '${toolName}' not found`, + availableTools: AVAILABLE_TOOLS, + }, + null, + 2 + ), + }, + ], + }; + } + + return { + contents: [ + { + uri: uri.href, + mimeType: "application/json", + text: JSON.stringify(metadata, null, 2), + }, + ], + }; + } + ); +} diff --git a/typescript/src/server.ts b/typescript/src/server.ts new file mode 100644 index 0000000..588fceb --- /dev/null +++ b/typescript/src/server.ts @@ -0,0 +1,7 @@ +import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; + +// 创建 MCP Server 实例 +export const server = new McpServer({ + name: "mcp-demo-server", + version: "1.0.0", +}); diff --git a/typescript/src/tools/calculator.ts b/typescript/src/tools/calculator.ts new file mode 100644 index 0000000..8395635 --- /dev/null +++ b/typescript/src/tools/calculator.ts @@ -0,0 +1,56 @@ +import { server } from "../server.js"; +import { z } from "zod"; + +export function registerCalculatorTool() { + server.registerTool( + "calculator", + { + description: "Perform basic mathematical operations", + inputSchema: { + operation: z + .enum(["add", "subtract", "multiply", "divide"]) + .describe("The operation to perform"), + a: z.number().describe("First operand"), + b: z.number().describe("Second operand"), + }, + }, + async ({ operation, a, b }) => { + let result: number; + + switch (operation) { + case "add": + result = a + b; + break; + case "subtract": + result = a - b; + break; + case "multiply": + result = a * b; + break; + case "divide": + if (b === 0) { + return { + content: [ + { + type: "text", + text: "Error: Division by zero is not allowed", + }, + ], + isError: true, + }; + } + result = a / b; + break; + } + + return { + content: [ + { + type: "text", + text: `${a} ${operation} ${b} = ${result}`, + }, + ], + }; + } + ); +} diff --git a/typescript/src/tools/echo.ts b/typescript/src/tools/echo.ts new file mode 100644 index 0000000..2fcb436 --- /dev/null +++ b/typescript/src/tools/echo.ts @@ -0,0 +1,24 @@ +import { server } from "../server.js"; +import { z } from "zod"; + +export function registerEchoTool() { + server.registerTool( + "echo", + { + description: "Echo back the provided message", + inputSchema: { + message: z.string().describe("The message to echo back"), + }, + }, + async ({ message }) => { + return { + content: [ + { + type: "text", + text: `Echo: ${message}`, + }, + ], + }; + } + ); +} diff --git a/typescript/src/tools/index.ts b/typescript/src/tools/index.ts new file mode 100644 index 0000000..fffa013 --- /dev/null +++ b/typescript/src/tools/index.ts @@ -0,0 +1,21 @@ +import { registerEchoTool } from "./echo.js"; +import { registerCalculatorTool } from "./calculator.js"; +import { registerTimeTool } from "./time.js"; +import { registerRandomTool } from "./random.js"; +import { registerStringTool } from "./string.js"; + +export function registerAllTools() { + registerEchoTool(); + registerCalculatorTool(); + registerTimeTool(); + registerRandomTool(); + registerStringTool(); +} + +export { + registerEchoTool, + registerCalculatorTool, + registerTimeTool, + registerRandomTool, + registerStringTool, +}; diff --git a/typescript/src/tools/random.ts b/typescript/src/tools/random.ts new file mode 100644 index 0000000..3717795 --- /dev/null +++ b/typescript/src/tools/random.ts @@ -0,0 +1,39 @@ +import { server } from "../server.js"; +import { z } from "zod"; + +export function registerRandomTool() { + server.registerTool( + "random_number", + { + description: "Generate a random number within a specified range", + inputSchema: { + min: z.number().describe("Minimum value (inclusive)"), + max: z.number().describe("Maximum value (inclusive)"), + }, + }, + async ({ min, max }) => { + if (min > max) { + return { + content: [ + { + type: "text", + text: "Error: min must be less than or equal to max", + }, + ], + isError: true, + }; + } + + const randomNum = Math.floor(Math.random() * (max - min + 1)) + min; + + return { + content: [ + { + type: "text", + text: `Random number between ${min} and ${max}: ${randomNum}`, + }, + ], + }; + } + ); +} diff --git a/typescript/src/tools/string.ts b/typescript/src/tools/string.ts new file mode 100644 index 0000000..b45e2c1 --- /dev/null +++ b/typescript/src/tools/string.ts @@ -0,0 +1,51 @@ +import { server } from "../server.js"; +import { z } from "zod"; + +export function registerStringTool() { + server.registerTool( + "string_utils", + { + description: "Perform various string operations", + inputSchema: { + operation: z + .enum(["uppercase", "lowercase", "reverse", "length", "word_count"]) + .describe("The string operation to perform"), + text: z.string().describe("The text to process"), + }, + }, + async ({ operation, text }) => { + let result: string; + + switch (operation) { + case "uppercase": + result = text.toUpperCase(); + break; + case "lowercase": + result = text.toLowerCase(); + break; + case "reverse": + result = text.split("").reverse().join(""); + break; + case "length": + result = `Length: ${text.length} characters`; + break; + case "word_count": + const words = text + .trim() + .split(/\s+/) + .filter((w) => w.length > 0); + result = `Word count: ${words.length}`; + break; + } + + return { + content: [ + { + type: "text", + text: result, + }, + ], + }; + } + ); +} diff --git a/typescript/src/tools/time.ts b/typescript/src/tools/time.ts new file mode 100644 index 0000000..afcf56f --- /dev/null +++ b/typescript/src/tools/time.ts @@ -0,0 +1,48 @@ +import { server } from "../server.js"; +import { z } from "zod"; + +export function registerTimeTool() { + server.registerTool( + "get_current_time", + { + description: "Get the current date and time", + inputSchema: { + timezone: z + .string() + .optional() + .describe("Timezone (e.g., 'Asia/Shanghai', 'America/New_York')"), + }, + }, + async ({ timezone }) => { + const now = new Date(); + let timeString: string; + + if (timezone) { + try { + timeString = now.toLocaleString("en-US", { timeZone: timezone }); + } catch { + return { + content: [ + { + type: "text", + text: `Error: Invalid timezone '${timezone}'`, + }, + ], + isError: true, + }; + } + } else { + timeString = now.toISOString(); + } + + return { + content: [ + { + type: "text", + text: `Current time: ${timeString}`, + }, + ], + }; + } + ); +} diff --git a/typescript/tsconfig.json b/typescript/tsconfig.json new file mode 100644 index 0000000..6e2d535 --- /dev/null +++ b/typescript/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "Node16", + "moduleResolution": "Node16", + "outDir": "./build", + "rootDir": "./src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "node_modules", + "build" + ] +}