@claudeink/mcp-server 0.0.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ClaudeInk
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.
package/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # @claudeink/mcp-server
2
+
3
+ ClaudeInk MCP Server — 让 Claude 成为你的自媒体写作助手。
4
+
5
+ 本地运行的 MCP (Model Context Protocol) 服务,将 Claude Desktop / Claude Code 与 ClaudeInk 云端后台连接,提供多平台内容创作全流程支持。
6
+
7
+ ## 功能
8
+
9
+ - **素材管理** — 本地素材库,支持自动标签、搜索、爬虫
10
+ - **草稿写作** — 多账号、多平台草稿管理和发布
11
+ - **配置同步** — 云端分发写作规则和平台规范
12
+ - **数据分析** — 推送文章表现数据到云端 Dashboard
13
+
14
+ ## 支持平台
15
+
16
+ 微信公众号 · 小红书 · X (Twitter) · 头条号 · 个人博客
17
+
18
+ ## 快速开始
19
+
20
+ ### 1. 初始化
21
+
22
+ ```bash
23
+ npx @claudeink/mcp-server init --key YOUR-LICENSE-KEY
24
+ ```
25
+
26
+ 这会:
27
+ - 创建 `~/.claudeink/` 配置目录
28
+ - 保存 License Key
29
+ - 自动注册到 Claude Desktop 和 Claude Code
30
+
31
+ ### 2. 激活
32
+
33
+ 重启 Claude 后,在对话中使用:
34
+
35
+ ```
36
+ 请激活 ClaudeInk,我的 license key 是 YOUR-LICENSE-KEY,工作目录是 /path/to/your/writing
37
+ ```
38
+
39
+ Claude 会调用 `auth.activate` 工具完成云端验证。
40
+
41
+ ### 3. 开始写作
42
+
43
+ ```
44
+ /编写 一篇关于 AI 趋势的公众号文章
45
+ ```
46
+
47
+ ## MCP 工具列表
48
+
49
+ | 工具 | 说明 |
50
+ |---|---|
51
+ | `auth.activate` | 验证 License Key 并激活 |
52
+ | `auth.status` | 查看授权状态 |
53
+ | `config.sync` | 同步云端最新写作配置 |
54
+ | `config.version` | 查看本地配置版本 |
55
+ | `source.add` | 添加素材到本地素材库 |
56
+ | `source.search` | 搜索本地素材 |
57
+ | `source.list` | 列出素材目录 |
58
+ | `source.crawl` | 触发爬虫抓取 |
59
+ | `source.schedule` | 管理定时爬虫 |
60
+ | `source.tag` | 处理素材标签队列 |
61
+ | `source.tag_status` | 查看标签队列状态 |
62
+ | `source.tag_apply` | 写入 Claude 生成的标签 |
63
+ | `draft.save` | 保存草稿 |
64
+ | `draft.list` | 列出草稿 |
65
+ | `draft.update` | 更新草稿 |
66
+ | `draft.delete` | 删除草稿 |
67
+ | `draft.publish` | 标记草稿为已发布 |
68
+ | `analytics.push` | 推送文章表现数据 |
69
+ | `analytics.report` | 获取数据分析报告 |
70
+ | `account.list` | 列出所有账号 |
71
+ | `account.switch` | 切换当前账号 |
72
+ | `account.create` | 创建新账号 |
73
+
74
+ ## 本地文件结构
75
+
76
+ ```
77
+ ~/.claudeink/
78
+ ├── credentials.json # 凭证(License Key、API Token)
79
+ ├── config.json # 服务配置(API 地址、同步间隔)
80
+ ├── sync-state.json # 同步状态
81
+ ├── tag-queue.json # 标签处理队列
82
+ ├── crawl-schedules.json # 爬虫配置
83
+ └── logs/ # 运行日志
84
+
85
+ {workflowDir}/
86
+ ├── CLAUDE.md # 系统配置(云端分发)
87
+ ├── base-rules.md # 通用写作底座
88
+ ├── platforms/ # 平台规则
89
+ ├── accounts/ # 账号配置
90
+ ├── sources/ # 素材库
91
+ ├── drafts/ # 草稿
92
+ └── published/ # 已发布
93
+ ```
94
+
95
+ ## 系统要求
96
+
97
+ - Node.js >= 18
98
+ - Claude Desktop 或 Claude Code
99
+
100
+ ## License
101
+
102
+ MIT
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/cli.js ADDED
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/cli.ts
4
+ import { writeFile, readFile, mkdir } from "fs/promises";
5
+ import { join } from "path";
6
+ import { homedir } from "os";
7
+ var args = process.argv.slice(2);
8
+ var command = args[0];
9
+ async function init() {
10
+ const keyIdx = args.indexOf("--key");
11
+ const key = keyIdx >= 0 ? args[keyIdx + 1] : void 0;
12
+ if (!key) {
13
+ console.error("Usage: npx @claudeink/mcp-server init --key WF-XXXX-XXXX-XXXX");
14
+ process.exit(1);
15
+ }
16
+ console.log("\u{1F680} ClaudeInk MCP Server \u521D\u59CB\u5316\u4E2D...\n");
17
+ const claudeinkDir = join(homedir(), ".claudeink");
18
+ await mkdir(claudeinkDir, { recursive: true });
19
+ await mkdir(join(claudeinkDir, "logs"), { recursive: true });
20
+ console.log("\u2705 \u914D\u7F6E\u76EE\u5F55\u5DF2\u521B\u5EFA: ~/.claudeink/");
21
+ const credsPath = join(claudeinkDir, "credentials.json");
22
+ await writeFile(
23
+ credsPath,
24
+ JSON.stringify({ licenseKey: key, token: "", userId: "", plan: "starter", expiresAt: "" }, null, 2),
25
+ { mode: 384 }
26
+ );
27
+ console.log("\u2705 License key \u5DF2\u4FDD\u5B58");
28
+ const configPath = join(claudeinkDir, "config.json");
29
+ await writeFile(
30
+ configPath,
31
+ JSON.stringify(
32
+ {
33
+ apiBaseUrl: "https://claudeink-web.pages.dev",
34
+ syncIntervalMs: 3e5,
35
+ heartbeatIntervalMs: 3e5,
36
+ maxTagQueueBatch: 20,
37
+ workflowDir: process.cwd()
38
+ },
39
+ null,
40
+ 2
41
+ )
42
+ );
43
+ console.log(`\u2705 \u914D\u7F6E\u5DF2\u521D\u59CB\u5316 (\u5DE5\u4F5C\u76EE\u5F55: ${process.cwd()})`);
44
+ await registerWithClaude();
45
+ console.log("\n\u{1F389} \u521D\u59CB\u5316\u5B8C\u6210\uFF01");
46
+ console.log(" \u8BF7\u5728 Claude \u4E2D\u4F7F\u7528 auth.activate \u5B8C\u6210\u6FC0\u6D3B\u3002");
47
+ console.log(" \u6216\u91CD\u65B0\u542F\u52A8 Claude\uFF0C\u7CFB\u7EDF\u5C06\u81EA\u52A8\u8BC6\u522B ClaudeInk MCP Server\u3002\n");
48
+ }
49
+ async function registerWithClaude() {
50
+ const mcpConfig = {
51
+ claudeink: {
52
+ command: "npx",
53
+ args: ["@claudeink/mcp-server"]
54
+ }
55
+ };
56
+ const desktopConfigPath = join(
57
+ homedir(),
58
+ ".claude",
59
+ "claude_desktop_config.json"
60
+ );
61
+ await registerToConfig(desktopConfigPath, mcpConfig, "Cowork / Claude Desktop");
62
+ const codeConfigPath = join(homedir(), ".claude.json");
63
+ await registerToConfig(codeConfigPath, mcpConfig, "Claude Code");
64
+ }
65
+ async function registerToConfig(configPath, mcpConfig, name) {
66
+ try {
67
+ let config = {};
68
+ try {
69
+ const existing = await readFile(configPath, "utf-8");
70
+ config = JSON.parse(existing);
71
+ } catch {
72
+ }
73
+ if (!config.mcpServers) {
74
+ config.mcpServers = {};
75
+ }
76
+ config.mcpServers["claudeink"] = mcpConfig.claudeink;
77
+ const dir = configPath.substring(0, configPath.lastIndexOf("/"));
78
+ await mkdir(dir, { recursive: true });
79
+ await writeFile(configPath, JSON.stringify(config, null, 2));
80
+ console.log(`\u2705 \u5DF2\u6CE8\u518C\u5230 ${name}: ${configPath}`);
81
+ } catch (err) {
82
+ console.log(`\u26A0\uFE0F \u6CE8\u518C\u5230 ${name} \u5931\u8D25 (\u975E\u81F4\u547D): ${err}`);
83
+ }
84
+ }
85
+ switch (command) {
86
+ case "init":
87
+ init().catch((err) => {
88
+ console.error("\u521D\u59CB\u5316\u5931\u8D25:", err);
89
+ process.exit(1);
90
+ });
91
+ break;
92
+ case "version":
93
+ console.log("@claudeink/mcp-server v0.0.1");
94
+ break;
95
+ default:
96
+ import("./index.js");
97
+ break;
98
+ }
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node