JavaScript 中的 async/await
async/await 是基于 Promise、以同步方式编写异步代码的语法糖。
简单来说:
async 放置在函数定义前,函数总是返回一个 Promise,返回值会自动包裹在已解析的 Promise 中。
async/await 是基于 Promise、以同步方式编写异步代码的语法糖。
简单来说:
async 放置在函数定义前,函数总是返回一个 Promise,返回值会自动包裹在已解析的 Promise 中。
Mosquitto 是 MQTT 的开源实现之一,GitHub 地址 https://github.com/eclipse-mosquitto/mosquitto ,介绍信息如下:
Mosquitto is an open source implementation of a server for version 5.0, 3.1.1, and 3.1 of the MQTT protocol. It also includes a C and C++ client library, the mosquitto_pub mosquitto_rr, and mosquitto_sub utilities for publishing and subscribing, and the mosquitto_ctrl, mosquitto_signal, and mosquitto_passwd applications for helping administer the broker.

Zod 中定义的 Record 对应着 TS 中的 Record,用于构建键值对。
TS 中 Record 与 JSON 和对象相似,对应的概念如下:
模式,也就是数据结构,使用 Zod 时,我们要先定义模式,即定义数据结构的规则,然后调用 .parse 或 safeParse 进行校验。
本节要搭建一个能运行 Zod 库的 TypeScript 开发环境,步骤如下:
学习一个新的技术、框架或包,首先要解决的是事物的三个问题:
本文就是围绕 Zod 回答上面的三个问题,并在后续的文章中介绍“怎么用”。

根据实现的 MCP Server 的类型不同,做日志功能时需要注意:
本文继续做官方文档的学习和摘录,在服务器和客户端这一块,理解有效,有些翻译甚至有些勉强。
学习来源:
MCP servers are programs that expose specific capabilities to AI applications through standardized protocol interfaces.