mcpField
M
mcp-opendart-server

mcp-opendart-server

ローカル
github.com/sayouzone金融データ038 週間前に更新

mcp-opendart-server について

OpenDartのデータを収集・キャッシュし、企業の基礎情報や株式情報を提供するMCPサーバーです。財務情報を取得したいLLMクライアント向けです。

主な機能

  1. 01OpenDartの株式基礎情報
  2. 02データの収集とキャッシュ
  3. 03財務諸表の照会
  4. 04配当情報の照会

活用シーン

  1. 01企業の基礎情報の取得
  2. 02期間を指定した財務諸表の確認
  3. 03企業の配当情報の確認

MCP 対応

OpenDart由来の株式情報をMCPクライアントに提供します。READMEではGemini CLIへの接続とCloud Runへのデプロイ方法を説明しています。

設定

ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。

mcp.json · 共通設定
{
"mcpServers": {
"kcw2034-sayouzone-mcp-opendart-server": {
"command": "uvx",
"args": [
"sayou-opendart-mcp"
],
"env": {
"OPENDART_API_KEY": "<OPENDART_API_KEY>"
}
}
}
}
起動コマンドuvx sayou-opendart-mcp
設定が必要な環境変数
OPENDART_API_KEYシークレットYour API key for OpenDart

ローカルサーバーにはマシン上の実行環境(Node.js 18 以上など)が必要です。設定ファイルの場所はクライアントごとに異なります。

パッケージ
pypisayou-opendart-mcp0.0.4

ツール

ツール一覧はまだ取得されていません

ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。

詳細

OpenDart MCP Server

OpenDart 크롤링 및 캐싱 MCP 서버

OpenDart에서 주식 종목의 기본 정보(펀더멘털)를 가져옵니다.

모델 컨텍스트 프로토콜(Model Context Protocol, MCP) 서버를 빌드하고 배포합니다
MCP 서버는 LLM에 외부 도구 및 서비스에 대한 액세스 권한을 제공합니다
FastMCP를 사용하여 MCP 서버와 클라이언트를 빌드하는 빠르고 Pythonic한 방법을 제공합니다

  • Gemini 3.0 Pro
  • Gemini 3.0 Flash
참조 문서

패키지 구조

├── opendart/
│   ├── __init__.py          # 공개 API 정의
│   ├── client.py            # OpenDART HTTP 클라이언트
│   ├── models.py            # 데이터 클래스 (DTO)
│   ├── utils.py             # 유틸리티 함수 & 상수
│   ├── crawler.py           # 통합 인터페이스 (Facade)
│   ├── examples.py          # 사용 예시
│   └── parsers/
│       ├── __init__.py
│       ├── document.py        # 문서 API 파서
│       ├── document_viewer.py # 문서 뷰어 API 파서
│       ├── disclosure.py      # 공시정보 API 파서
│       ├── finance.py         # 정기보고서 재무정보 API 파서
│       ├── material_facts.py  # 주요사항보고서 주요정보 API 파서
│       ├── ownership.py       # 지분공시 종합정보 API 파서
│       ├── registration.py    # 증권신고서 주요정보 API 파서
│       └── reports.py         # 정기보고서 주요정보 API 파서
├── tests/
│   ├── test_opendart.py       # OpenDART 테스트 (로컬 소스)
│   └── test_opendart_.py      # OpenDART 테스트 (sayou-stock)
├── __init__.py
├── .gitignore
├── Dockerfile
├── LICENSE
├── opendarts.py
├── pyproject.toml
├── README.md
├── requirements.txt
└── server.py

배포 (Cloud Run)

MCP_SERVER_NAME=opendart-mcp-server
export GOOGLE_CLOUD_PROJECT=sayouzone-ai
GCP 설정 (1회만)

서비스 활성화

gcloud services enable \
  run.googleapis.com \
  artifactregistry.googleapis.com \
  cloudbuild.googleapis.com

서비스 계정 생성

gcloud iam service-accounts create mcp-server-sa --display-name="MCP Server Service Account"
gcloud projects add-iam-policy-binding $GOOGLE_CLOUD_PROJECT \
    --member=user:$(gcloud config get-value account) \
    --role='roles/run.invoker'
gcloud projects add-iam-policy-binding $GOOGLE_CLOUD_PROJECT \
    --member=serviceAccount:mcp-server-sa@$GOOGLE_CLOUD_PROJECT.iam.gserviceaccount.com \
    --role="roles/secretmanager.secretAccessor"
배포

패키지 소스로 테스트

gcloud run deploy $MCP_SERVER_NAME \
    --service-account=mcp-server-sa@$GOOGLE_CLOUD_PROJECT.iam.gserviceaccount.com \
    --no-allow-unauthenticated \
    --region=us-central1 \
    --source=. \
    --labels=dev-tutorial=stocks-mcp

패키지 소스 및 접근 권한 테스트

gcloud run deploy $MCP_SERVER_NAME \
    --region=us-central1 \
    --source=. \
    --labels=dev-tutorial=stocks-mcp

sayou-stock 설치 및 테스트

gcloud run deploy $MCP_SERVER_NAME \
    --service-account=mcp-server-sa@$GOOGLE_CLOUD_PROJECT.iam.gserviceaccount.com \
    --no-allow-unauthenticated \
    --region=us-central1 \
    --source=. \
    --labels=dev-tutorial=stocks-mcp

sayou-stock 설치 및 접근 권한 테스트

gcloud run deploy $MCP_SERVER_NAME \
    --region=us-central1 \
    --source=. \
    --labels=dev-tutorial=stocks-mcp

테스트

Gemini 테스트
export PROJECT_NUMBER=$(gcloud projects describe $GOOGLE_CLOUD_PROJECT --format="value(projectNumber)")
export ID_TOKEN=$(gcloud auth print-identity-token)

settings.json

{
    "ide": {
        "hasSeenNudge": true
    },
    "mcpServers": {
        "opendart-remote": {
            "httpUrl": "https://opendart-mcp-server-$PROJECT_NUMBER.us-central1.run.app/mcp",
            "headers": {
                "Authorization": "Bearer $ID_TOKEN"
            }
        }
    },
    "security": {
        "auth": {
            "selectedType": "gemini-api-key"
        }
    }
}

settings.json 파일을 ~/.gemini/ 디렉터리에 복사합니다.

cp settings.json ~/.gemini/
gemini
  • 삼성전자
  • 삼성전자 재무제표를 보여줘
  • 삼성전자 재무 상태를 보여줘
  • 삼성전자 재무제표를 보여줘
  • 2024년 삼성전자 재무제표를 보여줘
  • 2025년 3분기 삼성전자 재무제표를 보여줘
  • 삼성전자 배당 정보를 보여줘
  • 삼성전자 배당에 대해 알려줘
  • 삼성전자 배당이 어떻게 되지?
  • 2025년 삼성전자 배당이 어떻게 되지?
  • 삼성전자 최근 배당 성향에 대해 알려줘
  • 삼성전자가 지급하는 보상에 대해 알려줘
Loaded cached credentials.

 ███            █████████  ██████████ ██████   ██████ █████ ██████   █████ █████
░░░███         ███░░░░░███░░███░░░░░█░░██████ ██████ ░░███ ░░██████ ░░███ ░░███
  ░░░███      ███     ░░░  ░███  █ ░  ░███░█████░███  ░███  ░███░███ ░███  ░███
    ░░░███   ░███          ░██████    ░███░░███ ░███  ░███  ░███░░███░███  ░███
     ███░    ░███    █████ ░███░░█    ░███ ░░░  ░███  ░███  ░███ ░░██████  ░███
   ███░      ░░███  ░░███  ░███ ░   █ ░███      ░███  ░███  ░███  ░░█████  ░███
 ███░         ░░█████████  ██████████ █████     █████ █████ █████  ░░█████ █████
░░░            ░░░░░░░░░  ░░░░░░░░░░ ░░░░░     ░░░░░ ░░░░░ ░░░░░    ░░░░░ ░░░░░

Tips for getting started:
1. Ask questions, edit files, or run commands.
2. Be specific for the best results.
3. Create GEMINI.md files to customize your interactions with Gemini.
4. /help for more information.

╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Gemini CLI update available! 0.14.0 → 0.15.0                                                                            │
│ Installed via Homebrew. Please update with "brew upgrade".                                                              │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯


⠋ Connecting to MCP servers... (1/2)

 Using: 2 MCP servers
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ >   Type your message or @path/to/file                                                                                  │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
 ~/.../src/sayou/mcp/stocks_mcp (main*)                                      no sandbox (see /docs)                                       auto

sayou-stock 배포

git push origin main
git tag sayou-stock-v0.1.1
git push origin sayou-stock-v0.1.1 

오류

> /mcp

Configured MCP servers:

🟢 stocks-remote - Ready (4 tools)
  Tools:
  - find_fnguide_data
  - find_yahoofinance_data
  - get_yahoofinance_fundamentals
  - save_fundamentals_data_to_gcs

🟢 zoo-remote - Ready (2 tools, 1 prompt)
  Tools:
  - get_animal_details
  - get_animals_by_species
  Prompts:
  - find


ℹ Gemini CLI update available! 0.14.0 → 0.15.0
  Installed via Homebrew. Please update with "brew upgrade".

 Using: 2 MCP servers
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ >   Type your message or @path/to/file                                                                                  │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
 ~/.../src/sayou/mcp/stocks_mcp (main*)                     no sandbox (see /docs)                                     auto
> 삼성전자

ℹ Gemini CLI update available! 0.14.0 → 0.15.0
  Installed via Homebrew. Please update with "brew upgrade".
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ x  find_fnguide_data (stocks-remote MCP Server) {"stock":"삼성전자"}                                                      │
│                                                                                                                         │
│    MCP tool 'find_fnguide_data' reported tool error for function call: {"name":"find_fnguide_data","args":{"stock":"삼성전자"}} with  │
│    response: [{"functionResponse":{"name":"find_fnguide_data","response":{"error":{"content":[{"type":"text","text":"Error calling tool │
│    'find_fnguide_data': BrowserType.launch: Executable doesn't exist at                                                                     │
│    /root/.cache/ms-playwright/chromium_headless_shell-1194/chrome-linux/headless_shell\n╔══════════════════════════════════════════════════ │
│    ══════════╗\n║ Looks like Playwright was just installed or updated.       ║\n║ Please run the following command to download new          │
│    browsers: ║\n║                                                            ║\n║     playwright install                                    │
│    ║\n║                                                            ║\n║ <3 Playwright Team                                                  │
│    ║\n╚════════════════════════════════════════════════════════════╝"}],"isError":true}}}}]                                                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ -  Shell playwright install [current working directory /Users/seongjungkim/Development/sayouzone/base-framework/src/sayou/mcp/stocks_mcp] … │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

참조

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。