Korea Stock Analyzer MCP Server KOSPI KOSDAQ
Analyze KOSPI and KOSDAQ stocks on the MCP server using six legendary strategies: Buffett, Lynch, Graham, Greenblatt, Fisher and Templeton.
npx -y @Mrbaeksang/korea-stock-analyzer-mcpOverview
This MCP (Model Context Protocol) server analyzes South Korean equities listed on KOSPI and KOSDAQ using six well-known stock-picking strategies: Buffett, Lynch, Graham, Greenblatt and Fisher and Templeton. It packages each strategy as an MCP-compatible tool so language models and developer apps can query structured analysis and screening results programmatically. The server is useful for building screener UIs, automations (alerts, portfolio rebalancing), or feeding strategy-informed signals into larger decision systems.
Designed for developers, the server provides data ingestion, per-strategy scoring, and an HTTP/MCP interface that returns normalized JSON results for each ticker. This makes it straightforward to integrate the analyses into notebooks, web backends, or chat assistants that rely on the MCP for tool invocation.
Features
- Strategy implementations: Buffett, Lynch, Graham, Greenblatt, Fisher, Templeton
- Dual-market support: KOSPI and KOSDAQ
- MCP-compatible tool metadata and endpoints for model-driven orchestration
- Stock-level scoring and ranked lists per strategy
- Configurable data source (local CSV, public APIs) and update scheduling
- Docker-friendly deployment and simple CLI for local testing
- JSON output schema suitable for downstream automation
Installation / Configuration
Clone the repository, install dependencies, and run the server. Example assumes Python 3.9+.
Clone and install:
Environment variables (example):
# options: api | csv
Run locally:
Run with Docker:
Configuration file (config.yml example):
server:
host: 0.0.0.0
port: 8080
data:
source: api
api_key: "REPLACE_WITH_KEY"
update_interval_minutes: 60
mcp:
enable: true
tools_path: /mcp/tools
Available Resources
The server exposes an MCP-style tool registry and REST endpoints. Key endpoints:
| Endpoint | Method | Description |
|---|---|---|
| /mcp/tools | GET | MCP-compatible tool metadata for each strategy |
| /analyze | POST | Single- or multi-ticker analysis request (specify strategy) |
| /rankings | GET | Ranked list for a strategy and market |
| /tickers | GET | List of available tickers with market (KOSPI/KOSDAQ) |
| /health | GET | Server health/status |
Sample /analyze request:
Sample response (trimmed):
Output schema (summary):
| Field | Type | Description |
|---|---|---|
| ticker | string | Exchange-symbol, e.g., 005930.KS |
| name | string | Company name |
| market | string | KOSPI or KOSDAQ |
| strategy | string | One of the implemented strategies |
| score | number | Normalized 0–100 ranking score |
| metrics | object | Key financial metrics used by the strategy |
| recommendation | string | Simplified action (Buy/Hold/Sell/Consider) |
Use Cases
- Strategy-driven screener
- Request /rankings?strategy=Buffett&market=KOSPI to get Buffett-style value candidates, then render a UI table sorted by score.
- Automated alerts
- Poll /analyze for a watchlist every hour and trigger notifications when recommendation changes to “Buy”.
- Model orchestration
- Use the /mcp/tools endpoint to let an LLM discover and call the proper strategy tool via MCP; the tool returns structured JSON the model can reason with.
- Research and backtesting
- Export ranked lists to CSV and feed into a backtest engine to evaluate strategy returns over historical windows.
- Portfolio construction
- Combine scores from multiple strategies (ensemble) by calling /analyze for the same tickers with different strategies and computing a weighted average.
Concrete example — check top 5 Graham picks on KOSDAQ:
You can then ingest this JSON into a plotting library or spreadsheet for further analysis.
Notes for Developers
- Strategy logic is implemented in modular handlers under the strategies/ directory to simplify customization or adding new criteria.
- Data ingestion supports CSV import for offline/backfill workflows: drop a CSV into data/imports/ and run the provided loader script.
- The MCP metadata endpoint follows a predictable JSON structure so LLMs and other orchestration layers can dynamically discover available tools and call them safely.
- Security: when exposing the server publicly, set proper CORS, API auth, and rate limits. Use HTTPS in production.
For implementation details, code layout, and contribution guidelines, refer to the repository README and the source under the strategies/ and server/ folders.