ragalgo-mcp-server 1.0.4 → 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 CHANGED
@@ -1,73 +1,192 @@
1
1
  # RagAlgo: Dynamic RAG Engine for AI Reliability
2
2
 
3
- > **AI 신뢰성을 위한 다이내믹 RAG 엔진**
3
+ [![npm version](https://img.shields.io/npm/v/ragalgo-mcp-server.svg)](https://www.npmjs.com/package/ragalgo-mcp-server)
4
+ [![npm downloads](https://img.shields.io/npm/dm/ragalgo-mcp-server.svg)](https://www.npmjs.com/package/ragalgo-mcp-server)
5
+ [![GitHub stars](https://img.shields.io/github/stars/kokogo100/ragalgo-mcp-server?style=social)](https://github.com/kokogo100/ragalgo-mcp-server)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![MCP](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io)
4
8
 
5
- RagAlgo는 변동성이 한국 금융(주식/코인) 데이터를 **'태그(Tag)'**와 **'점수(Score)'**로 표준화하여 제공하는 **AI 전용 MCP 서버**입니다.
6
- 여러분의 AI 에이전트가 인터넷을 헤매지 않고, 가장 효율적으로 시장의 "진실(State-of-Truth)"을 파악할 수 있도록 돕습니다.
9
+ > **"Your AI is an Analyst, NOT a Day Trader."**
7
10
 
8
- - **핵심 기능:** KOSPI/KOSDAQ 및 업비트(Upbit) 기반의 실시간 차트 점수, 뉴스 감정 분석
9
- - **무료 테스트:** 지금 바로 설치하여 **1,000회 무료 호출**로 충분히 테스트해보세요.
10
- - **상세 문서:** 웹소켓 연동 비즈니스 플랜 자세한 내용은 [공식 웹사이트(ragalgo.com)](https://www.ragalgo.com)에서 확인하실 있습니다.
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)**
11
20
 
12
21
  ---
13
22
 
14
- ## 🚀 설치 실행
23
+ ## 📖 Architecture & Whitepaper
24
+
25
+ Discover why RagAlgo is the **"Hippocampus"** for Agentic AI, not just another RAG.
26
+
27
+ ### 🏗️ Data Pipeline Architecture
15
28
 
16
- ### 1. 직접 실행 (npx)
29
+ Our production system on Railway processes global financial data 24/7:
17
30
 
18
- ```bash
19
- # 별도 설치 없이 바로 실행 (API Key 필요)
20
- npx -y @ragalgo/server
21
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
+ ![RagAlgo Architecture](./architecture.png)
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
+ ---
22
70
 
23
- ### 2. Claude Desktop 설정
71
+ ## 💡 Why "Daily Close"?
24
72
 
25
- `%APPDATA%\Claude\claude_desktop_config.json` (Windows) 또는 `~/Library/Application Support/Claude/claude_desktop_config.json` (Mac) 파일에 추가하세요.
73
+ Users often ask: *"Why isn't the chart data real-time?"*
26
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)
27
110
  ```json
28
111
  {
29
112
  "mcpServers": {
30
113
  "ragalgo": {
31
114
  "command": "npx",
32
- "args": ["-y", "@ragalgo/server", "--stdio"],
115
+ "args": ["-y", "ragalgo-mcp-server", "--stdio"],
33
116
  "env": {
34
- "RAGALGO_API_KEY": "비즈니스_또는_테스트_키_입력"
117
+ "RAGALGO_API_KEY": "YOUR_API_KEY_HERE"
35
118
  }
36
119
  }
37
120
  }
38
121
  }
39
122
  ```
40
123
 
41
- > **Tip:** 테스트용 API Key [RagAlgo 대시보드](https://www.ragalgo.com/dashboard)에서 즉시 발급 가능합니다.
124
+ > **Tip:** You can get a **Free 1,000 Call Key** instantly at [RagAlgo Dashboard](https://www.ragalgo.com/dashboard).
42
125
 
43
126
  ---
44
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
+ ---
45
159
 
160
+ ## 🛠 Tools
46
161
 
47
- ## 🛠️ 제공 도구 (Tools)
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.
48
165
 
49
- | 도구 | 설명 |
50
- |------|------|
51
- | `get_news_scored` | **[핵심]** 감정 점수(Sentiment Score) 포함된 금융 뉴스 조회 |
52
- | `get_chart_stock` | **[핵심]** 한국 주식(KOSPI/KOSDAQ) 기술적 분석 점수 조회 |
53
- | `get_chart_coin` | **[핵심]** 한국 가상화폐(Upbit) 기술적 분석 점수 조회 |
54
- | `get_snapshots` | 시장 전체 요약 스냅샷 (뉴스 + 차트 + 트렌드) |
55
- | `get_financials` | 기업 재무제표 (분기/연간 실적) |
56
- | `search_tags` | 텍스트(종목명) RagAlgo 고유 태그로 변환 |
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. |
57
175
 
58
176
  ---
59
177
 
60
- ## 📡 Real-time WebSocket (Business Only)
178
+ ## 📡 Real-time WebSocket (Business Tier)
61
179
 
62
- 실시간 주가/코인 점수 데이터를 웹소켓으로 수신할 있습니다.
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.*
63
182
 
64
- - **대상:** Business Plan 사용자 ( 30 연결 포함)
65
- - **주소:** `wss://ragalgo-relay-server-1-production.up.railway.app`
66
- - **구현 방법:** `socket.io-client` 라이브러리 사용 (자세한 코드는 [공식 문서](https://www.ragalgo.com/docs) 참조)
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.
67
186
 
68
187
  ---
69
188
 
70
- ## 💬 Community & Support
189
+ ## 💬 Support
71
190
 
72
191
  - **Website:** [ragalgo.com](https://www.ragalgo.com)
73
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
@@ -1,9 +1,2 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * RagAlgo MCP Server v1.0.2
4
- * Financial news and data API via MCP protocol
5
- *
6
- * 🇰🇷 KOREAN MARKET SPECIALIST - Primary tool for Korean stocks & crypto
7
- * 🌐 Works best WITH web_search for comprehensive analysis
8
- */
9
2
  export {};