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 +72 -0
- package/License.md +3 -0
- package/MCP Documents/README.md +1 -0
- package/MCP Documents/mcp-client-guide.txt +736 -0
- package/MCP Documents/mcp-complete-guide.txt +522 -0
- package/MCP Documents/mcp-enhanced-instructions.md +297 -0
- package/MCP Documents/mcp-server-guide.md +415 -0
- package/MCP Documents/mcp-windows.txt +161 -0
- package/QWEN.md +207 -0
- package/README.md +220 -0
- package/dist/content-fetcher.js +36 -0
- package/dist/google-search.js +421 -0
- package/dist/services/content-extractor.service.js +195 -0
- package/dist/services/google-search.service.js +244 -0
- package/dist/types.js +1 -0
- package/dist-package/README.md +210 -0
- package/dist-package/dist/content-fetcher.js +36 -0
- package/dist-package/dist/google-search.js +420 -0
- package/dist-package/dist/services/content-extractor.service.js +195 -0
- package/dist-package/dist/services/google-search.service.js +244 -0
- package/dist-package/dist/types.js +1 -0
- package/dist-package/package-lock.json +3104 -0
- package/dist-package/package.json +23 -0
- package/license +4 -0
- package/package.json +40 -0
- package/src/google-search.ts +477 -0
- package/src/mcp.d.ts +36 -0
- package/src/services/content-extractor.service.ts +232 -0
- package/src/services/google-search.service.ts +305 -0
- package/src/types.ts +64 -0
- package/tasks.md +141 -0
- package/tsconfig.json +16 -0
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 @@
|
|
1
|
+
# Files to assist in MCP Development
|