rtfm-mcp 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.db
4
+ .venv/
5
+ dist/
6
+ build/
7
+ # never commit a real corpus home if RTFM_HOME is pointed into the tree
8
+ /.rtfm/
9
+ # dev process scaffolding (implementation plans, specs) — not published
10
+ docs/superpowers/
rtfm_mcp-0.8.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Canlin Zhang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,122 @@
1
+ Metadata-Version: 2.5
2
+ Name: rtfm-mcp
3
+ Version: 0.8.0
4
+ Summary: Read The Full Manual — local document-corpus search MCP server.
5
+ Project-URL: Homepage, https://github.com/canlin-zhang/rtfm
6
+ Project-URL: Repository, https://github.com/canlin-zhang/rtfm
7
+ Project-URL: Issues, https://github.com/canlin-zhang/rtfm/issues
8
+ Author: Canlin Zhang
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: documentation,mcp,pdf,search
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Requires-Python: >=3.11
16
+ Requires-Dist: mcp[cli]<2,>=1.28.1
17
+ Requires-Dist: pymupdf
18
+ Requires-Dist: pypdf
19
+ Description-Content-Type: text/markdown
20
+
21
+ # rtfm
22
+
23
+ > **rtfm** — Read the ~~F-~~ **Full** Manual.
24
+
25
+ A local MCP server and Claude Code plugin that makes large, can't-read-by-hand technical
26
+ documentation searchable — PDF spec sets, documentation repositories (and, later, public
27
+ doc sites) — and answers questions strictly from that material, with grounded citations.
28
+ The server is also published as the `rtfm-mcp` Python package.
29
+
30
+ The eternal advice "read the manual" falls apart when the manual is a 400-page protocol
31
+ spec or a vendor doc-set no human can hold in their head. `rtfm` ingests the **full** manual
32
+ so the answer is one cited query away.
33
+
34
+ ## Limitations
35
+
36
+ `rtfm` indexes the **extractable text** a document already carries. It does not OCR images
37
+ and does not execute JavaScript, so image-only/scanned PDFs and image-only or JS-rendered
38
+ web pages are out of scope — they index as empty. (See [ADR 0005](https://github.com/canlin-zhang/rtfm/blob/main/docs/adr/0005-text-extraction-only-no-ocr.md).)
39
+
40
+ ## Install
41
+
42
+ ### Claude Code
43
+
44
+ ```bash
45
+ # in Claude Code:
46
+ /plugin marketplace add canlin-zhang/rtfm
47
+ /plugin install rtfm
48
+ ```
49
+
50
+ ### Any MCP client (PyPI)
51
+
52
+ The server is also published as `rtfm-mcp`:
53
+
54
+ ```bash
55
+ uvx --from rtfm-mcp rtfm-server # or: pipx install rtfm-mcp && rtfm-server
56
+ ```
57
+
58
+ Point the client's MCP configuration at that command:
59
+
60
+ ```json
61
+ {
62
+ "mcpServers": {
63
+ "rtfm": {
64
+ "command": "uvx",
65
+ "args": ["--from", "rtfm-mcp", "rtfm-server"]
66
+ }
67
+ }
68
+ }
69
+ ```
70
+
71
+ **Prerequisites:** `python3` on PATH is the only hard requirement for the plugin. It
72
+ uses `uv` when available and otherwise builds a private venv under `~/.rtfm/venv` on
73
+ first run. The PyPI path needs `uv` (for `uvx`) or `pipx`.
74
+ *Optional:* install `poppler-utils` (`pdftotext`) for best-quality PDF extraction.
75
+
76
+ ## Two ways to use it
77
+
78
+ **Quick-and-dirty (the `default` drop-dir).** Drop PDFs or Markdown/text into `~/.rtfm/default`
79
+ and just `search` — the default dir re-indexes itself on search, so dropped files show up with
80
+ no extra step. Keep it small; it's a scratch space.
81
+
82
+ **Organized corpus (pointed-to folders).** For a large, structured doc set (e.g. a vendor's
83
+ documentation tree), add a `dir` source in `~/.rtfm/manifest.toml` pointing at the folder, then
84
+ build it once:
85
+
86
+ ```
87
+ reindex("vendor-docs")
88
+ ```
89
+
90
+ Searches are instant afterward. `dir` sources auto-reindex inline when the delta is small
91
+ (`RTFM_AUTO_REINDEX_MAX`, default 10); a larger delta returns a warning telling you to run
92
+ `reindex` once. `git_repo` sources are the exception to the budget: a stale or never-indexed
93
+ source always auto-reindexes inline on search — no budget gate, warns loudly on failure —
94
+ including the initial clone for managed sources, so the first search over a fresh corpus can
95
+ take a while. Byte-identical files that repeat across version subfolders are extracted once;
96
+ `find_duplicates` lists every path a given content lives at.
97
+
98
+ ## Use
99
+
100
+ Drop PDFs / `.md` / `.mdx` / `.rst` / `.txt` into `~/.rtfm/default/`, then ask Claude to search them, or
101
+ add more sources by editing `~/.rtfm/manifest.toml` (see `manifest.example.toml`).
102
+
103
+ Or invoke the bundled **`read-the-manual`** skill (`/read-the-manual`) to have a question
104
+ answered strictly from the corpus — verbatim quotes with page/line citations, no
105
+ model-knowledge fallback.
106
+
107
+ ## Status
108
+
109
+ Early but working. Today rtfm gives you zero-config search over a default drop-folder: PDF,
110
+ Markdown, reStructuredText, and text files are indexed into one content-addressed full-text
111
+ index with page/line citations, exposed through the `search` / `read` / `reindex` /
112
+ `find_duplicates` / `list_sources` / `health_check` tools and the `read-the-manual` skill, with
113
+ a uv-or-venv launcher and Claude Code plugin packaging. HTML with anchor citations, git-backed
114
+ repo sources with auto-refresh, file-curation tools, and OCR are planned — see the
115
+ [roadmap](https://github.com/canlin-zhang/rtfm/blob/main/docs/ROADMAP.md).
116
+
117
+ Architecture decisions live in [docs/adr/](https://github.com/canlin-zhang/rtfm/tree/main/docs/adr/); domain language in
118
+ [CONTEXT.md](https://github.com/canlin-zhang/rtfm/blob/main/CONTEXT.md).
119
+
120
+ ## License
121
+
122
+ MIT © Canlin Zhang
@@ -0,0 +1,102 @@
1
+ # rtfm
2
+
3
+ > **rtfm** — Read the ~~F-~~ **Full** Manual.
4
+
5
+ A local MCP server and Claude Code plugin that makes large, can't-read-by-hand technical
6
+ documentation searchable — PDF spec sets, documentation repositories (and, later, public
7
+ doc sites) — and answers questions strictly from that material, with grounded citations.
8
+ The server is also published as the `rtfm-mcp` Python package.
9
+
10
+ The eternal advice "read the manual" falls apart when the manual is a 400-page protocol
11
+ spec or a vendor doc-set no human can hold in their head. `rtfm` ingests the **full** manual
12
+ so the answer is one cited query away.
13
+
14
+ ## Limitations
15
+
16
+ `rtfm` indexes the **extractable text** a document already carries. It does not OCR images
17
+ and does not execute JavaScript, so image-only/scanned PDFs and image-only or JS-rendered
18
+ web pages are out of scope — they index as empty. (See [ADR 0005](https://github.com/canlin-zhang/rtfm/blob/main/docs/adr/0005-text-extraction-only-no-ocr.md).)
19
+
20
+ ## Install
21
+
22
+ ### Claude Code
23
+
24
+ ```bash
25
+ # in Claude Code:
26
+ /plugin marketplace add canlin-zhang/rtfm
27
+ /plugin install rtfm
28
+ ```
29
+
30
+ ### Any MCP client (PyPI)
31
+
32
+ The server is also published as `rtfm-mcp`:
33
+
34
+ ```bash
35
+ uvx --from rtfm-mcp rtfm-server # or: pipx install rtfm-mcp && rtfm-server
36
+ ```
37
+
38
+ Point the client's MCP configuration at that command:
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "rtfm": {
44
+ "command": "uvx",
45
+ "args": ["--from", "rtfm-mcp", "rtfm-server"]
46
+ }
47
+ }
48
+ }
49
+ ```
50
+
51
+ **Prerequisites:** `python3` on PATH is the only hard requirement for the plugin. It
52
+ uses `uv` when available and otherwise builds a private venv under `~/.rtfm/venv` on
53
+ first run. The PyPI path needs `uv` (for `uvx`) or `pipx`.
54
+ *Optional:* install `poppler-utils` (`pdftotext`) for best-quality PDF extraction.
55
+
56
+ ## Two ways to use it
57
+
58
+ **Quick-and-dirty (the `default` drop-dir).** Drop PDFs or Markdown/text into `~/.rtfm/default`
59
+ and just `search` — the default dir re-indexes itself on search, so dropped files show up with
60
+ no extra step. Keep it small; it's a scratch space.
61
+
62
+ **Organized corpus (pointed-to folders).** For a large, structured doc set (e.g. a vendor's
63
+ documentation tree), add a `dir` source in `~/.rtfm/manifest.toml` pointing at the folder, then
64
+ build it once:
65
+
66
+ ```
67
+ reindex("vendor-docs")
68
+ ```
69
+
70
+ Searches are instant afterward. `dir` sources auto-reindex inline when the delta is small
71
+ (`RTFM_AUTO_REINDEX_MAX`, default 10); a larger delta returns a warning telling you to run
72
+ `reindex` once. `git_repo` sources are the exception to the budget: a stale or never-indexed
73
+ source always auto-reindexes inline on search — no budget gate, warns loudly on failure —
74
+ including the initial clone for managed sources, so the first search over a fresh corpus can
75
+ take a while. Byte-identical files that repeat across version subfolders are extracted once;
76
+ `find_duplicates` lists every path a given content lives at.
77
+
78
+ ## Use
79
+
80
+ Drop PDFs / `.md` / `.mdx` / `.rst` / `.txt` into `~/.rtfm/default/`, then ask Claude to search them, or
81
+ add more sources by editing `~/.rtfm/manifest.toml` (see `manifest.example.toml`).
82
+
83
+ Or invoke the bundled **`read-the-manual`** skill (`/read-the-manual`) to have a question
84
+ answered strictly from the corpus — verbatim quotes with page/line citations, no
85
+ model-knowledge fallback.
86
+
87
+ ## Status
88
+
89
+ Early but working. Today rtfm gives you zero-config search over a default drop-folder: PDF,
90
+ Markdown, reStructuredText, and text files are indexed into one content-addressed full-text
91
+ index with page/line citations, exposed through the `search` / `read` / `reindex` /
92
+ `find_duplicates` / `list_sources` / `health_check` tools and the `read-the-manual` skill, with
93
+ a uv-or-venv launcher and Claude Code plugin packaging. HTML with anchor citations, git-backed
94
+ repo sources with auto-refresh, file-curation tools, and OCR are planned — see the
95
+ [roadmap](https://github.com/canlin-zhang/rtfm/blob/main/docs/ROADMAP.md).
96
+
97
+ Architecture decisions live in [docs/adr/](https://github.com/canlin-zhang/rtfm/tree/main/docs/adr/); domain language in
98
+ [CONTEXT.md](https://github.com/canlin-zhang/rtfm/blob/main/CONTEXT.md).
99
+
100
+ ## License
101
+
102
+ MIT © Canlin Zhang
@@ -0,0 +1,86 @@
1
+ # rtfm source manifest. Copy to ~/.rtfm/manifest.toml and edit.
2
+ # Each [[source]] is one place rtfm indexes, in place.
3
+ #
4
+ # search keeps sources current automatically: when a dir source has only a few new/changed
5
+ # files (RTFM_AUTO_REINDEX_MAX, default 10) it is reindexed inline, so dropping or editing a
6
+ # handful of files just works. A larger batch is NOT auto-indexed — that would block the query
7
+ # on extraction — so search warns and you run `reindex("<name>")` once. git_repo sources are
8
+ # different: a stale or never-indexed git_repo auto-reindexes inline on search (no budget
9
+ # gate, warns loudly on failure), including the initial clone for managed sources. Two modes
10
+ # follow from this:
11
+ #
12
+ # 1. The "default" drop-dir — quick-and-dirty scratch. Drop a few files in, search finds them.
13
+ # Created for you automatically; keep it small.
14
+ # 2. Pointed-to folders — an organized corpus you manage. Run `reindex("<name>")` once after
15
+ # first adding a large set; thereafter small changes auto-reindex on search. Read-only by default.
16
+ #
17
+ # Every source declares its scope. Two keys are optional and one is required.
18
+ #
19
+ # paths Directory prefixes to index. Unset means the whole tree. A "!" entry
20
+ # excludes a prefix, and exclusion wins:
21
+ # paths = ["docs", "!docs/versions"]
22
+ # Every prefix is relative to the source root; a leading "/" is optional
23
+ # and ignored (the same convention .gitignore uses for an anchored path).
24
+ # Prefixes only — no globs. A literal "docs/**" directory does not exist,
25
+ # so a glob character (*, ?, [) is refused at load time, loudly, rather
26
+ # than silently indexing nothing while looking correct.
27
+ #
28
+ # ext_allowlist Index ONLY these file types. ) exactly one of these
29
+ # ext_blocklist Index everything EXCEPT these, ) two is required
30
+ # on top of rtfm's own list of known binary and asset types.
31
+ #
32
+ # Declaring both is refused; declaring neither is refused. rtfm does not guess what to
33
+ # index, because a guess is how a hidden default comes back through a side door.
34
+ #
35
+ # Which to pick: an allowlist decides what you GET, so growing it later means every source
36
+ # pinned to the old list silently misses the new type. A blocklist decides what you DON'T
37
+ # get, and everything on it is something nobody wants indexed, so growing it later removes
38
+ # garbage and never content. Prefer a blocklist unless you know exactly what you want.
39
+
40
+ [[source]]
41
+ name = "default" # the zero-config drop-dir; the only mutable source by default
42
+ type = "dir"
43
+ path = "~/.rtfm/default"
44
+ mutable = true
45
+ ext_blocklist = [] # index everything except rtfm's known binary and asset types
46
+
47
+ # Example: point at a large, organized doc set. Run reindex("vendor-docs") once after adding it;
48
+ # searches are instant thereafter. Byte-identical files across version subfolders are stored once.
49
+ # [[source]]
50
+ # name = "vendor-docs"
51
+ # type = "dir"
52
+ # path = "/path/to/vendor/Documentation"
53
+ # mutable = false
54
+ # ext_blocklist = []
55
+
56
+ # Example: a git-tracked doc repo — linked mode (user provides the clone). Read-only:
57
+ # rtfm verifies the remote URL and a clean tree, then indexes the checkout as-is —
58
+ # it never fetches or resets the user's clone.
59
+ # [[source]]
60
+ # name = "specs"
61
+ # type = "git_repo"
62
+ # url = "https://example.com/org/specs.git"
63
+ # ref = "main"
64
+ # path = "/path/to/specs"
65
+ # ext_allowlist = [".md"] # exactly one of ext_allowlist/ext_blocklist is required
66
+
67
+ # Example: a git-tracked doc repo — managed mode (rtfm clones to ~/.rtfm/repos/<name>/
68
+ # and fetches + resets on every reindex).
69
+ # [[source]]
70
+ # name = "docs-managed"
71
+ # type = "git_repo"
72
+ # url = "https://example.com/org/specs.git"
73
+ # ref = "v2.1-stable"
74
+ # ext_allowlist = [".md"]
75
+
76
+ # Example: a rules repo where the documentation lives in Starlark doc= strings, not
77
+ # in a docs/ folder rtfm could scope with `paths` alone (issue #24). ext_allowlist picks
78
+ # out the file types that actually carry prose, and `paths` narrows further, skipping
79
+ # the repo's test fixtures.
80
+ # [[source]]
81
+ # name = "rules_cc"
82
+ # type = "git_repo"
83
+ # url = "https://github.com/bazelbuild/rules_cc.git"
84
+ # ref = "main"
85
+ # ext_allowlist = [".bzl", ".md"]
86
+ # paths = ["cc", "!tests"]
@@ -0,0 +1,63 @@
1
+ # Package manifest for the published core (`rtfm-mcp` on PyPI). The runtime
2
+ # dependency source of truth remains the PEP-723 `# /// script` block in
3
+ # rtfm_server.py (ADR 0009); [project].dependencies mirrors it, and
4
+ # scripts/check_version_consistency.py fails on drift. The dev group and tool
5
+ # config below exist only for working on the repo.
6
+ [build-system]
7
+ requires = ["hatchling"]
8
+ build-backend = "hatchling.build"
9
+
10
+ [project]
11
+ name = "rtfm-mcp"
12
+ version = "0.8.0"
13
+ description = "Read The Full Manual — local document-corpus search MCP server."
14
+ readme = "README.md"
15
+ requires-python = ">=3.11"
16
+ license = "MIT"
17
+ license-files = ["LICENSE"]
18
+ authors = [{ name = "Canlin Zhang" }]
19
+ keywords = ["mcp", "documentation", "search", "pdf"]
20
+ classifiers = [
21
+ "Development Status :: 4 - Beta",
22
+ "Programming Language :: Python :: 3",
23
+ "Programming Language :: Python :: 3 :: Only",
24
+ ]
25
+ dependencies = [
26
+ "mcp[cli]>=1.28.1,<2",
27
+ "pymupdf",
28
+ "pypdf",
29
+ ]
30
+
31
+ [project.urls]
32
+ Homepage = "https://github.com/canlin-zhang/rtfm"
33
+ Repository = "https://github.com/canlin-zhang/rtfm"
34
+ Issues = "https://github.com/canlin-zhang/rtfm/issues"
35
+
36
+ [project.scripts]
37
+ rtfm-server = "rtfm_server:main"
38
+
39
+ [tool.hatch.build.targets.wheel]
40
+ # The server is deliberately one importable module, not a package (AGENTS.md).
41
+ only-include = ["rtfm_server.py"]
42
+
43
+ [tool.hatch.build.targets.sdist]
44
+ include = [
45
+ "rtfm_server.py",
46
+ "manifest.example.toml",
47
+ "README.md",
48
+ "LICENSE",
49
+ "pyproject.toml",
50
+ ]
51
+
52
+ [dependency-groups]
53
+ dev = ["pytest"]
54
+
55
+ [tool.pytest.ini_options]
56
+ pythonpath = ["."]
57
+
58
+ [tool.ruff]
59
+ target-version = "py311"
60
+ line-length = 100
61
+
62
+ [tool.ruff.lint]
63
+ select = ["E", "F", "I", "UP", "B"] # pycodestyle, pyflakes, isort, pyupgrade, bugbear