korea-stock-mcp logo

korea-stock-mcp

Community
Mrbaeksang

Remote MCP server for Korean stock analysis — real DART filings, KRX quotes, conservative valuation ranges for Claude, Cursor and any MCP client

PublisherMrbaeksang
Repositorykorea-stock-analyzer-mcp
LanguagePython
Forks
11
Stars
23
Available tools
0
Transport typestdio, streamable-http
Categories
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    korea-stock-mcp exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    23 stars and 11 forks from the linked repository.

📈 korea-stock-mcp

한국 주식을 위한 보수적·데이터 정직 원격 MCP 서버 Conservative, data-honest Korean equity analysis for Claude, Cursor and any MCP client

CI Python FastMCP MCP License


DART 전자공시의 실측 재무제표와 KRX 시세만으로 한국 상장사를 분석한다. 데이터가 없으면 없다고 답하고, 목표 주가 대신 가정이 명시된 범위를 제시하며, 매수·매도 권고를 하지 않는다.

✨ Features

  • 날조 제로 — 모든 수치는 DART 공시·KRX 시세 실측치. 결측은 null + 사유로 명시, 기본값 주입 없음
  • 실측 재무제표 — 사업보고서 기반 매출·영업이익·현금흐름 3~10개년, 연결(CFS) 우선/별도(OFS) 폴백 표시
  • 보수적 밸류에이션 — 단일 적정가 대신 3시나리오(비관/중립/낙관) 범위, 성장률·멀티플 가정 전부 응답에 포함
  • 리스크 우선 — 재무 적신호 6종 자동 검사 + 공시 위험 키워드 하이라이트, 검사 불가 항목도 구분 보고
  • 교차 검증 — 시가총액 정합성 검사(주가×주식수 vs 보고 시총) 등 데이터 정합성 검증 내장
  • 운영 기본기 — 글로벌 레이트 리밋, DART 쿼터 보호 캐싱, KRX IP 차단 방지 직렬화, 구조화 에러 메시지

🏗️ Architecture

계층 원칙: tools/는 등록만(얇게) → services/는 외부 API + 캐싱 → analysis/는 순수함수(가장 두꺼운 테스트). LLM도 서버도 수치를 "암산"하지 않는다 — 모든 계산은 결정론적 함수다.

🚀 Quickstart

배포된 서버 URL 하나면 된다. API 키 불필요(공개 데이터만 제공).

claude.ai — 설정 → 커넥터 → 커스텀 커넥터 추가:

https://korea-stock-analyzer-mcp-production.up.railway.app/mcp

Claude Code:

bash
claude mcp add --transport http korea-stock https://korea-stock-analyzer-mcp-production.up.railway.app/mcp
json
{
  "mcpServers": {
    "korea-stock": {
      "type": "http",
      "url": "https://korea-stock-analyzer-mcp-production.up.railway.app/mcp"
    }
  }
}

연결 후 이렇게 물어보면 된다:

"삼성전자 최근 5년 재무제표 흐름이랑 리스크 요인 짚어줘"

🛠️ Tools

도구설명주요 파라미터
search_company종목명/코드로 상장사 검색 (KOSPI·KOSDAQ)query
get_quote시세·시가총액·52주 고저·거래량 + 시총 정합성 검사ticker
get_financials실측 연간 재무제표 + 수익성·안정성·성장성·현금흐름 비율ticker, years (2–10)
get_valuationPER/PBR 멀티플 + 3시나리오 가치 범위 (가정 명시)ticker
get_risk_flags재무 적신호 6종 + 최근 공시 위험 키워드ticker, disclosure_days

모든 응답에 데이터 기준일(as_of)과 출처(data_source)가 붙는다.

☁️ Deploy Your Own

Railway 기준 (Dockerfile 자동 감지):

  1. 이 레포를 포크 → Railway에서 GitHub 레포 연결
  2. 환경변수:
변수필수설명
DART_API_KEY✅opendart.fss.or.kr 무료 발급 (일 20,000건)
FASTMCP_HTTP_ALLOWED_HOSTS✅["<서비스>.up.railway.app","healthcheck.railway.app"]
RATE_LIMIT_RPS / RATE_LIMIT_BURST—기본 5 / 15

악성 사용자 차단은 별도 환경변수 없이 자동 적용된다. Railway 요청을 자동으로 인식해 IP별 분당 30회, 반복 초과 3회 시 1시간 차단하며, /health도 분당 120회로 제한해 우회 경로를 막는다.

  1. Serverless(App Sleeping) 비활성 권장 — 콜드 스타트 시 커넥터 연결 실패 방지

로컬 실행:

bash
uv sync
DART_API_KEY=<key> uv run uvicorn app.main:app --app-dir src --port 8000

테스트:

bash
uv run pytest                          # 단위·경계 테스트 (외부 API 없음)
uv run pytest -m live -o addopts=""    # 실제 KRX/DART 검증 (키 필요)

📊 데이터 출처와 한계

데이터출처한계
재무제표DART OpenAPI (사업보고서 XBRL)연간만, 분기 미제공
시세·시총KRX (FinanceDataReader)일별 스냅샷, 실시간 아님
공시 목록DART OpenAPI최근 7~365일
FCF영업CF − 유형자산 취득근사치 — 무형자산·리스 투자 미포함

🔒 Disclaimer

본 서버의 출력은 공시·시세 데이터의 산술 가공 결과이며 투자 자문이 아니다. 시나리오 값은 명시된 가정의 계산 결과일 뿐 목표 주가가 아니다. 서버는 매수·매도·비중 판단을 제공하지 않으며, 투자 판단과 책임은 전적으로 이용자에게 있다.

🤝 Contributing

이슈·PR 환영. 원칙 하나만 지켜달라: 데이터가 없으면 없다고 답한다. 추정치 주입·하드코딩 폴백이 들어간 PR은 받지 않는다. 테스트는 uv run pytest 통과 필수.

📜 License

Apache-2.0

Installation

TypingMind
{
  "mcpServers": {
    "korea-stock-analyzer-mcp": {
      "command": "uv",
      "args": [
        "run",
        "uvicorn",
        "app.main:app",
        "--app-dir",
        "src",
        "--port",
        "8000"
      ],
      "env": {
        "DART_API_KEY": "<DART_API_KEY>"
      }
    }
  }
}

Use korea-stock-mcp MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once korea-stock-mcp is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add korea-stock-mcp as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the korea-stock-mcp MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "korea-stock-analyzer-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the korea-stock-mcp MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the korea-stock-mcp MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use korea-stock-mcp to help me with this task?
korea-stock-mcp
Sure. I read it.
Here is what I found using korea-stock-mcp.

Option 2: Add an MCP server URL

Use this when korea-stock-mcp is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter https://korea-stock-analyzer-mcp-production.up.railway.app/mcp in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste https://korea-stock-analyzer-mcp-production.up.railway.app/mcp into the Server URL field.
  2. Enter a connection name for korea-stock-mcp.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the korea-stock-mcp connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the korea-stock-mcp tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the korea-stock-mcp tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use korea-stock-mcp to help me with this task?
korea-stock-mcp
Sure. I read it.
Here is what I found using korea-stock-mcp.

Frequently asked questions

What is the korea-stock-mcp MCP server used for?

korea-stock-mcp is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use korea-stock-mcp MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use korea-stock-mcp with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use korea-stock-mcp MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With korea-stock-mcp connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect korea-stock-mcp MCP to TypingMind?

korea-stock-mcp can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does korea-stock-mcp MCP provide in TypingMind?

korea-stock-mcp exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use korea-stock-mcp MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If korea-stock-mcp requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇