go-docs-mcp: Instructions file for Claude Code

CLAUDE.md

go-docs-mcp CLAUDE.md is an instructions file for Claude Code from drolosoft/go-docs-mcp. It costs 1,621 tokens per session, scanned A, original, MIT.

A local MCP server that lets an AI assistant work with PDF, text, Markdown, CSV, and image files stored in a documents folder.

In plain words
What is it for?
Use it to find information in local documents, extract PDF content or images, run OCR, and inspect document structure.
Why use it?
It provides one place to extract text, search files, inspect metadata, read outlines and tables, and process scanned documents.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions Claude Code.

This is drolosoft/go-docs-mcp's own configuration. It tells Claude Code how to work on go-docs-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything go-docs-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to drolosoft/go-docs-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/drolosoft/go-docs-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/drolosoft/go-docs-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for go-docs-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/drolosoft/go-docs-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/drolosoft/go-docs-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/drolosoft/go-docs-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/drolosoft/go-docs-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for go-docs-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/drolosoft/go-docs-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/drolosoft/go-docs-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,621 This file is loaded in full into every session.
When invoked 1,621 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01621 $0.01621
Opus 5.5 $0.00648 $0.00648
Sonnet 5.5 $0.00324 $0.00324
Haiku 4.5 $0.00162 $0.00162

Measured today against content hash 6817bb405782, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

go-docs-mcp CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 69 lines

How it starts

The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.

go-docs-mcp

Go MCP server serving documents (PDF, TXT, MD, CSV, Office files, EPUB, HTML, RTF, IPYNB, images) to LLMs via stdio.

Build & Run

make build          # ./go-docs-mcp binary
make install        # /usr/local/bin/go-docs-mcp
make test           # go test -v -race ./...
DOCS_MCP_DIR=~/docs ./go-docs-mcp   # custom dir

Architecture

  • main.go — MCP server init, 13 tool registrations, instructions, stdio transport
  • resources.go — docs://{filename} resources, list rebuilt on every resources/list
  • internal/pdf/reader.go — Document extraction (pdftotext/pdfinfo/pdfimages/tesseract), mtime cache, search, metadata, images, OCR, outlines, tables

Key Decisions

  • Uses pdftotext -layout for text extraction (preserves formatting)
  • mtime-based cache: re-extracts only when file changes; bounded by DOCS_MCP_CACHE_MB (default 256, 0 disables) with LRU eviction, a text larger than the cap is not cached; summary, outline and tables share it
  • Confinement: filepath.Base() + extension allowlist, then filepath.EvalSymlinks of the file must stay under the resolved DOCS_MCP_DIR (symlinks out are rejected and not listed)
  • Every external process runs with exec.CommandContext and a per-operation deadline; page ranges are capped at 200 and checked against the real page count
  • Tools are registered with read-only / non-destructive / idempotent annotations; only read_url is open-world, and DOCS_MCP_DISABLE_URL=1 removes it
  • Page tracking uses form feed (\f) characters from pdftotext output
  • Homebrew path detection for macOS (/opt/homebrew/bin/)
  • Env vars: DOCS_MCP_DIR (primary), PDF_MCP_DIR (backward compat), DROLO_DOCS_DIR (legacy), DOCS_MCP_OCR_LANG (tesseract language, default eng), DOCS_MCP_DISABLE_URL, DOCS_MCP_URL_PROXY (opt-in proxy for read_url), DOCS_MCP_CACHE_MB (text cache cap)
  • Default directory: ~/.docs-mcp/documents/
  • Text tools page their output: offset + max_chars (default 50000, cap 200000) with a trailer naming the next offset; search_document has max_results; extract_images returns PNG image content, skips masks, scales to 1600 px, 8 MB budget
  • Structured output (outputSchema + structuredContent) on list_documents, list_formats, get_document_metadata, get_document_outline, extract_tables (text JSON kept for old clients), and on the paged read_document, convert_to_markdown and ocr_document (text, next_offset, total_chars)
  • URL downloads: 60 s timeout, 50MB cap, application/pdf or text/*, private/loopback/link-local hosts refused on every hop
  • Image extraction: pdfimages -list first, only rows of type image (soft masks skipped), extracted as PNM (not -png: poppler's PNG writer is the slow part) and decoded in Go, box-filtered to 1600 px, 4 MB per image, max_images (default 10) and 8 MB per answer
  • Tool results over 9 MB are replaced with an error (server.WithToolResultSizeLimit)
  • Dual-era: one binary serves the legacy initialize handshake and the stateless MCP 2026-07-28 (_meta envelope, server/discover), all from mcp-go v1.5.0, no era branch in our code; raw_wire_test.go is the arbiter, any mcp-go bump must pass it unchanged (doc/MCP-2026-07-28.md)
  • Supports: PDF, TXT, MD, CSV, and through pandoc DOCX, XLSX, PPTX, ODT, EPUB, HTML, RTF, IPYNB; images (PNG, JPG, WebP, TIFF, BMP) with tesseract

Read the full file on GitHub · 69 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +2 lines · +178 tokens per session 6817bb405782
  2. 3d ago Changed · +13 lines · +725 tokens per session c46e5651e1a5
  3. 2mo ago First seen · 54 lines · 718 tokens per session scan A 768fb5a08ae5

Subscribe to this mod's changes

go-docs-mcp CLAUDE.md is an instructions file published in the GitHub repository drolosoft/go-docs-mcp (12 stars, last pushed yesterday), licensed MIT. It adds 1,621 tokens to every session, about $0.0065 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

go-docs-mcp CLAUDE.md compared with instructions from other repositories

go-docs-mcp CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
go-docs-mcp CLAUDE.mddrolosoft/go-docs-mcpInstructions file12yesterdayMITA1,621Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot