pse-mcp 0.1.0

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/GEMINI.md ADDED
@@ -0,0 +1,72 @@
1
+ # GEMINI.md
2
+
3
+ ## Project Overview
4
+
5
+ This project is a TypeScript-based MCP (Model Context Protocol) server that provides Google search capabilities and webpage content analysis tools. It enables AI models to programmatically perform Google searches and analyze webpage content.
6
+
7
+ The server is built with TypeScript and utilizes the `@modelcontextprotocol/sdk` for MCP communication. It exposes three main tools: `google_search`, `extract_webpage_content`, and `extract_multiple_webpages`.
8
+
9
+ The core logic is divided into two services:
10
+ - `GoogleSearchService`: Handles interactions with the Google Custom Search API, including caching, pagination, and result categorization.
11
+ - `ContentExtractor`: Fetches and extracts the main content from webpages using `axios`, `cheerio`, and `@mozilla/readability`. It supports various output formats and caching.
12
+
13
+ ## Building and Running
14
+
15
+ ### Prerequisites
16
+
17
+ - Node.js (v16 or higher)
18
+ - Google Cloud Platform account
19
+ - Custom Search Engine ID
20
+ - Google API Key
21
+
22
+ ### Installation
23
+
24
+ 1. Install Node.js dependencies:
25
+ ```bash
26
+ npm install
27
+ ```
28
+
29
+ ### Environment Variables
30
+
31
+ The following environment variables must be set:
32
+
33
+ - `GOOGLE_API_KEY`: Your Google API key.
34
+ - `GOOGLE_SEARCH_ENGINE_ID`: Your Custom Search Engine ID.
35
+
36
+ ### Building
37
+
38
+ To build the TypeScript code, run:
39
+
40
+ ```bash
41
+ npm run build
42
+ ```
43
+
44
+ This will compile the TypeScript files from `src` into JavaScript files in the `dist` directory.
45
+
46
+ ### Running
47
+
48
+ To start the MCP server, run:
49
+
50
+ ```bash
51
+ npm run start
52
+ ```
53
+
54
+ This will execute the compiled `dist/google-search.js` file.
55
+
56
+ For development, you can use:
57
+
58
+ ```bash
59
+ npm run dev
60
+ ```
61
+
62
+ This will watch for changes in the `src` directory and automatically recompile the code.
63
+
64
+ ## Development Conventions
65
+
66
+ - **Language:** TypeScript
67
+ - **Module System:** ES Modules (`"type": "module"` in `package.json`)
68
+ - **Compiler Target:** ES2020
69
+ - **Code Style:** The code is well-structured and follows standard TypeScript conventions. It uses classes for services and the main server logic.
70
+ - **Error Handling:** The code includes error handling for API requests and other operations.
71
+ - **Caching:** Caching is implemented for both search results and webpage content to improve performance and reduce API calls.
72
+ - **Testing:** There are no explicit test files in the provided structure.
package/License.md ADDED
@@ -0,0 +1,3 @@
1
+ License:
2
+
3
+ Free for non commercial use.
@@ -0,0 +1 @@
1
+ # Files to assist in MCP Development