z-yapi-mcp 1.0.3 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +23 -51
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,71 +1,43 @@
1
- ## z-yapi-mcp 运行说明
1
+ # z-yapi-mcp 运行说明
2
2
 
3
3
  这是一个基于 `@modelcontextprotocol/sdk` 实现的 **MCP stdio 服务**,通过调用 YApi 接口提供工具能力。
4
4
 
5
- ### 环境准备
5
+ # 使用
6
6
 
7
- - **Node.js**:建议 20+ 版本
8
- - **操作系统**:Windows / macOS / Linux 均可
9
-
10
- ### 安装依赖
11
-
12
- 在项目根目录执行:
13
-
14
- ```bash
15
- cd d:\Project\ai\z-yapi-mcp
16
- npm install
7
+ ```json
8
+ {
9
+ "mcpServers": {
10
+ "z-yapi-mcp": {
11
+ "command": "npx",
12
+ "args": [
13
+ "z-yapi-mcp",
14
+ "--stdio",
15
+ "--yapi-base-url=https://api.psvmc.com/",
16
+ "--yapi-token=yourtoken"
17
+ ]
18
+ }
19
+ }
20
+ }
17
21
  ```
18
22
 
19
- ### 配置 YApi 相关环境变量
20
23
 
21
- 服务运行时需要通过环境变量获取 YApi 配置:
24
+ # 环境准备
22
25
 
23
- - `YAPI_BASE_URL`:YApi 的基础地址,例如 `https://yapi.example.com`
24
- - `YAPI_TOKEN`:全局 token
26
+ - **Node.js**:建议 20+ 版本
27
+ - **操作系统**:Windows / macOS / Linux 均可
25
28
 
26
- ### 运行方式一:本地构建后运行(推荐)
29
+ ## 安装依赖
27
30
 
28
- 1. **构建 TypeScript 源码**
31
+ 在项目根目录执行:
29
32
 
30
33
  ```bash
31
34
  cd d:\Project\ai\z-yapi-mcp
32
- npm run build
33
- ```
34
-
35
- 2. **以 Node 直接运行 dist 入口**
36
-
37
- ```powershell
38
- cd d:\Project\ai\z-yapi-mcp
39
-
40
- $env:YAPI_BASE_URL = "https://yapi.example.com"
41
- $env:YAPI_TOKEN = "your-yapi-token"
42
-
43
- node .\dist\index.js --stdio --yapi-base-url=$env:YAPI_BASE_URL --yapi-token=$env:YAPI_TOKEN
35
+ npm install
44
36
  ```
45
37
 
46
- 该方式适合被 MCP 客户端通过命令配置拉起,例如:
47
38
 
48
- ```json
49
- {
50
- "mcpServers": {
51
- "z-yapi-mcp": {
52
- "command": "node",
53
- "args": [
54
- "d:/Project/ai/z-yapi-mcp/dist/index.js",
55
- "--stdio",
56
- "--yapi-base-url=https://yapi.example.com",
57
- "--yapi-token=your-yapi-token"
58
- ],
59
- "env": {
60
- "YAPI_BASE_URL": "https://yapi.example.com",
61
- "YAPI_TOKEN": "your-yapi-token"
62
- }
63
- }
64
- }
65
- }
66
- ```
67
39
 
68
- ### 运行方式二:本地测试脚本
40
+ # 本地测试脚本
69
41
 
70
42
  仓库中提供了一个简单的本地测试脚本 `test-tools-list.mjs`,可以在不依赖外部 MCP 客户端的前提下验证服务是否正常返回工具列表。
71
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "z-yapi-mcp",
3
- "version": "1.0.3",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "description": "A MCP server for YApi integration - Connect your AI assistants with YApi",
6
6
  "main": "dist/index.js",