{
  "markdown": "# OpenDart MCP Server\n\nOpenDart Crawling and Caching MCP Server<br/>\n\n주식 정보를 `OpenDart`에서 종목 기본 정보 (펀더멘탈, fundamental)를 가져온다.\n\n모델 컨텍스트 프로토콜 (Model Context Protocol, MCP) 서버를 빌도하고 배포<br/>\nMCP 서버는 LLM에 외부 도구 및 서비스에 대한 액세스 권한을 제공<br/>\nFastMCP를 사용, MCP 서버와 클라이언트를 빌드하는 빠르고 Pythonic한 방법을 제공<br/>\n\n- Gemini 3.0 Pro\n- Gemini 3.0 Flash\n\n#### 참조 문서\n- [Cloud Run에 보안 MCP 서버를 배포하는 방법](https://codelabs.developers.google.com/codelabs/cloud-run/how-to-deploy-a-secure-mcp-server-on-cloud-run?hl=ko)\n- [Gemini CLI: Custom slash commands](https://cloud.google.com/blog/topics/developers-practitioners/gemini-cli-custom-slash-commands?e=48754805)\n\n## 패키지 구조\n\n```\n├── opendart/\n│   ├── __init__.py          # 공개 API 정의\n│   ├── client.py            # OpenDART HTTP 클라이언트\n│   ├── models.py            # 데이터 클래스 (DTO)\n│   ├── utils.py             # 유틸리티 함수 & 상수\n│   ├── crawler.py           # 통합 인터페이스 (Facade)\n│   ├── examples.py          # 사용 예시\n│   └── parsers/\n│       ├── __init__.py\n│       ├── document.py        # 문서 API 파서\n│       ├── document_viewer.py # 문서 뷰어 API 파서\n│       ├── disclosure.py      # 공시정보 API 파서\n│       ├── finance.py         # 정기보고서 재무정보 API 파서\n│       ├── material_facts.py  # 주요사항보고서 주요정보 API 파서\n│       ├── ownership.py       # 지분공시 종합정보 API 파서\n│       ├── registration.py    # 증권신고서 주요정보 API 파서\n│       └── reports.py         # 정기보고서 주요정보 API 파서\n├── tests/\n│   ├── test_opendart.py       # OpenDART 테스트 (로컬 소스)\n│   └── test_opendart_.py      # OpenDART 테스트 (sayou-stock)\n├── __init__.py\n├── .gitignore\n├── Dockerfile\n├── LICENSE\n├── opendarts.py\n├── pyproject.toml\n├── README.md\n├── requirements.txt\n└── server.py\n```\n\n## 배포 (Cloud Run)\n\n```bash\nMCP_SERVER_NAME=opendart-mcp-server\nexport GOOGLE_CLOUD_PROJECT=sayouzone-ai\n```\n\n#### GCP 설정 (1회만)\n\n서비스 활성화\n\n```bash\ngcloud services enable \\\n  run.googleapis.com \\\n  artifactregistry.googleapis.com \\\n  cloudbuild.googleapis.com\n```\n\n서비스 계정 생성\n\n```bash\ngcloud iam service-accounts create mcp-server-sa --display-name=\"MCP Server Service Account\"\n```\n\n```bash\ngcloud projects add-iam-policy-binding $GOOGLE_CLOUD_PROJECT \\\n    --member=user:$(gcloud config get-value account) \\\n    --role='roles/run.invoker'\n```\n\n```bash\ngcloud projects add-iam-policy-binding $GOOGLE_CLOUD_PROJECT \\\n    --member=serviceAccount:mcp-server-sa@$GOOGLE_CLOUD_PROJECT.iam.gserviceaccount.com \\\n    --role=\"roles/secretmanager.secretAccessor\"\n```\n\n#### 배포\n\n**패키지 소스로 테스트**\n\n```bash\ngcloud run deploy $MCP_SERVER_NAME \\\n    --service-account=mcp-server-sa@$GOOGLE_CLOUD_PROJECT.iam.gserviceaccount.com \\\n    --no-allow-unauthenticated \\\n    --region=us-central1 \\\n    --source=. \\\n    --labels=dev-tutorial=stocks-mcp\n```\n\n**패키지 소스 및 접근권한 테스트**\n\n```bash\ngcloud run deploy $MCP_SERVER_NAME \\\n    --region=us-central1 \\\n    --source=. \\\n    --labels=dev-tutorial=stocks-mcp\n```\n\n**sayou-stock 설치 및 테스트**\n\n```bash\ngcloud run deploy $MCP_SERVER_NAME \\\n    --service-account=mcp-server-sa@$GOOGLE_CLOUD_PROJECT.iam.gserviceaccount.com \\\n    --no-allow-unauthenticated \\\n    --region=us-central1 \\\n    --source=. \\\n    --labels=dev-tutorial=stocks-mcp\n```\n\n**sayou-stock 설치 및 접근권한 테스트**\n\n```bash\ngcloud run deploy $MCP_SERVER_NAME \\\n    --region=us-central1 \\\n    --source=. \\\n    --labels=dev-tutorial=stocks-mcp\n```\n\n## Tests\n\n#### Gemini 테스트\n\n```bash\nexport PROJECT_NUMBER=$(gcloud projects describe $GOOGLE_CLOUD_PROJECT --format=\"value(projectNumber)\")\nexport ID_TOKEN=$(gcloud auth print-identity-token)\n```\n\nsettings.json\n\n```json\n{\n    \"ide\": {\n        \"hasSeenNudge\": true\n    },\n    \"mcpServers\": {\n        \"opendart-remote\": {\n            \"httpUrl\": \"https://opendart-mcp-server-$PROJECT_NUMBER.us-central1.run.app/mcp\",\n            \"headers\": {\n                \"Authorization\": \"Bearer $ID_TOKEN\"\n            }\n        }\n    },\n    \"security\": {\n        \"auth\": {\n            \"selectedType\": \"gemini-api-key\"\n        }\n    }\n}\n```\n\nCopy settings.json file to ~/.gemini/ directory.\n\n```bash\ncp settings.json ~/.gemini/\n```\n\n```bash\ngemini\n```\n\n- 삼성전자\n- 삼성전자 재무제표 보여줘\n- 삼성전자 재무 상태를 보여줘\n- 삼성전자 재무제표 보여줘\n- 2024년 삼성전자 재무제표 보여줘\n- 2025년 3분기 삼성전자 재무제표 보여줘\n- 삼성전자 배당 정보를 보여줘\n- 삼성전자 배당에 대해 알려줘\n- 삼성전자 배당이 어떻게 되지?\n- 2025년 삼성전자 배당이 어떻게 되지?\n- 삼성전자 최근 배당 성향에 대해 알려줘\n- 삼성전자가 지급하는 보상에 대해 알려줘\n\n\n```bash\nLoaded cached credentials.\n\n ███            █████████  ██████████ ██████   ██████ █████ ██████   █████ █████\n░░░███         ███░░░░░███░░███░░░░░█░░██████ ██████ ░░███ ░░██████ ░░███ ░░███\n  ░░░███      ███     ░░░  ░███  █ ░  ░███░█████░███  ░███  ░███░███ ░███  ░███\n    ░░░███   ░███          ░██████    ░███░░███ ░███  ░███  ░███░░███░███  ░███\n     ███░    ░███    █████ ░███░░█    ░███ ░░░  ░███  ░███  ░███ ░░██████  ░███\n   ███░      ░░███  ░░███  ░███ ░   █ ░███      ░███  ░███  ░███  ░░█████  ░███\n ███░         ░░█████████  ██████████ █████     █████ █████ █████  ░░█████ █████\n░░░            ░░░░░░░░░  ░░░░░░░░░░ ░░░░░     ░░░░░ ░░░░░ ░░░░░    ░░░░░ ░░░░░\n\nTips for getting started:\n1. Ask questions, edit files, or run commands.\n2. Be specific for the best results.\n3. Create GEMINI.md files to customize your interactions with Gemini.\n4. /help for more information.\n\n╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ Gemini CLI update available! 0.14.0 → 0.15.0                                                                            │\n│ Installed via Homebrew. Please update with \"brew upgrade\".                                                              │\n╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n\n\n⠋ Connecting to MCP servers... (1/2)\n\n Using: 2 MCP servers\n╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ >   Type your message or @path/to/file                                                                                  │\n╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n ~/.../src/sayou/mcp/stocks_mcp (main*)                                      no sandbox (see /docs)                                       auto\n```\n\n## Deploy sayou-stock\n\n```bash\ngit push origin main\ngit tag sayou-stock-v0.1.1\ngit push origin sayou-stock-v0.1.1 \n```\n\n## Errors\n\n```bash\n> /mcp\n\nConfigured MCP servers:\n\n🟢 stocks-remote - Ready (4 tools)\n  Tools:\n  - find_fnguide_data\n  - find_yahoofinance_data\n  - get_yahoofinance_fundamentals\n  - save_fundamentals_data_to_gcs\n\n🟢 zoo-remote - Ready (2 tools, 1 prompt)\n  Tools:\n  - get_animal_details\n  - get_animals_by_species\n  Prompts:\n  - find\n\n\nℹ Gemini CLI update available! 0.14.0 → 0.15.0\n  Installed via Homebrew. Please update with \"brew upgrade\".\n\n Using: 2 MCP servers\n╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ >   Type your message or @path/to/file                                                                                  │\n╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n ~/.../src/sayou/mcp/stocks_mcp (main*)                     no sandbox (see /docs)                                     auto\n```\n\n```bash\n> 삼성전자\n\nℹ Gemini CLI update available! 0.14.0 → 0.15.0\n  Installed via Homebrew. Please update with \"brew upgrade\".\n╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ x  find_fnguide_data (stocks-remote MCP Server) {\"stock\":\"삼성전자\"}                                                      │\n│                                                                                                                         │\n│    MCP tool 'find_fnguide_data' reported tool error for function call: {\"name\":\"find_fnguide_data\",\"args\":{\"stock\":\"삼성전자\"}} with  │\n│    response: [{\"functionResponse\":{\"name\":\"find_fnguide_data\",\"response\":{\"error\":{\"content\":[{\"type\":\"text\",\"text\":\"Error calling tool │\n│    'find_fnguide_data': BrowserType.launch: Executable doesn't exist at                                                                     │\n│    /root/.cache/ms-playwright/chromium_headless_shell-1194/chrome-linux/headless_shell\\n╔══════════════════════════════════════════════════ │\n│    ══════════╗\\n║ Looks like Playwright was just installed or updated.       ║\\n║ Please run the following command to download new          │\n│    browsers: ║\\n║                                                            ║\\n║     playwright install                                    │\n│    ║\\n║                                                            ║\\n║ <3 Playwright Team                                                  │\n│    ║\\n╚════════════════════════════════════════════════════════════╝\"}],\"isError\":true}}}}]                                                 │\n╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ -  Shell playwright install [current working directory /Users/seongjungkim/Development/sayouzone/base-framework/src/sayou/mcp/stocks_mcp] … │\n╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n```\n\n## References\n\n- [Cloud Run에서 MCP 서버를 사용하는 ADK 에이전트 빌드 및 배포](https://codelabs.developers.google.com/codelabs/cloud-run/use-mcp-server-on-cloud-run-with-an-adk-agent?hl=ko)",
  "bytes": 9664,
  "sha": "52f0b26693f6b68f2e54096b49cdfc93c64381e01994879870ad9b1206aedff2",
  "repo_slug": "sayouzone/mcp-opendart-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_kcw2034_sayouzone_mcp_opendart_c847228d/readme"
}