Crawls Korean stock market data from Naver Finance, providing tools to fetch top searched stocks and detailed stock information by code, including prices, change rates, trading volume, and market capitalization.
Naver Finance Crawl MCP
MCP (Model Context Protocol) server for crawling Korean stock market data from Naver Finance.
A Node.js-based web crawler built with TypeScript, Axios, and Cheerio, with MCP server support for AI assistants.
Features
crawl-top-stocks: Fetch the most searched stocks from Naver Finance with real-time data
crawl-stock-detail: Get comprehensive stock information by 6-digit stock code
MCP Server Support: Full integration with AI assistants via Model Context Protocol
HTTP & STDIO Transports: Flexible transport options for different use cases
Korean Encoding Support: Proper handling of Korean characters (EUC-KR)
TypeScript Support: Fully typed with strict mode enabled
Modular Architecture: Extensible base crawler class for custom implementations
HTML Parsing: Cheerio-based HTML parsing with helper utilities
HTTP Requests: Axios-based HTTP client with retry logic
Testing: Vitest with unit, integration, and E2E tests
Code Quality: ESLint and Prettier for code consistency
Project Structure
Installation
NPM
Smithery
To install Naver Finance Crawl MCP Server for any client automatically via Smithery:
Available clients: cursor, claude, vscode, windsurf, cline, zed, etc.
Example for Cursor:
This will automatically configure the MCP server in your chosen client.
Development Setup
MCP Client Integration
Naver Finance Crawl MCP can be integrated with various AI coding assistants and IDEs that support the Model Context Protocol (MCP).
Requirements
Node.js >= v18.0.0
An MCP-compatible client (Cursor, Claude Code, VS Code, Windsurf, etc.)
Go to: Settings -> Cursor Settings -> MCP -> Add new global MCP server
Add the following configuration to your ~/.cursor/mcp.json file:
With HTTP transport:
Run this command:
Or with HTTP transport:
Add this to your VS Code MCP config file. See VS Code MCP docs for more info.
Add this to your Windsurf MCP config file:
Open Cline
Click the hamburger menu icon (☰) to enter the MCP Servers section
Choose Remote Servers tab
Click the Edit Configuration button
Add naver-finance to
mcpServers:
Open Claude Desktop developer settings and edit your claude_desktop_config.json file:
Add this to your Zed settings.json:
Add this to your Roo Code MCP configuration file:
Available Scripts
Development & Build
Usage
Running the MCP Server
STDIO Transport (default):
HTTP Transport:
The server provides two MCP tools that can be used by LLMs:
crawl_top_stocks: Fetches the most searched stocks from Naver Financecrawl_stock_detail: Fetches detailed information for a specific stock by its 6-digit code
Available Tools
Naver Finance Crawl MCP provides the following tools that can be used by LLMs:
crawl_top_stocks
Crawl top searched stocks from Naver Finance. Returns a list of the most searched stocks with their codes, names, current prices, and change rates.
Parameters: None
Example Response:
crawl_stock_detail
Crawl detailed information for a specific stock by its 6-digit code. Returns comprehensive data including company info, stock prices, trading volume, and financial metrics.
Parameters:
stockCode(string, required): 6-digit stock code (e.g., "005930" for Samsung Electronics)
Example Request:
Example Response:
Usage Examples
Example 1: Get top searched stocks
In Cursor/Claude Code:
The tool will return:
List of most searched stocks
Stock codes, names, current prices
Price change rates
Timestamp of the data
Example 2: Get detailed stock information
In Cursor/Claude Code:
The tool will return:
Company name and stock code
Current price and change rate
Trading volume
Market capitalization
Additional financial metrics
Example 3: Analyze stock trends
In Cursor/Claude Code:
Using as a Library
You can also use the crawlers directly in your Node.js applications:
Basic Crawler Example
Create Custom Crawler
HTML Parsing
Configuration Files
tsconfig.json: TypeScript compiler options
vitest.config.ts: Vitest test runner configuration
.eslintrc.json: ESLint rules configuration
.prettierrc.json: Prettier formatting rules
Dependencies
Production
axios: HTTP client librarycheerio: jQuery-like HTML parsing
Development
typescript: TypeScript compilervitest: Unit testing framework@typescript-eslint/*: TypeScript lintingeslint: Code lintingprettier: Code formattingtsx: TypeScript executor
Testing
The project includes comprehensive tests covering:
Unit tests for utilities and base classes
Integration tests for crawler functionality
E2E tests for complete workflows
Run tests with:
Docker Usage
Build Docker Image
Run with Docker
With STDIO transport:
With HTTP transport:
Docker Compose Example
Create a docker-compose.yml:
Run with Docker Compose:
Use Docker Image in MCP Clients
Configure your MCP client to use the Docker container:
Architecture
The project follows a modular architecture:
crawlers/: Crawler implementations
baseCrawler.ts: Base class for all crawlersnaverFinanceCrawler.ts: Naver Finance stock detail crawlerTopStocksCrawler.ts: Top searched stocks crawlerexampleCrawler.ts: Example crawler implementation
tools/: MCP tool implementations
crawl-top-stocks.ts: MCP tool for top stockscrawl-stock-detail.ts: MCP tool for stock details
utils/: Utility functions
request.ts: HTTP client with retry logicparser.ts: HTML parsing helpers
types/: TypeScript type definitions
mcp-server.ts: MCP server entry point (STDIO/HTTP)
http-server.ts: REST API server entry point
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Author
greatsumini
License
MIT