{"id":51049585,"url":"https://github.com/wayyoungboy/doc2mcp","last_synced_at":"2026-06-22T16:02:21.396Z","repository":{"id":362769158,"uuid":"1260641305","full_name":"wayyoungboy/doc2mcp","owner":"wayyoungboy","description":"Compile documentation into portable MCP knowledge packages with search, citations, and stdio serving","archived":false,"fork":false,"pushed_at":"2026-06-05T19:42:09.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-05T21:17:36.680Z","etag":null,"topics":["citations","cli","documentation","go","knowledge-base","mcp","search"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wayyoungboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"docs/ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-05T17:59:04.000Z","updated_at":"2026-06-05T19:42:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wayyoungboy/doc2mcp","commit_stats":null,"previous_names":["wayyoungboy/doc2mcp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wayyoungboy/doc2mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayyoungboy%2Fdoc2mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayyoungboy%2Fdoc2mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayyoungboy%2Fdoc2mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayyoungboy%2Fdoc2mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wayyoungboy","download_url":"https://codeload.github.com/wayyoungboy/doc2mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayyoungboy%2Fdoc2mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34655723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["citations","cli","documentation","go","knowledge-base","mcp","search"],"created_at":"2026-06-22T16:02:20.551Z","updated_at":"2026-06-22T16:02:21.391Z","avatar_url":"https://github.com/wayyoungboy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Doc2MCP\n\n**Compile docs once. Serve them as a narrow, citation-ready MCP knowledge package.**\n\n![Doc2MCP hero](assets/hero.svg)\n\n[![CI](https://github.com/wayyoungboy/doc2mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/wayyoungboy/doc2mcp/actions/workflows/ci.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/wayyoungboy/doc2mcp.svg)](https://pkg.go.dev/github.com/wayyoungboy/doc2mcp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![MCP](https://img.shields.io/badge/MCP-tools%20%2B%20resources%20%2B%20prompts-14b8a6)](docs/THREAT_MODEL.md)\n\n\u003c/div\u003e\n\nDoc2MCP is not another document-to-Markdown converter. Use MarkItDown or Docling as importers when you need broad file conversion. Doc2MCP starts after normalization: it builds a reproducible package with source files, section IDs, checksums, citations, resources, tools, and prompts.\n\n```bash\ndoc2mcp build ./docs --out ./dist/my-docs --name my-docs\ndoc2mcp search ./dist/my-docs \"authentication token\"\ndoc2mcp serve ./dist/my-docs\n```\n\n## What You Get\n\n| Output | Why it matters |\n|---|---|\n| `doc2mcp.json` | Package manifest with source metadata, checksums, documents, and sections. |\n| `index.json` | Flattened local index for simple CLI and MCP search. |\n| `sources/` | Original imported files kept for audit and provenance. |\n| MCP tools | `search_docs`, `read_doc`, and `cite_source` for agent workflows. |\n| MCP prompt | `answer_with_citations` to steer answers toward source-backed responses. |\n\n![Doc2MCP workflow](assets/workflow.svg)\n\n## Why\n\nRAG servers usually ingest files at runtime and expose a search tool. That works, but it can leave agents with a fuzzy boundary over the local filesystem.\n\nDoc2MCP uses a build step:\n\n- compile docs once\n- inspect the generated package\n- expose a narrow MCP surface\n- cite source sections by stable ID\n- avoid surprise filesystem crawling during chat\n\n## Features\n\n- Markdown and plain text directory importer\n- Reproducible package files: `doc2mcp.json`, `index.json`, `sources/`\n- Source-grounded citations with path, heading, checksum, and section ID\n- CLI search and section display\n- stdio MCP server\n- MCP tools: `search_docs`, `read_doc`, `cite_source`\n- MCP resources for compiled documents\n- MCP prompt: `answer_with_citations`\n- Standard-library Go implementation\n\n## Install\n\n```bash\ngo install github.com/wayyoungboy/doc2mcp/cmd/doc2mcp@latest\n```\n\nLocal checkout:\n\n```bash\ngit clone https://github.com/wayyoungboy/doc2mcp.git\ncd doc2mcp\ngo test ./...\ngo run ./cmd/doc2mcp build testdata/docs --out /tmp/doc2mcp-demo --name demo-docs\n```\n\n## Commands\n\n### Build\n\n```bash\ndoc2mcp build ./docs --out ./dist/product-docs --name product-docs\n```\n\nOutput:\n\n```text\ndist/product-docs/\n  doc2mcp.json\n  index.json\n  sources/\n```\n\n### Search\n\n```bash\ndoc2mcp search ./dist/product-docs \"rate limit retry\"\ndoc2mcp search ./dist/product-docs \"rate limit retry\" --json true\n```\n\n### Show\n\n```bash\ndoc2mcp show ./dist/product-docs api.md#authentication\n```\n\n### Serve MCP\n\n```json\n{\n  \"mcpServers\": {\n    \"product-docs\": {\n      \"command\": \"doc2mcp\",\n      \"args\": [\"serve\", \"/absolute/path/to/dist/product-docs\"]\n    }\n  }\n}\n```\n\n### Claude Code and Codex\n\nDoc2MCP can be launched by both Claude Code and Codex as a local stdio MCP server.\n\n- Claude Code: use a project `.mcp.json` or `claude mcp add product-docs --scope project -- doc2mcp serve /absolute/path/to/dist/product-docs`\n- Codex: add `[mcp_servers.product-docs]` to `~/.codex/config.toml`\n\nSee [Agent Integrations](docs/agent-integrations.md) and the sample files in `examples/`.\n\n## Positioning\n\n| Tool class | Good at | Doc2MCP wedge |\n|---|---|---|\n| MarkItDown MCP | broad file-to-Markdown conversion | use it upstream, then compile MCP-native packages |\n| Docling MCP | rich parsing, OCR, document structure | use it upstream, then freeze provenance and MCP tools |\n| Local RAG MCP | runtime ingest/chunk/embed/search | build-time package boundary with resources, prompts, citations |\n| Filesystem MCP | raw file access | no surprise crawl; agent sees compiled package only |\n\n## Package Format\n\n`doc2mcp.json` contains package metadata, documents, sections, and checksums. `index.json` contains flattened sections for simple retrieval. `sources/` keeps the original imported files for audit.\n\nThe v0.1 index is lexical and offline. v0.2 can add seekdb vector/full-text indexing without changing the package boundary.\n\n## Status\n\nv0.1 is an MVP. It is useful for Markdown/text docs, internal runbooks, API docs, and small knowledge packages. For PDFs, DOCX, PPTX, images, or audio, convert them with MarkItDown or Docling first, then compile the generated Markdown with Doc2MCP.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayyoungboy%2Fdoc2mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwayyoungboy%2Fdoc2mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayyoungboy%2Fdoc2mcp/lists"}