docs: update commands for pnpm workflow
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
parent
380738c4de
commit
786a20c5d0
18
README.md
18
README.md
@ -5,7 +5,7 @@
|
||||
## 当前状态:V1 Alpha
|
||||
|
||||
当前模板支持:
|
||||
- Node.js 20+ 运行时
|
||||
- Node.js 20.19+ 运行时
|
||||
- 单包架构
|
||||
- 协议安全的本地 Stdio 传输(主要方式)
|
||||
- Streamable HTTP 传输(次要方式)
|
||||
@ -20,19 +20,19 @@ Stdio 是本模板在本地开发以及与 Claude 等桌面 LLM 客户端集成
|
||||
|
||||
1. **安装依赖**
|
||||
```bash
|
||||
npm install
|
||||
pnpm install
|
||||
```
|
||||
|
||||
2. **使用 MCP Inspector 运行**
|
||||
模板在 `package.json` 中提供了协议安全的启动配置,用于避免 stdout 被污染。你可以使用以下命令测试服务端:
|
||||
```bash
|
||||
npx @modelcontextprotocol/inspector node ./node_modules/tsx/dist/cli.mjs src/stdio.ts
|
||||
pnpm dlx @modelcontextprotocol/inspector node ./node_modules/tsx/dist/cli.mjs src/stdio.ts
|
||||
```
|
||||
|
||||
3. **构建项目**
|
||||
如果你要为生产环境做准备,或使用编译后的入口文件,可以执行:
|
||||
```bash
|
||||
npm run build
|
||||
pnpm build
|
||||
```
|
||||
|
||||
## 使用方式:HTTP
|
||||
@ -41,7 +41,7 @@ HTTP 传输基于 Node 原生的 `StreamableHTTPServerTransport`,适用于远
|
||||
|
||||
1. **启动 HTTP 服务**
|
||||
```bash
|
||||
npm run dev:http
|
||||
pnpm dev:http
|
||||
```
|
||||
服务默认监听 `127.0.0.1:3000`。你也可以通过 `HTTP_PORT` 环境变量自定义端口。
|
||||
|
||||
@ -51,9 +51,9 @@ HTTP 传输基于 Node 原生的 `StreamableHTTPServerTransport`,适用于远
|
||||
|
||||
## 开发与测试
|
||||
|
||||
- **类型检查**:`npm run typecheck`
|
||||
- **测试**:`npm test`(运行 stdio、HTTP 和核心逻辑的 Vitest smoke tests)
|
||||
- **开发模式(核心逻辑)**:`npm run dev`(执行 `src/index.ts`)
|
||||
- **类型检查**:`pnpm typecheck`
|
||||
- **测试**:`pnpm test`(运行 stdio、HTTP 和核心逻辑的 Vitest smoke tests)
|
||||
- **开发模式(核心逻辑)**:`pnpm dev`(执行 `src/index.ts`)
|
||||
|
||||
## 仓库结构
|
||||
|
||||
@ -86,6 +86,6 @@ HTTP 传输基于 Node 原生的 `StreamableHTTPServerTransport`,适用于远
|
||||
## V1 限制
|
||||
|
||||
- **无鉴权**:HTTP 传输不包含内置鉴权能力。
|
||||
- **仅支持 Node**:当前专门针对 Node.js 20+ 进行适配。
|
||||
- **仅支持 Node**:当前专门针对 Node.js 20.19+ 进行适配。
|
||||
- **非 Monorepo**:设计目标是独立项目模板,而不是多包仓库。
|
||||
- **本地优先**:V1 暂未提供面向云服务商的部署指南。
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user