Skip to main content

korean-docs-mcp

CI PyPI

An MCP server that lets Claude, Cursor and other agents search a folder of Korean documents (HWP, HWPX, Markdown, text) on your own machine.

  • Reads HWP and HWPX directly. Tables come back as Markdown tables with their rows intact, not as a run of cell text.
  • Search that understands Korean. Text is split into morphemes with Kiwi before it is indexed, so 예산을, 예산의 and 국가예산 all match 예산. Ranking is BM25.
  • Local and zero-config. One SQLite file, no server, no API key, no embeddings to pay for. Documents never leave your machine.
  • Incremental. Re-indexing a folder only re-reads files that changed and drops files that were deleted.
You: 2027년 예산안에서 디지털 교과서 예산 얼마였는지 찾아줘
Claude: → search("디지털 교과서 예산")
        ← 2027 예산.hwpx, chunk 0
          | 분야 | 사업명 | 예산(억 원) |
          | 교육 | 디지털 교과서 | 495 |
        디지털 교과서 예산은 495억 원입니다 (2027 예산.hwpx 표 기준).

Setup

You need uv (brew install uv or pipx install uv). The first start installs the package with its Kiwi model (about 130 MB in total), so it takes a minute; later starts are immediate.

Claude Code

claude mcp add korean-docs -- uvx korean-docs-mcp

Claude Desktop (claude_desktop_config.json), Cursor (.cursor/mcp.json) and other clients that take the same format:

{
  "mcpServers": {
    "korean-docs": {
      "command": "uvx",
      "args": ["korean-docs-mcp"]
    }
  }
}

Then ask the agent to index a folder, e.g. "~/Documents/공문서 폴더 색인해줘", and search it in plain Korean.

To index folders when the server starts, add them to args: ["korean-docs-mcp", "--index", "/Users/me/Documents/공문서"].

Tools

Tool What it does
index_documents(folder, recursive=True) Index .hwp, .hwpx, .md, .txt files under a folder. Only new or changed files are parsed.
search(query, limit=8, folder=None, match_all=False) BM25 search over morphemes. Each hit has the chunk text, its heading, document path and chunk number.
read_document(path, chunk=None, max_chars=6000) Read a document as Markdown, from the start or around a search hit. Long documents page with next_offset.
list_documents(folder=None) Indexed documents with titles and sizes.

Search quality

KorQuAD 1.0 dev: for each of 5,774 questions, find the paragraph it was written from among 964 paragraphs. Every row is SQLite FTS5 with its built-in BM25; only the way text is split into terms changes.

Method Recall@1 Recall@5 Recall@10 MRR@10
FTS5 unicode61 (SQLite default) 0.761 0.887 0.911 0.816
FTS5 trigram 0.716 0.859 0.882 0.776
korean-docs-mcp (Kiwi morphemes) 0.896 0.980 0.988 0.933

Morpheme analysis costs about 0.5 ms per query. Reproduce with benchmarks/korquad.py.

Indexing 50 real government press releases (HWP and HWPX from korea.kr) takes about 3 seconds, and a search takes under 1 ms.

How it works

  1. Parse. HWP and HWPX are converted to Markdown with unhwp, which scored best overall in hwp-parser-bench (100% text and 95.5% table cells on public HWPX files).
  2. Chunk. Paragraphs are grouped into chunks of up to 1,200 characters under their nearest heading. A table is always its own chunk; a long table is split by rows with its header repeated in every piece.
  3. Analyze. kohybrid's KoreanTokenizer keeps nouns, numbers, foreign words and dictionary-form verbs and adjectives, and drops particles and endings.
  4. Index. The lexemes go into an SQLite FTS5 table. Document titles are indexed with double weight. The original Markdown is stored for display.

The index lives at ~/.local/share/korean-docs-mcp/index.sqlite3. Change it with --db or the KOREAN_DOCS_DB environment variable.

Limits

  • Merged table cells are left empty in all but their first row, as the parser emits them; a search for a row's group label may miss later rows.
  • Images, charts and scanned pages are not read.
  • No vector search yet. BM25 over morphemes handles keyword-style questions well; paraphrased questions with no shared words are not found.

Development

git clone https://github.com/RionHwang0/korean-docs-mcp && cd korean-docs-mcp
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
pytest

tests/test_server.py starts the server over stdio and drives it with the MCP Python client.

License

MIT

Metadata

Release files for korean-docs-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for korean-docs-mcp 0.1.0
File Size Uploaded Provenance Actions
korean_docs_mcp-0.1.0.tar.gz 36.3 kB With provenance Details for korean_docs_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for korean-docs-mcp 0.1.0
File Interpreter ABI Platform Actions
korean_docs_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for korean_docs_mcp-0.1.0-py3-none-any.whl

Total release size: 51.1 kB

Release files / korean_docs_mcp-0.1.0.tar.gz

Download URL korean_docs_mcp-0.1.0.tar.gz
Size 36.3 kB
Tags Source
SHA-256 checksum
How to use checksums
be1c03b0a0dd71c5b2971c2b1e8041d442487d47189bb3649550936dbce61c72
BLAKE2b-256 checksum
How to use checksums
5e7681d91ee16dbc741a508e7362ab2bc52c5b55eb96b1661526434b6e76e7e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / korean_docs_mcp-0.1.0-py3-none-any.whl

Download URL korean_docs_mcp-0.1.0-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
157c3a5a2ba55e72aba6f4d99b8d22119c809fa83131a0f25f0ba7fa8b022898
BLAKE2b-256 checksum
How to use checksums
d1d34815365cd35df5782325b4f5a77cd06ef64078afe8c6d9476fdee513518d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Security for korean-docs-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for korean_docs_mcp-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page