docs2mcp
Turn a directory of Markdown, HTML, or TXT files into a read-only MCP server that AskMesh can connect to directly.
Quick start
python3 -m venv .venv
. .venv/bin/activate
pip install -e .
python -m docs2mcp.runtime ./docs --base-url https://docs.example.com/docs --host 0.0.0.0 --port 8765
Enable incremental synchronization with file watching and periodic reconciliation:
python -m docs2mcp.runtime ./docs \
--host 0.0.0.0 \
--port 8765 \
--watch \
--sync-interval 30
The first startup scans the entire directory. Later changes are applied per document: new files are inserted, modified files are re-indexed, deleted files are removed, and unchanged files are skipped. The watcher uses a short debounce window and the periodic scan provides a fallback for filesystems that do not reliably emit events.
When binding to a specific public address with DNS-rebinding protection enabled, allow the incoming Host header explicitly:
python -m docs2mcp.runtime ./docs \
--host 0.0.0.0 \
--port 8765 \
--allowed-host 'docs.example.com:*'
Use the same Python interpreter for installation and startup. docs2mcp requires the official MCP Python SDK mcp>=1.27.0,<2; an older or unrelated package named mcp does not provide mcp.server.fastmcp.
The legacy doc2mcp command remains available as a compatibility alias.
The process prints the MCP connection configuration on startup. Authentication is optional: pass --token to enable Bearer authentication, or omit it to run without authentication.
{
"endpoint": "http://127.0.0.1:8765/mcp",
"auth_type": "none",
"token": null,
"search_tool": "search_docs",
"read_tool": "get_document",
"contract_version": "agent-qa.docs/v1"
}
Enter the endpoint, authentication mode, search_docs, and get_document values in the AskMesh knowledge source configuration. When auth_type is none, select no authentication and leave the token empty.
GET /readyz reports the document count and the latest synchronization counters, including added, updated, deleted, skipped, failed, duration, and the last error.
Supported formats
The MVP supports .md, .markdown, .txt, .html, and .htm. Indexing uses SQLite FTS5, so no separate vector database is required.
MCP contract
The server implements agent-qa.docs/v1 and exposes two read-only tools:
search_docs(query, limit): returnsroute,title,url,snippet, andscore.get_document(route, max_characters): returns document content, sections, and a citation URL.
search_docs.query uses SQLite FTS5 syntax. Whitespace is an AND query, OR matches either term, quoted text searches an exact phrase, NOT excludes a term, and * enables prefix matching. It is not semantic natural-language search; clients should show this syntax to users.
Current limitations
This release is a single-host MVP: documents are imported from a local directory and the index is stored in SQLite. Git synchronization, PDF parsing, object storage, vector search, and a multi-tenant control plane are planned for later releases.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docs2mcp-0.1.0.tar.gz.
File metadata
- Download URL: docs2mcp-0.1.0.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5023bd2cbbc091efb8c861cb6147c95048fa0fc35af3c608bdd761c1c4aefa3e
|
|
| MD5 |
d2f1e5f359f3bc76a7e05f6cd0d1b310
|
|
| BLAKE2b-256 |
bf52df1ac9a757bd8b06467bb148ed83279b422a6a4eea47160a3620254ccb73
|
Provenance
The following attestation bundles were made for docs2mcp-0.1.0.tar.gz:
Publisher:
publish.yml on r9s-ai/docs2mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docs2mcp-0.1.0.tar.gz -
Subject digest:
5023bd2cbbc091efb8c861cb6147c95048fa0fc35af3c608bdd761c1c4aefa3e - Sigstore transparency entry: 2545288231
- Sigstore integration time:
-
Permalink:
r9s-ai/docs2mcp@395e136e45c66ed2d0f6cf58c2a36b6b843f229c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/r9s-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@395e136e45c66ed2d0f6cf58c2a36b6b843f229c -
Trigger Event:
push
-
Statement type:
File details
Details for the file docs2mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: docs2mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86bfeae55d755f477da0f91ba00bae69d1df06214c54c33beafbe3db203f64d6
|
|
| MD5 |
7ebed439cd64ca17658b377efda6a05c
|
|
| BLAKE2b-256 |
149153f1ba878cb03efb43355233ac60582dd570eacb77db4b81df48f00687af
|
Provenance
The following attestation bundles were made for docs2mcp-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on r9s-ai/docs2mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docs2mcp-0.1.0-py3-none-any.whl -
Subject digest:
86bfeae55d755f477da0f91ba00bae69d1df06214c54c33beafbe3db203f64d6 - Sigstore transparency entry: 2545288287
- Sigstore integration time:
-
Permalink:
r9s-ai/docs2mcp@395e136e45c66ed2d0f6cf58c2a36b6b843f229c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/r9s-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@395e136e45c66ed2d0f6cf58c2a36b6b843f229c -
Trigger Event:
push
-
Statement type: