@xzxzzx/bilibili-mcp 1.3.3 → 1.3.4

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
@@ -6,7 +6,7 @@
6
6
 
7
7
  ## ✨ **为你的 AI 助手装上 B 站的眼睛**:一键提取视频字幕与热门评论,助力高效信息总结 🚀
8
8
  ## ✨ **Equip your AI assistant with "Bilibili Eyes"**: One-click extraction of video subtitles and popular comments for efficient information summarization 🚀
9
- ### 🌐 **[English Documentation](./README_EN.md)** (English version here)
9
+ ### 🌐 **[English Documentation](https://github.com/365903728-oss/bilibili-mcp/blob/master/README_EN.md)** (English version here)
10
10
 
11
11
  > [!TIP]
12
12
  > ⚠️ **提示**:使用前请务必配置您的 B 站 Cookie,否则将无法提取视频字幕与评论。详见 [**⚙️ 凭证配置**](#️-凭证配置)(凭证只会保存在本地,不会上传到任何地方)。
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export {};
1
+ import { server } from "./server.js";
2
+ export default server;
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAiBrC,eAAe,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -1,24 +1,34 @@
1
1
  // MCP 服务器入口
2
- import { config } from 'dotenv';
3
- import { fileURLToPath } from 'url';
4
- import { dirname, resolve } from 'path';
2
+ import { config } from "dotenv";
3
+ import { fileURLToPath } from "url";
4
+ import { dirname, resolve } from "path";
5
+ import { server } from "./server.js";
6
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
7
  // 获取当前文件的目录
6
8
  const __filename = fileURLToPath(import.meta.url);
7
9
  const __dirname = dirname(__filename);
8
- // 使用绝对路径加载.env文件
9
- const envPath = resolve(__dirname, '../.env');
10
- config({ path: envPath });
11
- import { server } from "./server.js";
12
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
13
- // 启动服务器
10
+ // 尝试加载.env文件
11
+ const envPath = resolve(__dirname, "../.env");
12
+ try {
13
+ config({ path: envPath });
14
+ }
15
+ catch (e) {
16
+ // .env is optional
17
+ }
18
+ // 供 Smithery 沙盒反射使用的纯净实例导出
19
+ // 绝不能在这里执行任何副作用
20
+ export default server;
21
+ // 启动服务器的入口点
14
22
  async function main() {
15
- console.error("本工具仅供技术研究使用,请确保您的访问行为符合平台规范");
16
23
  const transport = new StdioServerTransport();
17
24
  await server.connect(transport);
18
25
  console.error("Bilibili MCP server running on stdio");
19
26
  }
20
- main().catch((error) => {
21
- console.error("Fatal error in main():", error);
22
- process.exit(1);
23
- });
27
+ // 检查是否作为主模块运行
28
+ if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
29
+ main().catch((error) => {
30
+ console.error("Fatal error:", error);
31
+ process.exit(1);
32
+ });
33
+ }
24
34
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY;AACZ,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAExC,YAAY;AACZ,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,iBAAiB;AACjB,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAC9C,MAAM,CAAC,EAAE,IAAI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AC;AAAC,OAAO,CAAC,EAAE,CAAC;IACX,mBAAmB;AACrB,CAAC;AAED,2BAA2B;AAC3B,gBAAgB;AAChB,eAAe,MAAM,CAAC;AAEtB,YAAY;AACZ,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;AACxD,CAAC;AAED,cAAc;AACd,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1E,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ declare const server: McpServer;
3
+ export default server;
4
+ //# sourceMappingURL=smithery-test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smithery-test.d.ts","sourceRoot":"","sources":["../src/smithery-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,QAAA,MAAM,MAAM,WAGV,CAAC;AAUH,eAAe,MAAM,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { z } from "zod";
3
+ const server = new McpServer({
4
+ name: "test",
5
+ version: "1"
6
+ });
7
+ server.tool("dummy_tool", { input: z.string() }, async ({ input }) => ({
8
+ content: [{ type: "text", text: `Dummy ${input}` }]
9
+ }));
10
+ export default server;
11
+ //# sourceMappingURL=smithery-test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smithery-test.js","sourceRoot":"","sources":["../src/smithery-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,GAAG;CACb,CAAC,CAAC;AAEH,MAAM,CAAC,IAAI,CACT,YAAY,EACZ,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,EACrB,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,EAAE,EAAE,CAAC;CACpD,CAAC,CACH,CAAC;AAEF,eAAe,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@xzxzzx/bilibili-mcp",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Bilibili MCP tool for video and comment summarization",
5
5
  "type": "module",
6
- "main": "dist/index.js",
6
+ "main": "src/index.ts",
7
+ "module": "./src/index.ts",
7
8
  "bin": {
8
9
  "bilibili-mcp": "dist/cli.js"
9
10
  },
@@ -11,6 +12,8 @@
11
12
  "build": "tsc",
12
13
  "watch": "tsc --watch",
13
14
  "start": "node dist/index.js",
15
+ "dev": "smithery dev",
16
+ "build:smithery": "smithery build",
14
17
  "prepublishOnly": "npm run build",
15
18
  "test": "echo \"Error: no test specified\" && exit 1",
16
19
  "test:env": "node -e \"console.log('检查环境变量...'); console.log('BILIBILI_SESSDATA:', process.env.BILIBILI_SESSDATA ? '✅ 已配置' : '❌ 未配置'); console.log('BILIBILI_BILI_JCT:', process.env.BILIBILI_BILI_JCT ? '✅ 已配置' : '❌ 未配置'); console.log('BILIBILI_DEDEUSERID:', process.env.BILIBILI_DEDEUSERID ? '✅ 已配置' : '❌ 未配置');\"",
@@ -58,7 +61,7 @@
58
61
  "node": ">=18.0.0"
59
62
  },
60
63
  "dependencies": {
61
- "@modelcontextprotocol/sdk": "^1.0.4",
64
+ "@modelcontextprotocol/sdk": "^1.27.1",
62
65
  "commander": "^14.0.3",
63
66
  "dotenv": "^17.2.4",
64
67
  "quick-lru": "^7.3.0"
@@ -68,7 +71,9 @@
68
71
  "@semantic-release/git": "^10.0.1",
69
72
  "@semantic-release/github": "^11.0.1",
70
73
  "@semantic-release/npm": "^12.0.1",
74
+ "@smithery/cli": "^4.5.0",
71
75
  "@types/node": "^22.19.8",
76
+ "esbuild": "^0.24.2",
72
77
  "semantic-release": "^25.0.3",
73
78
  "typescript": "^5.7.2"
74
79
  }
package/src/index.ts ADDED
@@ -0,0 +1,37 @@
1
+ // MCP 服务器入口
2
+ import { config } from "dotenv";
3
+ import { fileURLToPath } from "url";
4
+ import { dirname, resolve } from "path";
5
+ import { server } from "./server.js";
6
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
7
+
8
+ // 获取当前文件的目录
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = dirname(__filename);
11
+
12
+ // 尝试加载.env文件
13
+ const envPath = resolve(__dirname, "../.env");
14
+ try {
15
+ config({ path: envPath });
16
+ } catch (e) {
17
+ // .env is optional
18
+ }
19
+
20
+ // 供 Smithery 沙盒反射使用的纯净实例导出
21
+ // 绝不能在这里执行任何副作用
22
+ export default server;
23
+
24
+ // 启动服务器的入口点
25
+ async function main() {
26
+ const transport = new StdioServerTransport();
27
+ await server.connect(transport);
28
+ console.error("Bilibili MCP server running on stdio");
29
+ }
30
+
31
+ // 检查是否作为主模块运行
32
+ if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
33
+ main().catch((error) => {
34
+ console.error("Fatal error:", error);
35
+ process.exit(1);
36
+ });
37
+ }