matome-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) 2025 evilock
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,63 @@
1
+ # MCP Server for Matome Subscribers
2
+
3
+ This repository hosts the **MCP server for subscribers of the Matome service**.
4
+ It enables context sharing and integration with external models via the Model Context Protocol (MCP).
5
+
6
+ ---
7
+
8
+ ## Overview
9
+
10
+ This server is exclusively provided for Matome subscribers.
11
+ Subscribers can use the **UID issued by Matome** to share bookmarked URLs with MCP-compatible clients.
12
+
13
+ ---
14
+
15
+ ## Key Features
16
+
17
+ - Provides bookmarked URLs linked to a Matome UID
18
+ - Can be combined with browser search MCPs to create summaries of your bookmarks
19
+
20
+ ---
21
+
22
+ ## How to Use
23
+
24
+ 1. Log in to Matome and obtain your UID for MCP integration.
25
+ 2. Use the URL with your MCP-compatible client and set the UID as an environment variable.
26
+ 3. Example configuration for Claude MCP client:
27
+
28
+ ```claude_desktop_config.json
29
+ "matome": {
30
+ "command": "npx",
31
+ "args": ["matome-mcp-server"],
32
+ "env": {
33
+ "USER_ID": "{YOUR UID}"
34
+ }
35
+ }
36
+ ```
37
+
38
+ 4. Integration with BraveAPI:
39
+
40
+ ```claude_desktop_config.json
41
+ "brave-search": {
42
+ "command": "npx",
43
+ "args": ["-y", "@modelcontextprotocol/server-brave-search"],
44
+ "env": {
45
+ "BRAVE_API_KEY": "{YOUR API KEY}"
46
+ }
47
+ }
48
+ ```
49
+
50
+ 5. Prompt for summarization:
51
+ [matome で取得した url の内容をまとめて]
52
+
53
+ ---
54
+
55
+ Notes
56
+
57
+ This service is available to anyone who knows a valid Matome UID.
58
+ The UID must be set to public: true in Matome to be used.
59
+ Even non-Matome users can retrieve data if they know someone’s public UID.
60
+
61
+ ---
62
+
63
+ License
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { MCPServer } from "mcp-framework";
3
+ const server = new MCPServer();
4
+ server.start();
@@ -0,0 +1,16 @@
1
+ import { MCPTool } from "mcp-framework";
2
+ import { z } from "zod";
3
+ class ExampleTool extends MCPTool {
4
+ name = "example_tool";
5
+ description = "An example tool that processes messages";
6
+ schema = {
7
+ message: {
8
+ type: z.string(),
9
+ description: "Message to process",
10
+ },
11
+ };
12
+ async execute(input) {
13
+ return `Processed: ${input.message}`;
14
+ }
15
+ }
16
+ export default ExampleTool;
@@ -0,0 +1,51 @@
1
+ import { MCPTool } from "mcp-framework";
2
+ import { z } from "zod";
3
+ import "dotenv/config";
4
+ class MatomeTool extends MCPTool {
5
+ name = "get_matome_url_list";
6
+ description = "Matomeに登録したurlを取得する";
7
+ MATOME_API_BASE = "https://matome.ebi-generator.com/api/mcp";
8
+ schema = {
9
+ message: {
10
+ type: z.string(),
11
+ description: "Message to process",
12
+ },
13
+ };
14
+ async execute() {
15
+ try {
16
+ const Url = `${this.MATOME_API_BASE}`;
17
+ const UID = process.env.USER_ID;
18
+ const response = await fetch(Url, {
19
+ method: "POST",
20
+ headers: {
21
+ "Content-Type": "application/json",
22
+ },
23
+ body: JSON.stringify({ uid: UID }),
24
+ });
25
+ if (response.status !== 200) {
26
+ return { content: [{ type: "text", text: "matome fetch Error!!" }] };
27
+ }
28
+ else {
29
+ const result = await response.json();
30
+ // const resultlist: BASE_CONTENT = { content: [] };
31
+ // result.list.forEach((item) => {
32
+ // resultlist.content.push({ type: "text", text: item.url });
33
+ // });
34
+ // return resultlist;
35
+ return result;
36
+ }
37
+ }
38
+ catch {
39
+ return {
40
+ list: [{ type: "error", url: "" }],
41
+ // content: [
42
+ // {
43
+ // type: "text",
44
+ // text: "matome url list is none",
45
+ // },
46
+ // ],
47
+ };
48
+ }
49
+ }
50
+ }
51
+ export default MatomeTool;
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "matome-mcp-server",
3
+ "version": "0.0.1",
4
+ "description": "matome-mcp-server MCP server",
5
+ "type": "module",
6
+ "bin": {
7
+ "matome-mcp-server": "./dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc && mcp-build",
14
+ "watch": "tsc --watch",
15
+ "start": "node dist/index.js"
16
+ },
17
+ "dependencies": {
18
+ "dotenv": "^16.5.0",
19
+ "mcp-framework": "^0.2.2"
20
+ },
21
+ "devDependencies": {
22
+ "@types/node": "^20.11.24",
23
+ "typescript": "^5.3.3"
24
+ },
25
+ "engines": {
26
+ "node": ">=18.19.0"
27
+ }
28
+ }