Skip to main content
Glama
creden-mcp

creden-mcp

by winrhcp

creden-mcp

MCP server ที่ให้ AI agent (Claude Code / Claude Desktop) ดึงข้อมูลบริษัทไทยจาก data.creden.co ได้ — ค้นด้วยชื่อภาษาไทย/อังกฤษ หรือเลขนิติบุคคล แล้วได้ profile, งบการเงิน 5–10 ปี, กรรมการ, % ผู้ถือหุ้น, ผู้มีอำนาจลงนาม ในการเรียกเดียว

"<ชื่อบริษัท>"
   ↓ creden_lookup
   ↓
บริษัท ABC จำกัด (id=0123456789012)
จดทะเบียน <date> · ทุน <amount> บาท · <industry>

ปี (พ.ศ.)    รายได้รวม    กำไรสุทธิ    สินทรัพย์รวม    YoY%
<year>          ...           ...           ...          ...
<year>          ...           ...           ...          ...

กรรมการ:               <list>
ผู้มีอำนาจลงนาม:        <list>
ผู้ถือหุ้น:              <pct1>% / <pct2>% (ไทย 100%)
ราคาต่อหุ้น:            <shares> หุ้น × ...

ทำไมใช้ตัวนี้

  • ไม่ต้อง login สำหรับข้อมูลส่วนใหญ่ — profile + งบการเงิน 5–10 ปี ใช้ public HTML route

  • กรรมการ / ผู้ถือหุ้น % อยู่หลัง free-tier login (ใส่ credentials ใน .env)

  • Auto re-login ถ้า session หมด ระบบ detect 401 → login ใหม่ → retry อัตโนมัติ

  • Single tool — call เดียวได้ทุกอย่าง agent ไม่ต้องตัดสินใจระหว่างหลาย tool

  • ทำงานกับ Claude Code, Claude Desktop, หรือ MCP client อื่นๆ ที่ speak stdio

Related MCP server: Bizfile MCP

Install

git clone https://github.com/<your-username>/creden-mcp.git
cd creden-mcp
python3 -m venv .venv
.venv/bin/pip install -e .

ต้องการ Python ≥ 3.11

Setup กับ Claude Code

claude mcp add creden --scope user $(pwd)/.venv/bin/creden-mcp
claude mcp list | grep creden       # → ✓ Connected

ใน session ใหม่ของ Claude Code ถามได้เลย:

"งบการเงิน 5 ปีของ <ชื่อบริษัท>"
"ใครเป็นกรรมการบริษัท <ชื่อ>"
"ค้นบริษัท <ชื่อ>"
"นิติบุคคลเลข <id 13 หลัก> ทำธุรกิจอะไร"

Setup กับ Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "creden": {
      "command": "/absolute/path/to/.venv/bin/creden-mcp"
    }
  }
}

Credentials (optional แต่แนะนำ)

cp .env.example .env
# แก้ไข .env ใส่ CREDEN_EMAIL / CREDEN_PASSWORD

ไม่ใส่ก็ใช้ได้ — แค่ field ที่ gate (กรรมการ/ผู้ถือหุ้น/ผู้ลงนาม) จะเป็น null พร้อม auth_data_status บอกเหตุผล

ใส่แล้ว register แบบ inline ก็ได้ (ไม่ต้องมี .env ในโปรเจกต์):

claude mcp add creden --scope user \
  --env CREDEN_EMAIL=you@example.com \
  --env CREDEN_PASSWORD=secret \
  /path/to/.venv/bin/creden-mcp

Tools

Tool

Purpose

creden_lookup(query)

Main: ชื่อ หรือ id 13 หลัก → ข้อมูลครบในการเรียกเดียว

creden_search(text)

คืน list candidates สำหรับชื่อที่ ambiguous

ผลที่ได้จาก creden_lookup (โครงสร้างตัวอย่าง):

{
  "company": {
    "th": "บริษัท ... จำกัด",
    "en": "... CO., LTD.",
    "juristic_id": "0123456789012",
    "register_date_th": "...",
    "register_capital": 1000000,
    "industry_th": "<TSIC code> : <description>",
    "address_th": "...",
    "objective": "..."
  },
  "fiscal_years": [
    { "FISCAL_YEAR": 2566, "BAL_IN09": 0, "BAL_IN21": 0, "BAL_BS22_BAL_BS99": 0 },
    { "FISCAL_YEAR": 2567, "BAL_IN09": 0, "BAL_IN21": 0, "BAL_BS22_BAL_BS99": 0 }
  ],
  "directors": [{ "name_search": "...", "name_search_en": "...", "index": 1 }],
  "director_history": [/* เข้า/ออก กรรมการ พร้อมวันที่ */],
  "shareholders_summary": {
    "percentages": [50.0, 50.0],
    "names_masked": ["A", "B"],
    "by_nationality": [{ "nationality": "TH", "pct": 100 }]
  },
  "authorized_signers": ["..."],
  "signing_rule": "...",
  "share_info": { "total_shares": 0, "price_per_share": 0 },
  "auth_data_status": "fetched"
}

creden_lookup(query, full=True) คืน DBD codes ทุก field (~50 fields/ปี)

Architecture

src/creden_mcp/
  config.py        env / .env loading (pure dataclass)
  page_parser.py   parse window.__NUXT__ → dict (regex-based, var-name agnostic)
  client.py        async httpx client; auto re-login on session expiry
  server.py        MCPServer — 2 tools wrapping client.lookup
  models.py        loose Pydantic shapes
  discovery.py     Playwright XHR capture (สำหรับหา endpoint ใหม่)

Public flow (no auth):

suggest /sapi/search/get_suggestion           →  company_id
GET     /company/general/<id>                 →  HTML with full Nuxt-hydrated state
                                                 → parse profile + fiscal years

Auth flow (.env credentials):

POST /sapi/authen/login                       →  cookie session
POST /sapi/company/get_detail_minor_general   →  director history,
                                                 shareholders %, signers, shares
POST /sapi/company/get_detail_sub_general     →  current directors

Session expiry → ถ้า 401 หรือ body มี "session expired" → auto re-login → retry ครั้งเดียว

Limitations

ไม่มี (และไม่สามารถดึงได้ด้วย free Creden tier):

  • ชื่อผู้ถือหุ้นเต็ม — masked เป็น "A", "B", … เห็นแค่ % และสัญชาติ

  • ผู้สอบบัญชี (ชื่อจริง) — masked

  • Email/phone บริษัท — masked

  • fs_score / credit term / value per share precise — masked, paid tier

  • บริษัทมหาชน + ข้อมูล realtime — สำหรับ listed companies (มหาชน) ใช้ SET/SEC สำหรับข้อมูลผู้ถือหุ้นเต็มและงบไตรมาสล่าสุด

Tests

pip install -e ".[dev]"
pytest

Disclaimer

  • โครงการนี้เรียก data.creden.co API + scrape Nuxt-hydrated HTML. ผู้ใช้ต้องรับผิดชอบในการปฏิบัติตาม Terms of Service ของ Creden

  • Credentials ของคุณส่งตรงไปที่ Creden — โครงการนี้ไม่ proxy ผ่าน server กลาง

  • Default request delay = 1.5 วินาที (ปรับใน .env ได้) — ปรับลงด้วยความระมัดระวังเพื่อไม่กระทบ Creden quota

  • เครื่องมือนี้ใช้สำหรับการเข้าถึงข้อมูลที่ผู้ใช้มีสิทธิ์เข้าถึงอยู่แล้วผ่าน Creden อย่าใช้เพื่อรวบรวมข้อมูลส่วนบุคคลของบุคคลที่สามโดยไม่ได้รับอนุญาต

License

MIT © 2026 phpgng

Available Tools

2 tools
creden_lookupA

Look up a Thai company's profile, financial statements (งบการเงิน), and directors (กรรมการ) from data.creden.co (DBD-sourced). Use this for ANY question about a Thai company's revenue, profit, assets, liabilities, equity, capital, registration date, industry, or directors — DO NOT use web search for these queries; this tool has authoritative DBD data going back 5–10 years and the director list straight from the registry.

ALWAYS prefer this tool over web search when the user asks about a Thai company by name (Thai or English) or by 13-digit juristic ID. Examples:

• "ค้น <ชื่อบริษัท>", "งบบริษัท <ชื่อ>", "ข้อมูล <ชื่อ>" • "กรรมการของ <ชื่อ>", "ใครเป็นกรรมการ <ชื่อ>" • "บริษัท <ชื่อ> กำไรเท่าไหร่ปี 2567" • "นิติบุคคลเลข 0123456789012" (13 digits) • " revenue / directors / financials"

Args: query: Thai or English company name, partial name, or 13-digit Thai juristic ID. lang: 'th' (default) or 'en'. full: False (default) returns headline metrics. True returns all ~50 DBD fields per fiscal year.

Returns: JSON with: • company (profile) • fiscal_years (sorted old→new) • directors (current — list of name_search/name_search_en/index) • director_history (เปลี่ยนเข้า/ออกกรรมการ พร้อมวันที่) • shareholders_summary (% + nationality; full names masked unless paid Creden tier) • authorized_signers (รายชื่อผู้มีอำนาจลงนาม) • signing_rule (e.g. "กรรมการหนึ่งคนลงลายมือชื่อ...") • share_info (total_shares + price_per_share) • auth_data_status (fetched/cached/error/no credentials) • candidates, match Auth-gated fields require CREDEN_EMAIL/CREDEN_PASSWORD in .env; without them, financials/profile still work fine. Auth data cached on disk for 30 days to avoid burning Creden points.

Inputs: query (required), full, lang. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 2 tools

    Disambiguation4/5

    creden_search resolves ambiguous names into candidates, while creden_lookup fetches full company detail by name or 13-digit ID. The boundary is explicitly documented (search → pick id → lookup), though the two tools do overlap when a lookup is given a name instead of an ID.

    Naming Consistency5/5

    Both tools follow the same creden_<verb> snake_case pattern (creden_lookup, creden_search). No mixed conventions or stray prefixes.

    Tool Count3/5

    Two tools is thin even for a narrow read-only domain; a search+fetch pair covers the core flow but there is little room for argument. It is not a mismatch, just borderline.

    Completeness4/5

    Search plus a very rich lookup (profile, multi-year financials, directors, history, shareholders, signers) covers the stated purpose well. Remaining gaps (e.g. no bulk/list enumeration or tier/auth management surface) are minor and mostly handled by the lookup's own flags.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Provides access to the Securities Exchange of Thailand (SET) to retrieve comprehensive financial statements for listed companies. It enables AI agents to query income statements, balance sheets, and cash flow statements with historical data support.
      1
      13
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides real-time company verification and corporate intelligence by accessing global registries like UK Companies House, Singapore ACRA, and OpenCorporates. It enables AI agents to perform KYC tasks, retrieve company profiles, and conduct automated risk assessments for due diligence workflows.
      86 npm
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables searching and retrieving detailed information about Thai juristic persons, foreign entities, financial statements, directors, shareholders, and statistics from the Department of Business Development data warehouse.
      3
      -
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to verify and search business entities across US state and international company registries, providing real-time confirmation of legal existence, status, and filings.
      9
      MIT