ayga-mcp-client 2.0.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/LICENSE +21 -0
- package/README.md +189 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +272 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers.d.ts +17 -0
- package/dist/parsers.d.ts.map +1 -0
- package/dist/parsers.js +282 -0
- package/dist/parsers.js.map +1 -0
- package/dist/test.d.ts +7 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +51 -0
- package/dist/test.js.map +1 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ayga
|
|
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,189 @@
|
|
|
1
|
+
# Ayga MCP Client (Node.js)
|
|
2
|
+
|
|
3
|
+
Modern, lightweight MCP client for Redis API with **40 AI parsers** across **9 categories**.
|
|
4
|
+
|
|
5
|
+
## ๐ Quick Start
|
|
6
|
+
|
|
7
|
+
### Install via npx (recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @ayga/mcp-client
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### VS Code Copilot Configuration
|
|
14
|
+
|
|
15
|
+
Add to `%APPDATA%\Code\User\mcp.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"inputs": [
|
|
20
|
+
{
|
|
21
|
+
"id": "REDIS_API_KEY",
|
|
22
|
+
"type": "promptString",
|
|
23
|
+
"description": "ayga-mcp-client Redis API key",
|
|
24
|
+
"password": true
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"servers": {
|
|
28
|
+
"ayga": {
|
|
29
|
+
"type": "stdio",
|
|
30
|
+
"command": "npx",
|
|
31
|
+
"args": ["@ayga/mcp-client@latest"],
|
|
32
|
+
"env": {
|
|
33
|
+
"REDIS_API_KEY": "${input:REDIS_API_KEY}"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Claude Desktop Configuration
|
|
41
|
+
|
|
42
|
+
Add to `%APPDATA%\Claude\claude_desktop_config.json`:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"mcpServers": {
|
|
47
|
+
"ayga": {
|
|
48
|
+
"command": "npx",
|
|
49
|
+
"args": ["@ayga/mcp-client@latest"],
|
|
50
|
+
"env": {
|
|
51
|
+
"REDIS_API_KEY": "your-api-key-here"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## ๐ฆ Available Parsers (40 total)
|
|
59
|
+
|
|
60
|
+
### AI Chat (8)
|
|
61
|
+
- `search_perplexity` - Perplexity AI with sources
|
|
62
|
+
- `search_chatgpt` - ChatGPT with web search
|
|
63
|
+
- `search_claude` - Anthropic Claude
|
|
64
|
+
- `search_gemini` - Google Gemini
|
|
65
|
+
- `search_copilot` - Microsoft Copilot
|
|
66
|
+
- `search_grok` - xAI Grok
|
|
67
|
+
- `search_deepseek` - DeepSeek AI
|
|
68
|
+
- `search_deepai` - DeepAI
|
|
69
|
+
|
|
70
|
+
### Search Engines (8)
|
|
71
|
+
- `search_google_search` - Google Search
|
|
72
|
+
- `search_bing_search` - Bing Search
|
|
73
|
+
- `search_duckduckgo` - DuckDuckGo
|
|
74
|
+
- `search_yahoo_search` - Yahoo Search
|
|
75
|
+
- `search_yandex_search` - Yandex Search
|
|
76
|
+
- `search_baidu_search` - Baidu Search
|
|
77
|
+
- `search_rambler_search` - Rambler Search
|
|
78
|
+
- `search_you_search` - You.com
|
|
79
|
+
|
|
80
|
+
### Instagram (4)
|
|
81
|
+
- `search_instagram_profile` - User profiles
|
|
82
|
+
- `search_instagram_post` - Individual posts
|
|
83
|
+
- `search_instagram_tag` - Hashtag pages
|
|
84
|
+
- `search_instagram_geo` - Location pages
|
|
85
|
+
|
|
86
|
+
### TikTok (1)
|
|
87
|
+
- `search_tiktok_profile` - User profiles and videos
|
|
88
|
+
|
|
89
|
+
### YouTube (5)
|
|
90
|
+
- `search_youtube_search` - Search videos
|
|
91
|
+
- `search_youtube_video` - Video details
|
|
92
|
+
- `search_youtube_comments` - Video comments
|
|
93
|
+
- `search_youtube_channel_videos` - Channel videos
|
|
94
|
+
- `search_youtube_channel_about` - Channel info
|
|
95
|
+
|
|
96
|
+
### Google Trends (1)
|
|
97
|
+
- `search_google_trends` - Trends data
|
|
98
|
+
|
|
99
|
+
### Pinterest (1)
|
|
100
|
+
- `search_pinterest_search` - Search pins
|
|
101
|
+
|
|
102
|
+
### Reddit (2)
|
|
103
|
+
- `search_reddit_posts` - Search posts
|
|
104
|
+
- `search_reddit_comments` - Post comments
|
|
105
|
+
|
|
106
|
+
### Translation (3)
|
|
107
|
+
- `search_google_translate` - Google Translate
|
|
108
|
+
- `search_bing_translate` - Bing Translator
|
|
109
|
+
- `search_yandex_translate` - Yandex Translator
|
|
110
|
+
|
|
111
|
+
### HTML Content (3)
|
|
112
|
+
- `search_link_extractor` - Extract links
|
|
113
|
+
- `search_article_extractor` - Extract articles (Mozilla Readability)
|
|
114
|
+
- `search_text_extractor` - Extract text content
|
|
115
|
+
|
|
116
|
+
## ๐ก Usage Examples
|
|
117
|
+
|
|
118
|
+
### In Claude Desktop/VS Code
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
@ayga list_parsers
|
|
122
|
+
@ayga search_perplexity query="What is MCP protocol?"
|
|
123
|
+
@ayga search_google_trends query="AI trends 2026"
|
|
124
|
+
@ayga search_youtube_search query="Python tutorials" timeout=90
|
|
125
|
+
@ayga search_google_translate query="Hello world"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Command Line
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# Set API key
|
|
132
|
+
export REDIS_API_KEY="your-api-key"
|
|
133
|
+
|
|
134
|
+
# Run server
|
|
135
|
+
npx @ayga/mcp-client
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## ๐๏ธ Architecture
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
142
|
+
โ VS Code / Claude Desktop โ
|
|
143
|
+
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
144
|
+
โ MCP stdio
|
|
145
|
+
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
146
|
+
โ @ayga/mcp-client (Node.js) โ
|
|
147
|
+
โ - 40 parsers โ
|
|
148
|
+
โ - MCP protocol โ
|
|
149
|
+
โ - JWT authentication โ
|
|
150
|
+
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
151
|
+
โ HTTPS REST API
|
|
152
|
+
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
153
|
+
โ redis_wrapper (Python/FastAPI) โ
|
|
154
|
+
โ https://redis.ayga.tech โ
|
|
155
|
+
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
156
|
+
โ Redis Queue
|
|
157
|
+
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
158
|
+
โ A-Parser (Windows) โ
|
|
159
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## ๐ Getting API Key
|
|
163
|
+
|
|
164
|
+
1. Visit https://redis.ayga.tech
|
|
165
|
+
2. Sign up or log in
|
|
166
|
+
3. Generate API key
|
|
167
|
+
4. Use in configuration
|
|
168
|
+
|
|
169
|
+
## ๐ vs Python Version
|
|
170
|
+
|
|
171
|
+
| Feature | Node.js (2.0.0) | Python (1.4.1) |
|
|
172
|
+
| ---------------- | ---------------------- | ---------------------------- |
|
|
173
|
+
| **Installation** | `npx @ayga/mcp-client` | `uvx ayga-mcp-client==1.4.1` |
|
|
174
|
+
| **Startup** | ~50-100ms | ~716ms |
|
|
175
|
+
| **Dependencies** | MCP SDK only | mcp, httpx, pydantic |
|
|
176
|
+
| **Size** | ~500 lines | ~1200 lines |
|
|
177
|
+
| **Runtime** | Node.js 18+ | Python 3.11+ |
|
|
178
|
+
| **Parsers** | โ
All 40 | โ
All 40 |
|
|
179
|
+
|
|
180
|
+
## ๐ License
|
|
181
|
+
|
|
182
|
+
MIT
|
|
183
|
+
|
|
184
|
+
## ๐ Links
|
|
185
|
+
|
|
186
|
+
- **API Backend**: https://redis.ayga.tech
|
|
187
|
+
- **Python Version**: https://pypi.org/project/ayga-mcp-client/
|
|
188
|
+
- **GitHub**: https://github.com/ozand/ayga-mcp-nodejs
|
|
189
|
+
- **Issues**: https://github.com/ozand/ayga-mcp-nodejs/issues
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
import { PARSERS, getParserById } from "./parsers.js";
|
|
6
|
+
// Configuration
|
|
7
|
+
const API_URL = process.env.API_URL || "https://redis.ayga.tech";
|
|
8
|
+
const API_KEY = process.env.REDIS_API_KEY;
|
|
9
|
+
class AygaMCPServer {
|
|
10
|
+
server;
|
|
11
|
+
jwtToken;
|
|
12
|
+
tokenExpiry;
|
|
13
|
+
constructor() {
|
|
14
|
+
this.server = new Server({
|
|
15
|
+
name: "ayga-mcp-client",
|
|
16
|
+
version: "2.0.0",
|
|
17
|
+
}, {
|
|
18
|
+
capabilities: {
|
|
19
|
+
tools: {},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
this.setupHandlers();
|
|
23
|
+
this.setupErrorHandlers();
|
|
24
|
+
}
|
|
25
|
+
log(message, level = "info") {
|
|
26
|
+
const timestamp = new Date().toISOString();
|
|
27
|
+
console.error(`[${timestamp}] [${level.toUpperCase()}] ${message}`);
|
|
28
|
+
}
|
|
29
|
+
async getJWT() {
|
|
30
|
+
// Return cached token if still valid (with 5 min buffer)
|
|
31
|
+
if (this.jwtToken && this.tokenExpiry && Date.now() < this.tokenExpiry - 300000) {
|
|
32
|
+
return this.jwtToken;
|
|
33
|
+
}
|
|
34
|
+
if (!API_KEY) {
|
|
35
|
+
throw new Error("REDIS_API_KEY environment variable is required");
|
|
36
|
+
}
|
|
37
|
+
this.log("Exchanging API key for JWT token");
|
|
38
|
+
try {
|
|
39
|
+
const response = await fetch(`${API_URL}/auth/exchange`, {
|
|
40
|
+
method: "POST",
|
|
41
|
+
headers: {
|
|
42
|
+
"X-API-Key": API_KEY,
|
|
43
|
+
"Content-Type": "application/json",
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
if (!response.ok) {
|
|
47
|
+
const errorText = await response.text();
|
|
48
|
+
throw new Error(`Auth failed (${response.status}): ${errorText}`);
|
|
49
|
+
}
|
|
50
|
+
const data = await response.json();
|
|
51
|
+
this.jwtToken = data.access_token;
|
|
52
|
+
// Set expiry (default 3600s, use 3000s to be safe)
|
|
53
|
+
this.tokenExpiry = Date.now() + (data.expires_in || 3000) * 1000;
|
|
54
|
+
this.log("JWT token obtained successfully");
|
|
55
|
+
return this.jwtToken;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
this.log(`Authentication error: ${error}`, "error");
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async submitParserTask(parserId, query, timeout = 60) {
|
|
63
|
+
const parser = getParserById(parserId);
|
|
64
|
+
if (!parser) {
|
|
65
|
+
throw new Error(`Unknown parser: ${parserId}`);
|
|
66
|
+
}
|
|
67
|
+
const token = await this.getJWT();
|
|
68
|
+
const taskId = crypto.randomUUID();
|
|
69
|
+
this.log(`Submitting task ${taskId} to parser ${parser.name}`);
|
|
70
|
+
// Prepare task data for A-Parser
|
|
71
|
+
const taskData = JSON.stringify([
|
|
72
|
+
taskId,
|
|
73
|
+
parser.aparserName,
|
|
74
|
+
"default",
|
|
75
|
+
query,
|
|
76
|
+
{},
|
|
77
|
+
{},
|
|
78
|
+
]);
|
|
79
|
+
try {
|
|
80
|
+
// Submit task to Redis queue
|
|
81
|
+
const submitResponse = await fetch(`${API_URL}/structures/list/aparser_redis_api/lpush`, {
|
|
82
|
+
method: "POST",
|
|
83
|
+
headers: {
|
|
84
|
+
Authorization: `Bearer ${token}`,
|
|
85
|
+
"Content-Type": "application/json",
|
|
86
|
+
},
|
|
87
|
+
body: JSON.stringify({ value: taskData }),
|
|
88
|
+
});
|
|
89
|
+
if (!submitResponse.ok) {
|
|
90
|
+
const errorText = await submitResponse.text();
|
|
91
|
+
throw new Error(`Task submission failed (${submitResponse.status}): ${errorText}`);
|
|
92
|
+
}
|
|
93
|
+
this.log(`Task ${taskId} submitted, waiting for result (timeout: ${timeout}s)`);
|
|
94
|
+
// Poll for result
|
|
95
|
+
return await this.waitForResult(taskId, timeout, token);
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
this.log(`Task submission error: ${error}`, "error");
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
async waitForResult(taskId, timeout, token) {
|
|
103
|
+
const startTime = Date.now();
|
|
104
|
+
const pollInterval = 2000; // 2 seconds
|
|
105
|
+
let attempts = 0;
|
|
106
|
+
while (Date.now() - startTime < timeout * 1000) {
|
|
107
|
+
attempts++;
|
|
108
|
+
try {
|
|
109
|
+
const response = await fetch(`${API_URL}/kv/aparser_redis_api:${taskId}`, {
|
|
110
|
+
headers: {
|
|
111
|
+
Authorization: `Bearer ${token}`,
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
if (response.ok) {
|
|
115
|
+
const data = await response.json();
|
|
116
|
+
const result = JSON.parse(data.value);
|
|
117
|
+
this.log(`Task ${taskId} completed after ${attempts} attempts`);
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
// 404 means task not ready yet, continue polling
|
|
121
|
+
if (response.status === 404) {
|
|
122
|
+
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
// Other errors
|
|
126
|
+
const errorText = await response.text();
|
|
127
|
+
throw new Error(`Failed to get result (${response.status}): ${errorText}`);
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
// Network errors - retry
|
|
131
|
+
this.log(`Poll attempt ${attempts} failed: ${error}, retrying...`, "debug");
|
|
132
|
+
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
throw new Error(`Timeout waiting for result after ${timeout}s (${attempts} attempts)`);
|
|
136
|
+
}
|
|
137
|
+
setupHandlers() {
|
|
138
|
+
// List available tools
|
|
139
|
+
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
140
|
+
const tools = PARSERS.map((parser) => ({
|
|
141
|
+
name: `search_${parser.id}`,
|
|
142
|
+
description: `${parser.description} (Category: ${parser.category})`,
|
|
143
|
+
inputSchema: {
|
|
144
|
+
type: "object",
|
|
145
|
+
properties: {
|
|
146
|
+
query: {
|
|
147
|
+
type: "string",
|
|
148
|
+
description: parser.category === "Translation"
|
|
149
|
+
? "Text to translate"
|
|
150
|
+
: "Search query or URL",
|
|
151
|
+
},
|
|
152
|
+
timeout: {
|
|
153
|
+
type: "number",
|
|
154
|
+
description: "Timeout in seconds (default: 60)",
|
|
155
|
+
default: 60,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
required: ["query"],
|
|
159
|
+
},
|
|
160
|
+
}));
|
|
161
|
+
// Add list_parsers tool
|
|
162
|
+
tools.push({
|
|
163
|
+
name: "list_parsers",
|
|
164
|
+
description: "List all available parsers with their categories",
|
|
165
|
+
inputSchema: {
|
|
166
|
+
type: "object",
|
|
167
|
+
properties: {},
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
return { tools };
|
|
171
|
+
});
|
|
172
|
+
// Call tool
|
|
173
|
+
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
174
|
+
const { name, arguments: args } = request.params;
|
|
175
|
+
try {
|
|
176
|
+
// Handle list_parsers tool
|
|
177
|
+
if (name === "list_parsers") {
|
|
178
|
+
const category = args?.category;
|
|
179
|
+
let parsers = PARSERS;
|
|
180
|
+
if (category) {
|
|
181
|
+
parsers = PARSERS.filter((p) => p.category === category);
|
|
182
|
+
}
|
|
183
|
+
const categories = [...new Set(PARSERS.map((p) => p.category))];
|
|
184
|
+
const result = {
|
|
185
|
+
total: parsers.length,
|
|
186
|
+
categories: categories,
|
|
187
|
+
parsers: parsers.map((p) => ({
|
|
188
|
+
id: p.id,
|
|
189
|
+
name: p.name,
|
|
190
|
+
category: p.category,
|
|
191
|
+
description: p.description,
|
|
192
|
+
})),
|
|
193
|
+
};
|
|
194
|
+
return {
|
|
195
|
+
content: [
|
|
196
|
+
{
|
|
197
|
+
type: "text",
|
|
198
|
+
text: JSON.stringify(result, null, 2),
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
// Handle parser tools
|
|
204
|
+
if (name.startsWith("search_")) {
|
|
205
|
+
const parserId = name.replace("search_", "");
|
|
206
|
+
const query = args?.query;
|
|
207
|
+
const timeout = args?.timeout || 60;
|
|
208
|
+
if (!query) {
|
|
209
|
+
throw new Error("Query parameter is required");
|
|
210
|
+
}
|
|
211
|
+
this.log(`Executing ${name} with query: ${query.substring(0, 50)}...`);
|
|
212
|
+
const result = await this.submitParserTask(parserId, query, timeout);
|
|
213
|
+
return {
|
|
214
|
+
content: [
|
|
215
|
+
{
|
|
216
|
+
type: "text",
|
|
217
|
+
text: JSON.stringify(result, null, 2),
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
this.log(`Tool execution error: ${error}`, "error");
|
|
226
|
+
return {
|
|
227
|
+
content: [
|
|
228
|
+
{
|
|
229
|
+
type: "text",
|
|
230
|
+
text: JSON.stringify({
|
|
231
|
+
error: error instanceof Error ? error.message : String(error),
|
|
232
|
+
tool: name,
|
|
233
|
+
timestamp: new Date().toISOString(),
|
|
234
|
+
}, null, 2),
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
isError: true,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
setupErrorHandlers() {
|
|
243
|
+
this.server.onerror = (error) => {
|
|
244
|
+
this.log(`Server error: ${error}`, "error");
|
|
245
|
+
};
|
|
246
|
+
process.on("SIGINT", async () => {
|
|
247
|
+
this.log("Received SIGINT, shutting down...");
|
|
248
|
+
await this.server.close();
|
|
249
|
+
process.exit(0);
|
|
250
|
+
});
|
|
251
|
+
process.on("SIGTERM", async () => {
|
|
252
|
+
this.log("Received SIGTERM, shutting down...");
|
|
253
|
+
await this.server.close();
|
|
254
|
+
process.exit(0);
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
async run() {
|
|
258
|
+
const transport = new StdioServerTransport();
|
|
259
|
+
await this.server.connect(transport);
|
|
260
|
+
this.log("Ayga MCP Server v2.0.0 started");
|
|
261
|
+
this.log(`API URL: ${API_URL}`);
|
|
262
|
+
this.log(`Total parsers: ${PARSERS.length}`);
|
|
263
|
+
this.log("Server ready on stdio transport");
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
// Entry point
|
|
267
|
+
const server = new AygaMCPServer();
|
|
268
|
+
server.run().catch((error) => {
|
|
269
|
+
console.error("Fatal error:", error);
|
|
270
|
+
process.exit(1);
|
|
271
|
+
});
|
|
272
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAo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G,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACzB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parser configuration for all 40 parsers
|
|
3
|
+
* Maps MCP tool names to A-Parser internal names
|
|
4
|
+
*/
|
|
5
|
+
export interface ParserConfig {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
category: string;
|
|
9
|
+
description: string;
|
|
10
|
+
aparserName: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const PARSERS: ParserConfig[];
|
|
13
|
+
export declare function getParserById(id: string): ParserConfig | undefined;
|
|
14
|
+
export declare function getParserByAParserName(name: string): ParserConfig | undefined;
|
|
15
|
+
export declare function getParsersByCategory(category: string): ParserConfig[];
|
|
16
|
+
export declare function getAllCategories(): string[];
|
|
17
|
+
//# sourceMappingURL=parsers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../src/parsers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,OAAO,EAAE,YAAY,EAkRjC,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAElE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAE7E;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,EAAE,CAErE;AAED,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAE3C"}
|
package/dist/parsers.js
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parser configuration for all 40 parsers
|
|
3
|
+
* Maps MCP tool names to A-Parser internal names
|
|
4
|
+
*/
|
|
5
|
+
export const PARSERS = [
|
|
6
|
+
// AI Chat (7 parsers)
|
|
7
|
+
{
|
|
8
|
+
id: "perplexity",
|
|
9
|
+
name: "Perplexity AI",
|
|
10
|
+
category: "AI Chat",
|
|
11
|
+
description: "AI-powered search with sources and citations",
|
|
12
|
+
aparserName: "FreeAI::Perplexity"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "chatgpt",
|
|
16
|
+
name: "ChatGPT",
|
|
17
|
+
category: "AI Chat",
|
|
18
|
+
description: "ChatGPT with web search capabilities",
|
|
19
|
+
aparserName: "FreeAI::ChatGPT"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "claude",
|
|
23
|
+
name: "Claude AI",
|
|
24
|
+
category: "AI Chat",
|
|
25
|
+
description: "Anthropic Claude assistant",
|
|
26
|
+
aparserName: "FreeAI::Claude"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "gemini",
|
|
30
|
+
name: "Google Gemini",
|
|
31
|
+
category: "AI Chat",
|
|
32
|
+
description: "Google Gemini AI assistant",
|
|
33
|
+
aparserName: "FreeAI::Gemini"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "copilot",
|
|
37
|
+
name: "Microsoft Copilot",
|
|
38
|
+
category: "AI Chat",
|
|
39
|
+
description: "Microsoft Copilot with Bing integration",
|
|
40
|
+
aparserName: "FreeAI::Copilot"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "grok",
|
|
44
|
+
name: "Grok AI",
|
|
45
|
+
category: "AI Chat",
|
|
46
|
+
description: "xAI Grok assistant",
|
|
47
|
+
aparserName: "FreeAI::Grok"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "deepseek",
|
|
51
|
+
name: "DeepSeek",
|
|
52
|
+
category: "AI Chat",
|
|
53
|
+
description: "DeepSeek AI assistant",
|
|
54
|
+
aparserName: "FreeAI::DeepSeek"
|
|
55
|
+
},
|
|
56
|
+
// Search Engines (3 parsers)
|
|
57
|
+
{
|
|
58
|
+
id: "google_search",
|
|
59
|
+
name: "Google Search",
|
|
60
|
+
category: "Search Engines",
|
|
61
|
+
description: "Google web search results",
|
|
62
|
+
aparserName: "Google::Search"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "bing_search",
|
|
66
|
+
name: "Bing Search",
|
|
67
|
+
category: "Search Engines",
|
|
68
|
+
description: "Bing web search results",
|
|
69
|
+
aparserName: "Bing::Search"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "duckduckgo",
|
|
73
|
+
name: "DuckDuckGo",
|
|
74
|
+
category: "Search Engines",
|
|
75
|
+
description: "DuckDuckGo privacy-focused search",
|
|
76
|
+
aparserName: "DuckDuckGo::Search"
|
|
77
|
+
},
|
|
78
|
+
// Social Media - Instagram (4 parsers)
|
|
79
|
+
{
|
|
80
|
+
id: "instagram_profile",
|
|
81
|
+
name: "Instagram Profile",
|
|
82
|
+
category: "Instagram",
|
|
83
|
+
description: "Parse Instagram user profiles and posts",
|
|
84
|
+
aparserName: "Instagram::Profile"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "instagram_post",
|
|
88
|
+
name: "Instagram Post",
|
|
89
|
+
category: "Instagram",
|
|
90
|
+
description: "Parse individual Instagram posts",
|
|
91
|
+
aparserName: "Instagram::Post"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "instagram_tag",
|
|
95
|
+
name: "Instagram Tag",
|
|
96
|
+
category: "Instagram",
|
|
97
|
+
description: "Parse Instagram hashtag pages",
|
|
98
|
+
aparserName: "Instagram::Tag"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "instagram_geo",
|
|
102
|
+
name: "Instagram Geo",
|
|
103
|
+
category: "Instagram",
|
|
104
|
+
description: "Parse Instagram location pages",
|
|
105
|
+
aparserName: "Instagram::Geo"
|
|
106
|
+
},
|
|
107
|
+
// Social Media - TikTok (1 parser)
|
|
108
|
+
{
|
|
109
|
+
id: "tiktok_profile",
|
|
110
|
+
name: "TikTok Profile",
|
|
111
|
+
category: "TikTok",
|
|
112
|
+
description: "Parse TikTok user profiles and videos",
|
|
113
|
+
aparserName: "TikTok::Profile"
|
|
114
|
+
},
|
|
115
|
+
// YouTube (5 parsers)
|
|
116
|
+
{
|
|
117
|
+
id: "youtube_search",
|
|
118
|
+
name: "YouTube Search",
|
|
119
|
+
category: "YouTube",
|
|
120
|
+
description: "Search YouTube videos",
|
|
121
|
+
aparserName: "YouTube::Search"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: "youtube_video",
|
|
125
|
+
name: "YouTube Video",
|
|
126
|
+
category: "YouTube",
|
|
127
|
+
description: "Parse YouTube video details",
|
|
128
|
+
aparserName: "YouTube::Video"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "youtube_comments",
|
|
132
|
+
name: "YouTube Comments",
|
|
133
|
+
category: "YouTube",
|
|
134
|
+
description: "Parse YouTube video comments",
|
|
135
|
+
aparserName: "YouTube::Comments"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: "youtube_channel_videos",
|
|
139
|
+
name: "YouTube Channel Videos",
|
|
140
|
+
category: "YouTube",
|
|
141
|
+
description: "Get YouTube channel videos",
|
|
142
|
+
aparserName: "YouTube::ChannelVideos"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: "youtube_channel_about",
|
|
146
|
+
name: "YouTube Channel About",
|
|
147
|
+
category: "YouTube",
|
|
148
|
+
description: "Get YouTube channel information",
|
|
149
|
+
aparserName: "YouTube::ChannelAbout"
|
|
150
|
+
},
|
|
151
|
+
// Google Trends (1 parser)
|
|
152
|
+
{
|
|
153
|
+
id: "google_trends",
|
|
154
|
+
name: "Google Trends",
|
|
155
|
+
category: "Google Trends",
|
|
156
|
+
description: "Get Google Trends data for queries",
|
|
157
|
+
aparserName: "Google::Trends"
|
|
158
|
+
},
|
|
159
|
+
// Pinterest (1 parser)
|
|
160
|
+
{
|
|
161
|
+
id: "pinterest_search",
|
|
162
|
+
name: "Pinterest Search",
|
|
163
|
+
category: "Pinterest",
|
|
164
|
+
description: "Search Pinterest pins",
|
|
165
|
+
aparserName: "Pinterest::Search"
|
|
166
|
+
},
|
|
167
|
+
// Reddit (2 parsers)
|
|
168
|
+
{
|
|
169
|
+
id: "reddit_posts",
|
|
170
|
+
name: "Reddit Posts",
|
|
171
|
+
category: "Reddit",
|
|
172
|
+
description: "Search Reddit posts",
|
|
173
|
+
aparserName: "Reddit::Posts"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
id: "reddit_comments",
|
|
177
|
+
name: "Reddit Comments",
|
|
178
|
+
category: "Reddit",
|
|
179
|
+
description: "Get Reddit post comments",
|
|
180
|
+
aparserName: "Reddit::Comments"
|
|
181
|
+
},
|
|
182
|
+
// Translation (3 parsers)
|
|
183
|
+
{
|
|
184
|
+
id: "google_translate",
|
|
185
|
+
name: "Google Translate",
|
|
186
|
+
category: "Translation",
|
|
187
|
+
description: "Translate text using Google Translate",
|
|
188
|
+
aparserName: "Google::Translate"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
id: "bing_translate",
|
|
192
|
+
name: "Bing Translate",
|
|
193
|
+
category: "Translation",
|
|
194
|
+
description: "Translate text using Bing Translator",
|
|
195
|
+
aparserName: "Bing::Translate"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
id: "yandex_translate",
|
|
199
|
+
name: "Yandex Translate",
|
|
200
|
+
category: "Translation",
|
|
201
|
+
description: "Translate text using Yandex Translator",
|
|
202
|
+
aparserName: "Yandex::Translate"
|
|
203
|
+
},
|
|
204
|
+
// HTML Content Extraction (3 parsers)
|
|
205
|
+
{
|
|
206
|
+
id: "link_extractor",
|
|
207
|
+
name: "Link Extractor",
|
|
208
|
+
category: "HTML Content",
|
|
209
|
+
description: "Extract all links from web pages",
|
|
210
|
+
aparserName: "HTML::LinkExtractor"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: "article_extractor",
|
|
214
|
+
name: "Article Extractor",
|
|
215
|
+
category: "HTML Content",
|
|
216
|
+
description: "Extract article content using Mozilla Readability",
|
|
217
|
+
aparserName: "HTML::ArticleExtractor"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: "text_extractor",
|
|
221
|
+
name: "Text Extractor",
|
|
222
|
+
category: "HTML Content",
|
|
223
|
+
description: "Extract all text content from web pages",
|
|
224
|
+
aparserName: "HTML::TextExtractor"
|
|
225
|
+
},
|
|
226
|
+
// Additional Search (6 parsers)
|
|
227
|
+
{
|
|
228
|
+
id: "yahoo_search",
|
|
229
|
+
name: "Yahoo Search",
|
|
230
|
+
category: "Search Engines",
|
|
231
|
+
description: "Yahoo web search results",
|
|
232
|
+
aparserName: "Yahoo::Search"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
id: "yandex_search",
|
|
236
|
+
name: "Yandex Search",
|
|
237
|
+
category: "Search Engines",
|
|
238
|
+
description: "Yandex web search results",
|
|
239
|
+
aparserName: "Yandex::Search"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
id: "baidu_search",
|
|
243
|
+
name: "Baidu Search",
|
|
244
|
+
category: "Search Engines",
|
|
245
|
+
description: "Baidu web search results",
|
|
246
|
+
aparserName: "Baidu::Search"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
id: "rambler_search",
|
|
250
|
+
name: "Rambler Search",
|
|
251
|
+
category: "Search Engines",
|
|
252
|
+
description: "Rambler web search results",
|
|
253
|
+
aparserName: "Rambler::Search"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: "you_search",
|
|
257
|
+
name: "You.com Search",
|
|
258
|
+
category: "Search Engines",
|
|
259
|
+
description: "You.com AI-powered search",
|
|
260
|
+
aparserName: "You::Search"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: "deepai",
|
|
264
|
+
name: "DeepAI",
|
|
265
|
+
category: "AI Chat",
|
|
266
|
+
description: "DeepAI assistant",
|
|
267
|
+
aparserName: "FreeAI::DeepAI"
|
|
268
|
+
}
|
|
269
|
+
];
|
|
270
|
+
export function getParserById(id) {
|
|
271
|
+
return PARSERS.find(p => p.id === id);
|
|
272
|
+
}
|
|
273
|
+
export function getParserByAParserName(name) {
|
|
274
|
+
return PARSERS.find(p => p.aparserName === name);
|
|
275
|
+
}
|
|
276
|
+
export function getParsersByCategory(category) {
|
|
277
|
+
return PARSERS.filter(p => p.category === category);
|
|
278
|
+
}
|
|
279
|
+
export function getAllCategories() {
|
|
280
|
+
return [...new Set(PARSERS.map(p => p.category))];
|
|
281
|
+
}
|
|
282
|
+
//# sourceMappingURL=parsers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../src/parsers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,MAAM,CAAC,MAAM,OAAO,GAAmB;IACnC,sBAAsB;IACtB;QACI,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,SAAS;QACnB,WAAW,EAAE,8CAA8C;QAC3D,WAAW,EAAE,oBAAoB;KACpC;IACD;QACI,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,SAAS;QACnB,WAAW,EAAE,sCAAsC;QACnD,WAAW,EAAE,iBAAiB;KACjC;IACD;QACI,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,SAAS;QACnB,WAAW,EAAE,4BAA4B;QACzC,WAAW,EAAE,g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C;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAY;IAC/C,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACjD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC5B,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC"}
|
package/dist/test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":";AAEA;;;GAGG"}
|
package/dist/test.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
/**
|
|
3
|
+
* Simple test to verify MCP server basics
|
|
4
|
+
* Tests tool listing without requiring API key
|
|
5
|
+
*/
|
|
6
|
+
import { PARSERS, getAllCategories } from "./parsers.js";
|
|
7
|
+
console.log("๐งช Testing ayga-mcp-client (Node.js)\n");
|
|
8
|
+
// Test 1: Parser configuration
|
|
9
|
+
console.log("Test 1: Parser Configuration");
|
|
10
|
+
console.log(`Total parsers: ${PARSERS.length}`);
|
|
11
|
+
console.log(`Categories: ${getAllCategories().length}`);
|
|
12
|
+
console.log();
|
|
13
|
+
// Test 2: List all parsers by category
|
|
14
|
+
console.log("Test 2: Parsers by Category");
|
|
15
|
+
const categories = getAllCategories();
|
|
16
|
+
categories.forEach((category) => {
|
|
17
|
+
const parsers = PARSERS.filter((p) => p.category === category);
|
|
18
|
+
console.log(` ${category}: ${parsers.length} parsers`);
|
|
19
|
+
});
|
|
20
|
+
console.log();
|
|
21
|
+
// Test 3: Sample parsers
|
|
22
|
+
console.log("Test 3: Sample Parsers");
|
|
23
|
+
const samples = [
|
|
24
|
+
"perplexity",
|
|
25
|
+
"chatgpt",
|
|
26
|
+
"google_search",
|
|
27
|
+
"instagram_profile",
|
|
28
|
+
"youtube_search",
|
|
29
|
+
"google_trends",
|
|
30
|
+
];
|
|
31
|
+
samples.forEach((id) => {
|
|
32
|
+
const parser = PARSERS.find((p) => p.id === id);
|
|
33
|
+
if (parser) {
|
|
34
|
+
console.log(` โ
${parser.name} (${parser.category})`);
|
|
35
|
+
console.log(` A-Parser: ${parser.aparserName}`);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
console.log();
|
|
39
|
+
// Test 4: Tool names
|
|
40
|
+
console.log("Test 4: MCP Tool Names");
|
|
41
|
+
const toolNames = PARSERS.slice(0, 5).map((p) => `search_${p.id}`);
|
|
42
|
+
toolNames.forEach((name) => console.log(` - ${name}`));
|
|
43
|
+
console.log(` ... and ${PARSERS.length - 5} more`);
|
|
44
|
+
console.log();
|
|
45
|
+
console.log("โ
All basic tests passed!");
|
|
46
|
+
console.log();
|
|
47
|
+
console.log("๐ To test with real API:");
|
|
48
|
+
console.log(" 1. Set REDIS_API_KEY environment variable");
|
|
49
|
+
console.log(" 2. Run: npm run dev");
|
|
50
|
+
console.log(" 3. Or use in VS Code/Claude Desktop with provided config");
|
|
51
|
+
//# sourceMappingURL=test.js.map
|
package/dist/test.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;AAEtD,+BAA+B;AAC/B,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;AA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AG,EAAE,CAAC;AAEd,qBAAqB;AACrB,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;AACtC,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACnE,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC;AACxD,OAAO,CAAC,GAAG,CAAC,aAAa,OAAO,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC;AACpD,OAAO,CAAC,GAAG,EAAE,CAAC;AAEd,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AACzC,OAAO,CAAC,GAAG,EAAE,CAAC;AACd,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AACzC,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;AAC3D,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;AACrC,OAAO,CAAC,GAAG,CAAC,4DAA4D,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ayga-mcp-client",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "MCP client for Redis API with 40 AI parsers across 9 categories (Perplexity, ChatGPT, Instagram, TikTok, Google Trends, Pinterest, Link Extractor, YouTube, Translation, Search Engines)",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mcp",
|
|
7
|
+
"model-context-protocol",
|
|
8
|
+
"redis",
|
|
9
|
+
"ai-parsers",
|
|
10
|
+
"perplexity",
|
|
11
|
+
"chatgpt",
|
|
12
|
+
"claude",
|
|
13
|
+
"instagram",
|
|
14
|
+
"tiktok",
|
|
15
|
+
"youtube",
|
|
16
|
+
"google-trends",
|
|
17
|
+
"pinterest",
|
|
18
|
+
"translation"
|
|
19
|
+
],
|
|
20
|
+
"author": "Ayga <https://ayga.tech>",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"homepage": "https://github.com/ozand/ayga-mcp-nodejs#readme",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/ozand/ayga-mcp-nodejs.git"
|
|
26
|
+
},
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/ozand/ayga-mcp-nodejs/issues"
|
|
29
|
+
},
|
|
30
|
+
"main": "dist/index.js",
|
|
31
|
+
"type": "module",
|
|
32
|
+
"bin": {
|
|
33
|
+
"ayga-mcp-client": "dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsc",
|
|
42
|
+
"dev": "tsx src/index.ts",
|
|
43
|
+
"test": "tsx src/test.ts",
|
|
44
|
+
"prepublishOnly": "npm run build",
|
|
45
|
+
"clean": "rm -rf dist"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^20.0.0",
|
|
52
|
+
"tsx": "^4.0.0",
|
|
53
|
+
"typescript": "^5.3.0"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=18.0.0"
|
|
57
|
+
}
|
|
58
|
+
}
|