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 CHANGED
@@ -1,119 +1,192 @@
1
- # RagAlgo: Dynamic RAG Engine for AI Reliability
2
-
3
- > **Global Beta**: Currently specialized in **Korean Finance (Stocks & Crypto)**, but built on a universal "Tag & Score" protocol applicable to any domain.
4
-
5
- RagAlgo is not just a data API. It is a **"State-of-Truth" Provider** designed to prevent LLM hallucinations when dealing with **complex static knowledge** and **highly volatile dynamic data**.
6
-
7
- ### Why RagAlgo?
8
- Traditional RAG (SQL/Vector DB) often fails to capture the "current context" of fast-changing reality. RagAlgo solves this by converting data into **Mathematical Scores** and **Standardized Tags**.
9
-
10
- ### Core Philosophy
11
- 1. **Sanitized Data:** We filter out noise so AI only ingests high-quality signals.
12
- 2. **Mathematical Scoring:** We translate complex movements into simple scores (e.g., `Chart Score: 9.5`), giving AI a clear ground truth to reason upon.
13
- 3. **Universal Protocol:** Our "Tag & Score" architecture is designed to **systematize and standardize any data domain**—including Legal, Medical, and Tech—into a format that AI can flawlessly understand and judge.
14
-
15
-
16
- ### Flexible Integration: Scored vs. Non-Scored
17
- We respect your freedom to build. Choose the mode that fits your pipeline:
18
-
19
- | Mode | Target User | Description |
20
- |------|-------------|-------------|
21
- | **Scored API** (AI-Ready) | Builders & Startups | RagAlgo's math engines sanitize and score everything. Zero hallucinations. |
22
- | **Non-Scored API** (Raw Mode) | Data Scientists & Engineers | Pure, sanitized data feeds for your custom pipelines. Perfect for fine-tuning, **n8n** automation, **LangChain** agents, or **Flowise** workflows. |
23
-
24
- ---
25
-
26
- # RagAlgo MCP Server (KOR)
27
-
28
- 금융 뉴스 및 데이터 API를 MCP(Model Context Protocol)로 제공하는 서버입니다.
29
-
30
- ## 설치
31
-
32
- ```bash
33
- cd mcp-server
34
- npm install
35
- npm run build
36
- ```
37
-
38
- ## 환경변수 설정
39
-
40
- ```bash
41
- # Windows (PowerShell)
42
- $env:RAGALGO_API_KEY="ragalgo_scored_test_a3ed9bd570436d46"
43
-
44
- # Windows (CMD)
45
- set RAGALGO_API_KEY=ragalgo_scored_test_a3ed9bd570436d46
46
-
47
- # Mac/Linux
48
- export RAGALGO_API_KEY="ragalgo_scored_test_a3ed9bd570436d46"
49
- ```
50
-
51
- ## Claude Desktop 설정
52
-
53
- `%APPDATA%\Claude\claude_desktop_config.json` 파일에 추가:
54
-
55
- ```json
56
- {
57
- "mcpServers": {
58
- "ragalgo": {
59
- "command": "node",
60
- "args": ["C:\\coding\\RagAlgo\\mcp-server\\dist\\index.js"],
61
- "env": {
62
- "RAGALGO_API_KEY": "ragalgo_scored_test_a3ed9bd570436d46"
63
- }
64
- }
65
- }
66
- }
67
- ```
68
-
69
- ## 제공 도구 (9개)
70
-
71
- | 도구 | 설명 |
72
- |------|------|
73
- | `get_news` | 금융 뉴스 조회 (점수 제외) |
74
- | `get_news_scored` | 금융 뉴스 조회 (점수 포함) |
75
- | `get_chart_stock` | 주식 차트 점수 조회 |
76
- | `get_chart_coin` | 코인 차트 점수 조회 |
77
- | `get_financials` | 재무제표 조회 |
78
- | `get_snapshots` | 일별 스냅샷 조회 |
79
- | `search_tags` | 태그 검색 |
80
- | `match_tags` | 텍스트→태그 매칭 |
81
- | `get_trends` | 태그별 트렌드 조회 |
82
-
83
- ## 사용 예시
84
-
85
- ### Claude Desktop에서
86
-
87
- ```
88
- "삼성전자 최근 뉴스 5개 보여줘"
89
- get_news_scored(tag="삼성전자", limit=5)
90
-
91
- "반도체 관련 호재 뉴스만 찾아줘"
92
- get_news_scored(tag="반도체", verdict="bullish")
93
-
94
- "005930 재무제표 보여줘"
95
- get_financials(ticker="005930")
96
-
97
- "비트코인 차트 분석"
98
- → get_chart_coin(ticker="KRW-BTC")
99
- ```
100
-
101
- ## API 키 종류
102
-
103
- | Tier | API Key | 접근 가능 도구 |
104
- |------|---------|---------------|
105
- | nonscored | `ragalgo_nonscored_test_...` | get_news, get_financials, get_chart_*, search_tags, match_tags, get_trends |
106
- | scored | `ragalgo_scored_test_...` | 위 전부 + get_news_scored, get_snapshots |
107
-
108
- ## 개발
109
-
110
- ```bash
111
- # 개발 모드 실행
112
- npm run dev
113
-
114
- # 빌드
115
- npm run build
116
-
117
- # 프로덕션 실행
118
- npm start
119
- ```
1
+ # RagAlgo: Dynamic RAG Engine for AI Reliability
2
+
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)
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
+ ![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
+ ---
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
@@ -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 {};