@gulibs/safe-coder 0.0.1 → 0.0.2
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.
- package/LICENSE +22 -0
- package/README.md +41 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Safe Coder MCP
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
CHANGED
|
@@ -87,6 +87,8 @@ npm start
|
|
|
87
87
|
|
|
88
88
|
### 2. 在 Cursor 中配置
|
|
89
89
|
|
|
90
|
+
> **⚠️ 重要提示**:如果包还没有发布到 npm,请使用"本地开发配置"方式。
|
|
91
|
+
|
|
90
92
|
#### 步骤 1:找到 Cursor 配置文件
|
|
91
93
|
|
|
92
94
|
Cursor 的 MCP 配置文件位置:
|
|
@@ -103,23 +105,42 @@ Cursor 的 MCP 配置文件位置:
|
|
|
103
105
|
|
|
104
106
|
根据你的安装方式选择对应的配置:
|
|
105
107
|
|
|
106
|
-
#####
|
|
108
|
+
##### 方式 A:本地开发配置(推荐,如果包未发布)
|
|
107
109
|
|
|
108
|
-
|
|
110
|
+
使用项目的绝对路径:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"mcpServers": {
|
|
115
|
+
"safe-coder": {
|
|
116
|
+
"command": "node",
|
|
117
|
+
"args": ["/Users/wormhole/Documents/Developments/Our/mcp/safe-coder/dist/index.js"],
|
|
118
|
+
"env": {
|
|
119
|
+
"CACHE_TTL_MINUTES": "60",
|
|
120
|
+
"GITHUB_TOKEN": "your_token_here"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**获取你的项目路径:**
|
|
109
128
|
|
|
110
129
|
```bash
|
|
111
|
-
#
|
|
112
|
-
|
|
130
|
+
# 在项目目录下运行
|
|
131
|
+
pwd
|
|
113
132
|
```
|
|
114
133
|
|
|
115
|
-
|
|
134
|
+
##### 方式 B:通过 npm 安装(需要先发布到 npm)
|
|
135
|
+
|
|
136
|
+
如果包已发布到 npm,可以使用 npx:
|
|
116
137
|
|
|
117
138
|
```json
|
|
118
139
|
{
|
|
119
140
|
"mcpServers": {
|
|
120
141
|
"safe-coder": {
|
|
121
|
-
"command": "
|
|
122
|
-
"args": ["
|
|
142
|
+
"command": "npx",
|
|
143
|
+
"args": ["-y", "@gulibs/safe-coder"],
|
|
123
144
|
"env": {
|
|
124
145
|
"CACHE_TTL_MINUTES": "60",
|
|
125
146
|
"GITHUB_TOKEN": "your_token_here"
|
|
@@ -129,14 +150,24 @@ npm root -g
|
|
|
129
150
|
}
|
|
130
151
|
```
|
|
131
152
|
|
|
132
|
-
|
|
153
|
+
或者全局安装后使用:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# 全局安装
|
|
157
|
+
npm install -g @gulibs/safe-coder
|
|
158
|
+
|
|
159
|
+
# 查看全局安装路径
|
|
160
|
+
npm root -g
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
然后配置(替换 `<global-node-modules-path>` 为实际路径):
|
|
133
164
|
|
|
134
165
|
```json
|
|
135
166
|
{
|
|
136
167
|
"mcpServers": {
|
|
137
168
|
"safe-coder": {
|
|
138
|
-
"command": "
|
|
139
|
-
"args": ["-
|
|
169
|
+
"command": "node",
|
|
170
|
+
"args": ["<global-node-modules-path>/@gulibs/safe-coder/dist/index.js"],
|
|
140
171
|
"env": {
|
|
141
172
|
"CACHE_TTL_MINUTES": "60",
|
|
142
173
|
"GITHUB_TOKEN": "your_token_here"
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAI,kBAAkB,EAAE,CAAC;IACxC,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gulibs/safe-coder",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -16,11 +16,10 @@
|
|
|
16
16
|
"test:watch": "vitest --watch",
|
|
17
17
|
"lint": "eslint src --ext .ts",
|
|
18
18
|
"type-check": "tsc --noEmit",
|
|
19
|
-
"prepublishOnly": "npm run build"
|
|
20
|
-
"postinstall": "npm run build"
|
|
19
|
+
"prepublishOnly": "npm run build"
|
|
21
20
|
},
|
|
22
21
|
"bin": {
|
|
23
|
-
"safe-coder-mcp": "
|
|
22
|
+
"safe-coder-mcp": "dist/index.js"
|
|
24
23
|
},
|
|
25
24
|
"files": [
|
|
26
25
|
"dist",
|