ragalgo-mcp-server 1.0.5 → 1.0.6
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 +192 -119
- package/dist/check_sdk.d.ts +1 -0
- package/dist/check_sdk.js +11 -0
- package/dist/check_sse.d.ts +1 -0
- package/dist/check_sse.js +10 -0
- package/dist/index.d.ts +0 -7
- package/dist/index.js +490 -208
- package/dist/tools/chart.d.ts +37 -20
- package/dist/tools/chart.js +6 -7
- package/dist/tools/financials.d.ts +16 -5
- package/dist/tools/financials.js +1 -1
- package/dist/tools/news.d.ts +56 -11
- package/dist/tools/news.js +9 -22
- package/dist/tools/research.d.ts +27 -14
- package/dist/tools/research.js +9 -9
- package/dist/tools/rooms.d.ts +33 -0
- package/dist/tools/rooms.js +43 -0
- package/dist/tools/snapshots.d.ts +16 -1
- package/dist/tools/snapshots.js +16 -3
- package/dist/tools/tags.d.ts +56 -16
- package/dist/tools/tags.js +13 -2
- package/dist/tools/trends.d.ts +8 -1
- package/dist/utils/api.js +63 -21
- package/package.json +45 -39
- package/server.json +32 -0
package/README.md
CHANGED
|
@@ -1,119 +1,192 @@
|
|
|
1
|
-
# RagAlgo: Dynamic RAG Engine for AI Reliability
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
1
|
+
# RagAlgo: Dynamic RAG Engine for AI Reliability
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/ragalgo-mcp-server)
|
|
4
|
+
[](https://www.npmjs.com/package/ragalgo-mcp-server)
|
|
5
|
+
[](https://github.com/kokogo100/ragalgo-mcp-server)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://modelcontextprotocol.io)
|
|
8
|
+
|
|
9
|
+
> **"Your AI is an Analyst, NOT a Day Trader."**
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
RagAlgo is an **MCP Server** that provides **mathematically scored financial context** (Korean Stocks/Crypto) to AI agents.
|
|
13
|
+
We focus on **"State-of-Truth"** (Daily Closed Data) to prevent AI hallucinations caused by real-time market noise.
|
|
14
|
+
|
|
15
|
+
- **Analyst, Not Broker:** We provide "Daily Analysis Reports" (Post-Market), not real-time tick data.
|
|
16
|
+
- **Scored Context:** Instead of raw prices, we give you "Scores" (0~100) and "Zones" (Forest vs Tree).
|
|
17
|
+
- **Global Market Specialist:** Optimized for US, UK, JP, KR, and Crypto.
|
|
18
|
+
|
|
19
|
+
👉 **[Official Website (ragalgo.com)](https://www.ragalgo.com)**
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 📖 Architecture & Whitepaper
|
|
24
|
+
|
|
25
|
+
Discover why RagAlgo is the **"Hippocampus"** for Agentic AI, not just another RAG.
|
|
26
|
+
|
|
27
|
+
### 🏗️ Data Pipeline Architecture
|
|
28
|
+
|
|
29
|
+
Our production system on Railway processes global financial data 24/7:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
33
|
+
│ RagAlgo Data Pipeline (Railway) │
|
|
34
|
+
├─────────────────────────────────────────────────────────────────────────────┤
|
|
35
|
+
│ │
|
|
36
|
+
│ 📥 COLLECT 🔍 FILTER 🏷️ TAG 📊 SCORE │
|
|
37
|
+
│ ───────────── ────────────── ───────── ────────── │
|
|
38
|
+
│ • KR-News-Collector • filter-worker-1 • tag-worker • Gemini-1 │
|
|
39
|
+
│ • US-News-Collector • filter-worker-2 • Meta-Hierarchy • Gemini-2 │
|
|
40
|
+
│ • UK-News-Collector • filter-worker-3 • Worker • ... │
|
|
41
|
+
│ • JP-News-Collector • ibkr_filter_worker3 │ • Gemini-7 │
|
|
42
|
+
│ • research-collector │ │ │ │
|
|
43
|
+
│ │ │ │ │
|
|
44
|
+
│ ════════════════════════════════════════════════════════════════════════ │
|
|
45
|
+
│ ↓ │
|
|
46
|
+
│ 📦 SNAPSHOT (Daily 18:00 KST) │
|
|
47
|
+
│ ────────────────────────────── │
|
|
48
|
+
│ • KR-Snapshot • US-Snapshot │
|
|
49
|
+
│ • UK-Snapshot • JP-Snapshot │
|
|
50
|
+
│ • CRY-Snapshot • Unified-Snapshot │
|
|
51
|
+
│ ↓ │
|
|
52
|
+
│ 🚀 SERVE (MCP Server) │
|
|
53
|
+
│ ───────────────────── │
|
|
54
|
+
│ • RagAlgo-Service (SSE/stdio) │
|
|
55
|
+
│ • ragalgo-relay-server (WebSocket) │
|
|
56
|
+
│ │
|
|
57
|
+
└─────────────────────────────────────────────────────────────────────────────┘
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
* **[Vision Whitepaper (The Hook)](./docs/RagAlgo_Report_EN.md)**
|
|
63
|
+
* **Concept**: Why RagAlgo is a "Semantic Digital Twin" (SDT) using the Hippocampus analogy.
|
|
64
|
+
* **Value**: Explains the "Self-Growing Taxonomy" and "Data Flywheel" effect.
|
|
65
|
+
* **[Technical Report (The Proof)](./docs/CKN_Architecture_EN.md)**
|
|
66
|
+
* **Deep Dive**: Detailed anatomy of the Contextual Knowledge Network (CKN).
|
|
67
|
+
* **2025 Trend**: How RagAlgo serves as the memory layer for **Agentic AI** (e.g., PepsiCo/Salesforce Agentforce).
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 💡 Why "Daily Close"?
|
|
72
|
+
|
|
73
|
+
Users often ask: *"Why isn't the chart data real-time?"*
|
|
74
|
+
|
|
75
|
+
**Because AI performs better with clarity.**
|
|
76
|
+
Real-time tick data is full of noise and volatility. If you feed an LLM raw live prices, it often hallucinates patterns that don't exist.
|
|
77
|
+
|
|
78
|
+
RagAlgo acts like a **Professional Technical Analyst** who works after the market closes:
|
|
79
|
+
1. **Wait for the dust to settle** (Market Close).
|
|
80
|
+
2. **Analyze the day's battle** (Daily Candle & Aux Indicators).
|
|
81
|
+
3. **Deliver a "Confirmed Strategy"** to your AI.
|
|
82
|
+
|
|
83
|
+
Use RagAlgo to build **"Investment Advisors"**, not "High-Frequency Trading Bots".
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 🚀 Quick Start
|
|
88
|
+
|
|
89
|
+
### Claude Desktop Configuration
|
|
90
|
+
|
|
91
|
+
Add this to your config file:
|
|
92
|
+
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
93
|
+
- **Mac:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
94
|
+
|
|
95
|
+
#### ☁️ Cloud Mode (Recommended - No installation required)
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"mcpServers": {
|
|
99
|
+
"ragalgo": {
|
|
100
|
+
"url": "https://ragalgo-service-production.up.railway.app/sse",
|
|
101
|
+
"env": {
|
|
102
|
+
"RAGALGO_API_KEY": "YOUR_API_KEY_HERE"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### 📦 Local Mode (Requires Node.js)
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"mcpServers": {
|
|
113
|
+
"ragalgo": {
|
|
114
|
+
"command": "npx",
|
|
115
|
+
"args": ["-y", "ragalgo-mcp-server", "--stdio"],
|
|
116
|
+
"env": {
|
|
117
|
+
"RAGALGO_API_KEY": "YOUR_API_KEY_HERE"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
> **Tip:** You can get a **Free 1,000 Call Key** instantly at [RagAlgo Dashboard](https://www.ragalgo.com/dashboard).
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 📚 Usage Examples (Cookbook)
|
|
129
|
+
|
|
130
|
+
We have a **dedicated repository** for practical examples to help you get started quickly.
|
|
131
|
+
Please visit the **[RagAlgo Examples Repository](https://github.com/kokogo100/ragalgo-examples)**.
|
|
132
|
+
|
|
133
|
+
### What's Inside?
|
|
134
|
+
- **8 Step-by-Step Recipes:** From basic data fetching to advanced AI agents.
|
|
135
|
+
- **Skeleton Code + Prompts:** Copy-paste ready resources.
|
|
136
|
+
- **Scenarios:**
|
|
137
|
+
- 🐣 **Basic:** Get stock scores in 5 minutes.
|
|
138
|
+
- 🧪 **Intermediate:** Verify technical signals with AI.
|
|
139
|
+
- 🚀 **Advanced:** Build an autonomous reasoning agent (Mock Trading Audit).
|
|
140
|
+
- ☕ **Morning Briefing:** Create a bot that emails you a daily market summary.
|
|
141
|
+
|
|
142
|
+
> **"Skeleton + Prompt" Approach:** We provide the ingredients. You ask ChatGPT/Claude to cook!
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 🌍 Supported Markets & Roadmap
|
|
147
|
+
|
|
148
|
+
RagAlgo is expanding its CKN coverage globally. Currently, **US, UK, Japan, Korea, and Crypto** markets are fully supported.
|
|
149
|
+
|
|
150
|
+
| Market | Asset Class | Status |
|
|
151
|
+
| :--- | :--- | :--- |
|
|
152
|
+
| **🇰🇷 Korea** | KOSPI / KOSDAQ | **🟢 Live** (Real-time Sentiment & Charts) |
|
|
153
|
+
| **🇺🇸 USA** | NYSE / NASDAQ | **🟢 Live** (Daily Scored Context) |
|
|
154
|
+
| **🇯🇵 Japan** | Nikkei 225 | **🟢 Live** (Daily Scored Context) |
|
|
155
|
+
| **🇬🇧 UK** | LSE | **🟢 Live** (Daily Scored Context) |
|
|
156
|
+
| **🪙 Crypto** | Global (Upbit/Binance) | **🟢 Live** (Real-time Sentiment & Charts) |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## 🛠 Tools
|
|
161
|
+
|
|
162
|
+
> **⚠️ CORE CONCEPT: Scored vs Raw**
|
|
163
|
+
> - **`get_news_scored` (Default):** Returns only significant news (Scores ≠ 0). Best for AI decision making.
|
|
164
|
+
> - **`get_news` (Raw):** Returns ALL news including noise. Use this ONLY if you need raw data feed.
|
|
165
|
+
|
|
166
|
+
| Tool | Description |
|
|
167
|
+
|------|-------------|
|
|
168
|
+
| `get_news_scored` | **[RECOMMENDED]** News **WITH** AI Sentiment Scores (-10 ~ +10). Filters out noise. |
|
|
169
|
+
| `get_news` | **[Advanced]** Raw News **WITHOUT** scores. Includes 0-score noise. Use only if you build your own scorer. |
|
|
170
|
+
| `get_chart_stock` | **[Core]** Global Stock (US/UK/JP/KR) Technical Analysis (Daily Close). |
|
|
171
|
+
| `get_chart_coin` | **[Core]** Global Crypto Technical Analysis (Daily Close). |
|
|
172
|
+
| `get_snapshots` | **[Best]** Market Overview (News + Chart + Trend) in one call. |
|
|
173
|
+
| `get_financials` | Corporate Financials (Quarterly/Yearly). |
|
|
174
|
+
| `search_tags` | Convert names (e.g., "Samsung") to RagAlgo Tags. |
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 📡 Real-time WebSocket (Business Tier)
|
|
179
|
+
|
|
180
|
+
For users who *really* need live data (e.g., for monitoring dashboards), we offer a WebSocket stream.
|
|
181
|
+
*Note: This is strictly for monitoring, not for LLM inference context.*
|
|
182
|
+
|
|
183
|
+
- **Access:** Business Plan subscribers (Includes 30 connections).
|
|
184
|
+
- **Address:** `wss://ragalgo-relay-server-1-production.up.railway.app`
|
|
185
|
+
- **Guide:** See [Developer Docs](https://www.ragalgo.com/docs) for implementation details.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## 💬 Support
|
|
190
|
+
|
|
191
|
+
- **Website:** [ragalgo.com](https://www.ragalgo.com)
|
|
192
|
+
- **Email:** support@ragalgo.com
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
const server = new Server({ name: 'test', version: '1.0' }, { capabilities: {} });
|
|
3
|
+
if (typeof server.close === 'function') {
|
|
4
|
+
console.log('Server has close method');
|
|
5
|
+
}
|
|
6
|
+
else {
|
|
7
|
+
console.log('Server DOES NOT have close method');
|
|
8
|
+
}
|
|
9
|
+
// Check other properties
|
|
10
|
+
console.log('Server keys:', Object.keys(server));
|
|
11
|
+
console.log('Server proto keys:', Object.getOwnPropertyNames(Object.getPrototypeOf(server)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
|
|
2
|
+
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
+
import { Socket } from 'net';
|
|
4
|
+
// Mock objects to satisfy the constructor
|
|
5
|
+
const req = new IncomingMessage(new Socket());
|
|
6
|
+
const res = new ServerResponse(req);
|
|
7
|
+
const transport = new SSEServerTransport('/messages', res);
|
|
8
|
+
console.log('Has sessionId:', 'sessionId' in transport);
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
console.log('SessionId value:', transport.sessionId);
|
package/dist/index.d.ts
CHANGED