{
  "markdown": "# pdf-reader-mcp\n\n一个用于读取和分析 PDF 文件的 MCP 服务器。它可以为支持 MCP（Model Context Protocol）的客户端提供 PDF 文本、页面图片、表格、链接、批注、目录、元数据和基础文本统计。\n\nA PDF-focused MCP server for extracting text, rendered pages, tables, links, annotations, outlines, metadata, and text statistics from PDF files.\n\n<!-- mcp-name: io.github.Xvvln/pdf-reader-mcp -->\n\n## Package name\n\n- GitHub repository: `pdf-reader-mcp`\n- MCP Registry name: `io.github.Xvvln/pdf-reader-mcp`\n- PyPI package: `pdf-insight-mcp`\n- CLI commands: `pdf-reader-mcp` and `pdf-insight-mcp`\n\n`pdf-reader-mcp` is the project name. The PyPI package is published as `pdf-insight-mcp` because the `pdf-reader-mcp` package name is not available on PyPI.\n\n## Features\n\n| Tool | What it does |\n| --- | --- |\n| `get_pdf_info` | Read document metadata, page count, file size, and encryption status. |\n| `read_pdf_as_text` | Extract text from selected pages with page and character limits. |\n| `read_pdf_as_images` | Render selected pages as base64-encoded images. |\n| `get_pdf_outline` | Read bookmarks and outline entries. |\n| `search_pdf_text` | Search text and return per-match page context. |\n| `extract_pdf_tables` | Extract structured tables when PyMuPDF can detect them. |\n| `extract_pdf_images` | Extract embedded PDF images. |\n| `get_pdf_page_info` | Inspect one page's size, text, images, links, and rotation. |\n| `extract_pdf_links` | Extract external URLs and internal page jumps. |\n| `get_pdf_annotations` | Read comments, highlights, and annotation metadata. |\n| `get_pdf_text_stats` | Compute text, line, paragraph, and scan-likelihood stats. |\n| `compare_pdf_pages` | Compare text similarity between two pages. |\n\n## Quick start\n\nInstall `uv` if you do not already have it:\n\n```bash\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n```\n\nRun the server directly from PyPI:\n\n```bash\nuvx pdf-insight-mcp\n```\n\nOr install it first:\n\n```bash\npython -m pip install pdf-insight-mcp\npdf-reader-mcp\n```\n\n## MCP client configuration\n\nUse the published PyPI package:\n\n```json\n{\n  \"mcpServers\": {\n    \"pdf-reader\": {\n      \"command\": \"uvx\",\n      \"args\": [\"pdf-insight-mcp\"]\n    }\n  }\n}\n```\n\nUse a local checkout for development:\n\n```json\n{\n  \"mcpServers\": {\n    \"pdf-reader\": {\n      \"command\": \"uv\",\n      \"args\": [\n        \"--directory\",\n        \"/absolute/path/to/pdf-reader-mcp\",\n        \"run\",\n        \"pdf-reader-mcp\"\n      ]\n    }\n  }\n}\n```\n\nReplace `/absolute/path/to/pdf-reader-mcp` with the absolute path to this repository on your machine.\n\n## Common usage\n\nAsk your MCP client to call tools with an absolute PDF path. Example requests:\n\n```text\nRead /Users/me/Documents/report.pdf as text.\nSearch /Users/me/Documents/report.pdf for \"baseline characteristics\".\nRender pages 1-3 of /Users/me/Documents/report.pdf as images.\nExtract links and annotations from /Users/me/Documents/review.pdf.\n```\n\nFor large PDFs, prefer small page ranges first. For scanned or layout-sensitive PDFs, use `read_pdf_as_images` with a small `pages` range and moderate `dpi`.\n\n## Limits and behavior\n\n- `read_pdf_as_text` defaults to at most 50 pages and 200000 returned characters.\n- `read_pdf_as_images` rejects requests above 20 pages.\n- `read_pdf_as_images` defaults to an overall image payload cap of about 20 MB.\n- `extract_pdf_images` returns at most 20 embedded images but reports the actual detected total.\n- Encrypted PDFs are rejected unless they are already accessible without a password.\n- Scanned PDFs may have little or no extractable text. Use image rendering or OCR outside this server when needed.\n\n## Development\n\nInstall dependencies:\n\n```bash\nuv sync --extra dev\n```\n\nRun tests:\n\n```bash\nuv run pytest -q\n```\n\nBuild the package:\n\n```bash\nuv build\nuvx twine check dist/*\n```\n\nRun the local server:\n\n```bash\nuv run pdf-reader-mcp\n```\n\n## Release\n\nReleases are published through GitHub Actions.\n\nBefore the first release, configure PyPI Trusted Publishing with:\n\n```text\nPyPI project name: pdf-insight-mcp\nOwner: Xvvln\nRepository name: pdf-reader-mcp\nWorkflow filename: publish.yml\nEnvironment name: leave empty\n```\n\nThen release by bumping versions in `pyproject.toml` and `server.json`, committing the change, and pushing a version tag:\n\n```bash\ngit tag vX.Y.Z\ngit push origin main --tags\n```\n\nThe `Publish` workflow runs tests, builds the Python package, publishes to PyPI, authenticates to the MCP Registry with GitHub OIDC, and publishes `server.json`.\n\n## Tech stack\n\n- Python 3.10+\n- MCP Python SDK\n- PyMuPDF\n- uv\n- pytest\n\n## License\n\nMIT\n",
  "bytes": 4474,
  "sha": "8887e060f13acfe4dda53ab913e64c2ac647523bbb6184327591063e9b4fcb36",
  "repo_slug": "xvvln/pdf-reader-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_xvvln_pdf_reader_mcp_1fbeba06/readme"
}