@claudeink/mcp-server 0.0.8 → 0.0.9
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/package.json +1 -1
- package/workflow/CLAUDE.md +50 -37
package/package.json
CHANGED
package/workflow/CLAUDE.md
CHANGED
|
@@ -152,58 +152,71 @@ TOKEN=$(cat .claudeink/credentials.json | grep -o '"token":"[^"]*"' | cut -d'"'
|
|
|
152
152
|
读取 `accounts/*.yaml`(跳过 `_template.yaml`),提取每个账号的 `name`、`id`、`platform`。
|
|
153
153
|
|
|
154
154
|
**第三步:扫描素材元数据**
|
|
155
|
-
扫描 `sources/` 下所有 `.md` 文件,从 YAML front matter
|
|
156
|
-
```json
|
|
157
|
-
{
|
|
158
|
-
"id": "文件名(不含.md)",
|
|
159
|
-
"title": "frontmatter.title",
|
|
160
|
-
"tags": ["frontmatter.tags"],
|
|
161
|
-
"createdAt": "frontmatter.published",
|
|
162
|
-
"sourceUrl": "frontmatter.url"
|
|
163
|
-
}
|
|
164
|
-
```
|
|
155
|
+
扫描 `sources/` 下所有 `.md` 文件,从 YAML front matter 中提取,构造 `sources` 数组。
|
|
165
156
|
|
|
166
157
|
**第四步:扫描草稿元数据**
|
|
167
|
-
扫描所有账号的 `drafts/` 目录下 `.md`
|
|
168
|
-
```json
|
|
169
|
-
{
|
|
170
|
-
"id": "文件名",
|
|
171
|
-
"account": "所属账号名",
|
|
172
|
-
"title": "frontmatter.title",
|
|
173
|
-
"status": "frontmatter.status 或 draft",
|
|
174
|
-
"wordCount": "正文字数",
|
|
175
|
-
"tags": ["frontmatter.tags"],
|
|
176
|
-
"createdAt": "frontmatter.created 或文件创建时间",
|
|
177
|
-
"updatedAt": "文件修改时间"
|
|
178
|
-
}
|
|
179
|
-
```
|
|
158
|
+
扫描所有账号的 `drafts/` 目录下 `.md` 文件,构造 `drafts` 数组。
|
|
180
159
|
|
|
181
160
|
**第五步:扫描已发布**
|
|
182
|
-
扫描所有账号的 `published/`
|
|
161
|
+
扫描所有账号的 `published/` 目录,构造 `published` 数组。
|
|
162
|
+
|
|
163
|
+
**第六步:推送到云端**
|
|
164
|
+
|
|
165
|
+
严格按照以下 JSON 格式构造 payload,字段名必须**完全一致**(驼峰命名):
|
|
166
|
+
|
|
183
167
|
```json
|
|
184
168
|
{
|
|
185
|
-
"
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
169
|
+
"sources": [
|
|
170
|
+
{
|
|
171
|
+
"id": "文件名不含扩展名,如 2026-03-10-profound-funding",
|
|
172
|
+
"title": "frontmatter 中的 title",
|
|
173
|
+
"source": "frontmatter 中的 source,如 techcrunch",
|
|
174
|
+
"tags": ["frontmatter 中的 tags 数组"],
|
|
175
|
+
"sourceUrl": "frontmatter 中的 url(可选)",
|
|
176
|
+
"createdAt": "frontmatter 中的 published,ISO 格式"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"drafts": [
|
|
180
|
+
{
|
|
181
|
+
"id": "文件名不含扩展名",
|
|
182
|
+
"account": "所属账号名(accounts yaml 中的 name)",
|
|
183
|
+
"platform": "账号 yaml 中的 platform,如 wechat",
|
|
184
|
+
"title": "frontmatter 中的 title",
|
|
185
|
+
"status": "frontmatter 中的 status,默认 draft",
|
|
186
|
+
"wordCount": 正文字数(数字),
|
|
187
|
+
"tags": ["frontmatter 中的 tags"],
|
|
188
|
+
"createdAt": "文件创建时间 ISO 格式",
|
|
189
|
+
"updatedAt": "文件修改时间 ISO 格式"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"published": [
|
|
193
|
+
{
|
|
194
|
+
"id": "文件名不含扩展名",
|
|
195
|
+
"account": "所属账号名",
|
|
196
|
+
"platform": "账号 yaml 中的 platform",
|
|
197
|
+
"title": "frontmatter 中的 title",
|
|
198
|
+
"platformUrl": "发布平台链接(可选)",
|
|
199
|
+
"publishedAt": "发布时间 ISO 格式"
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"analytics": []
|
|
191
203
|
}
|
|
192
204
|
```
|
|
193
205
|
|
|
194
|
-
|
|
206
|
+
使用 curl 推送:
|
|
195
207
|
```bash
|
|
196
208
|
curl -s -X POST https://app.claudeink.com/api/sync/batch \
|
|
197
209
|
-H "Authorization: Bearer $TOKEN" \
|
|
198
210
|
-H "Content-Type: application/json" \
|
|
199
|
-
-d '
|
|
200
|
-
"sources": [扫描结果],
|
|
201
|
-
"drafts": [扫描结果],
|
|
202
|
-
"published": [扫描结果],
|
|
203
|
-
"analytics": []
|
|
204
|
-
}'
|
|
211
|
+
-d '上述 JSON'
|
|
205
212
|
```
|
|
206
213
|
|
|
214
|
+
**注意**:
|
|
215
|
+
- `id` 字段用文件名(不含 .md),作为本地唯一标识
|
|
216
|
+
- `sourceUrl`、`createdAt`、`updatedAt`、`wordCount`、`publishedAt` 必须使用驼峰命名
|
|
217
|
+
- `tags` 必须是字符串数组 `["AI", "融资"]`,不是逗号分隔的字符串
|
|
218
|
+
- `wordCount` 必须是数字,不是字符串
|
|
219
|
+
|
|
207
220
|
**第七步:报告结果**
|
|
208
221
|
告知用户同步了多少条素材、草稿、已发布文章。
|
|
209
222
|
|