@codify-ai/mcp-client 1.0.1 → 1.0.3

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/README.md CHANGED
@@ -21,8 +21,8 @@
21
21
  - 🔌 **一键安装**:使用 `npx` 无需手动下载
22
22
  - 📡 **MCP 协议**:完美集成 Cursor 等支持 MCP 的 IDE
23
23
  - 🔐 **安全认证**:支持 access_key 认证
24
- - 🛠️ **工具集成**:提供 `getCode` 和 `listChannels` 工具
25
- - 📦 **资源访问**:通过 URI `codify://{channelId}/current` 访问代码
24
+ - 🛠️ **工具集成**:提供 `getCode` 和 `sendToCanvas` 工具
25
+ - 📦 **资源访问**:通过 URI `codify://getCode/{content_id}` 访问代码
26
26
 
27
27
  ## 架构说明
28
28
 
@@ -47,11 +47,7 @@ Figma Plugin (WebSocket)
47
47
  "mcpServers": {
48
48
  "codify": {
49
49
  "command": "npx",
50
- "args": [
51
- "-y",
52
- "@codify/mcp-client",
53
- "--url=http://your-server:8080"
54
- ],
50
+ "args": ["-y", "@codify-ai/mcp-client", "--url=https://mcp.codify-api.com"],
55
51
  "env": {
56
52
  "CODIFY_ACCESS_KEY": "sk-your-access-key"
57
53
  }
@@ -71,64 +67,48 @@ Figma Plugin (WebSocket)
71
67
  #### 方式 1:使用 AI 工具调用
72
68
 
73
69
  对 AI 说:
70
+
74
71
  ```
75
- 请使用 listChannels 工具查看所有可用频道
76
- 请使用 getCode 工具获取 my-channel 频道的代码
72
+ 请使用 getCode 工具获取 code_id 的代码
77
73
  ```
78
74
 
79
75
  #### 方式 2:通过资源 URI 访问
80
76
 
81
77
  在代码或对话中引用:
78
+
82
79
  ```
83
- codify://my-channel/current
80
+ codify://getCode/code_id
84
81
  ```
85
82
 
86
83
  ## 配置说明
87
84
 
88
85
  ### 命令行参数
89
86
 
90
- | 参数 | 说明 | 默认值 |
91
- |------|------|--------|
92
- | `--url=<URL>` | Codify 服务器地址 | `http://localhost:8080` |
93
- | `--help`, `-h` | 显示帮助信息 | - |
94
- | `--version`, `-v` | 显示版本号 | - |
87
+ | 参数 | 说明 | 默认值 |
88
+ | ----------------- | ----------------- | --------------------------- |
89
+ | `--url=<URL>` | Codify 服务器地址 | `ttps://mcp.codify-api.com` |
90
+ | `--help`, `-h` | 显示帮助信息 | - |
91
+ | `--version`, `-v` | 显示版本号 | - |
95
92
 
96
93
  ### 环境变量
97
94
 
98
- | 变量名 | 说明 | 必需 |
99
- |--------|------|------|
100
- | `CODIFY_SERVER_URL` | 服务器地址(可被 --url 覆盖) | 否 |
101
- | `CODIFY_ACCESS_KEY` | 访问密钥 | 是* |
95
+ | 变量名 | 说明 | 必需 |
96
+ | ------------------- | ----------------------------- | ---- |
97
+ | `CODIFY_SERVER_URL` | 服务器地址(可被 --url 覆盖) | 否 |
98
+ | `CODIFY_ACCESS_KEY` | 访问密钥 | 是\* |
102
99
 
103
- *如果服务器启用了认证则必需
100
+ \*如果服务器启用了认证则必需
104
101
 
105
102
  ## 使用示例
106
103
 
107
- ### 示例 1:连接本地服务器(无认证)
108
-
109
- ```json
110
- {
111
- "mcpServers": {
112
- "codify": {
113
- "command": "npx",
114
- "args": ["-y", "@codify/mcp-client"]
115
- }
116
- }
117
- }
118
- ```
119
-
120
- ### 示例 2:连接远程服务器(带认证)
104
+ ### 示例 1:连接远程服务器(带认证)
121
105
 
122
106
  ```json
123
107
  {
124
108
  "mcpServers": {
125
109
  "codify": {
126
110
  "command": "npx",
127
- "args": [
128
- "-y",
129
- "@codify/mcp-client",
130
- "--url=https://codify.example.com"
131
- ],
111
+ "args": ["-y", "@codify/mcp-client", "--url=https://codify.example.com"],
132
112
  "env": {
133
113
  "CODIFY_ACCESS_KEY": "sk-abc123xyz789"
134
114
  }
@@ -137,16 +117,16 @@ codify://my-channel/current
137
117
  }
138
118
  ```
139
119
 
140
- ### 示例 3:使用环境变量
120
+ ### 示例 2:使用环境变量
141
121
 
142
122
  ```json
143
123
  {
144
124
  "mcpServers": {
145
125
  "codify": {
146
126
  "command": "npx",
147
- "args": ["-y", "@codify/mcp-client"],
127
+ "args": ["-y", "@codify-api/mcp-client"],
148
128
  "env": {
149
- "CODIFY_SERVER_URL": "http://192.168.1.100:8080",
129
+ "CODIFY_SERVER_URL": "https://codify.example.com",
150
130
  "CODIFY_ACCESS_KEY": "sk-abc123xyz789"
151
131
  }
152
132
  }
@@ -161,9 +141,11 @@ codify://my-channel/current
161
141
  获取指定频道的代码。
162
142
 
163
143
  **参数:**
164
- - `channelId` (string, 必需) - 频道 ID
144
+
145
+ - `content_id` (string, 必需) - 频道 ID
165
146
 
166
147
  **示例:**
148
+
167
149
  ```
168
150
  AI,请使用 getCode 工具获取 demo-channel 的代码
169
151
  ```
@@ -175,6 +157,7 @@ AI,请使用 getCode 工具获取 demo-channel 的代码
175
157
  **参数:** 无
176
158
 
177
159
  **示例:**
160
+
178
161
  ```
179
162
  AI,请使用 listChannels 工具查看所有频道
180
163
  ```
@@ -184,13 +167,14 @@ AI,请使用 listChannels 工具查看所有频道
184
167
  通过资源 URI 直接访问代码:
185
168
 
186
169
  ```
187
- codify://{channelId}/current
170
+ codify://{content_id}/current
188
171
  ```
189
172
 
190
173
  **示例:**
174
+
191
175
  ```
192
- codify://demo-channel/current
193
- codify://my-project/current
176
+ codify://getCode/code_123
177
+ codify://getCode/code_456
194
178
  ```
195
179
 
196
180
  ## 故障排查
@@ -200,6 +184,7 @@ codify://my-project/current
200
184
  **错误信息:** `❌ 获取通道列表失败`
201
185
 
202
186
  **解决方案:**
187
+
203
188
  1. 确保 Codify 服务器正在运行
204
189
  2. 检查服务器 URL 是否正确
205
190
  3. 检查网络连接是否正常
@@ -210,42 +195,14 @@ codify://my-project/current
210
195
  **错误信息:** `❌ 认证失败 (401)`
211
196
 
212
197
  **解决方案:**
213
- 1. 确认 `CODIFY_ACCESS_KEY` 已设置
214
- 2. 检查 access_key 是否正确
215
- 3. 确认服务器启用了认证
216
-
217
- ### 问题 3:频道不存在
218
198
 
219
- **错误信息:** `❌ 频道 "xxx" 不存在`
220
-
221
- **解决方案:**
222
- 1. 使用 `listChannels` 工具查看所有可用频道
223
- 2. 确认 Figma 插件已连接并发送过代码
224
- 3. 检查频道 ID 拼写是否正确
225
-
226
- ## 调试模式
227
-
228
- 启用调试模式查看详细日志:
229
-
230
- ```json
231
- {
232
- "mcpServers": {
233
- "codify": {
234
- "command": "npx",
235
- "args": ["-y", "@codify/mcp-client", "--url=http://localhost:8080"],
236
- "env": {
237
- "DEBUG": "true",
238
- "CODIFY_ACCESS_KEY": "sk-xxx"
239
- }
240
- }
241
- }
242
- }
243
- ```
199
+ 1. 确认 `CODIFY_ACCESS_KEY` 已设置
200
+ 2. 检查 access_key 是否正确,并且你的帐号拥有订阅权限。
244
201
 
245
202
  ## 相关项目
246
203
 
247
204
  - **Codify MCP Server** - 服务端实现
248
- - **Codify Figma Plugin** - Figma 插件
205
+ - **Codify AI Plugin** - Codify 插件
249
206
 
250
207
  ## 许可证
251
208
 
@@ -255,13 +212,6 @@ MIT
255
212
 
256
213
  欢迎提交 Issue 和 Pull Request!
257
214
 
258
- ## 支持
259
-
260
- 如有问题,请:
261
- 1. 查看[文档](https://github.com/your-username/codify-mcp-client)
262
- 2. 提交 [Issue](https://github.com/your-username/codify-mcp-client/issues)
263
- 3. 加入我们的社区讨论
264
-
265
215
  ---
266
216
 
267
217
  Made with ❤️ by Codify Team