qt4-doc-mcp-server


Nameqt4-doc-mcp-server JSON
Version 0.5.0 PyPI version JSON
download
home_pageNone
SummaryOffline MCP Server for Qt 4.8.4 documentation
upload_time2025-10-26 01:19:15
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT License Copyright (c) 2025 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords c++ documentation mcp model-context-protocol qt4
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Qt 4.8.4 Documentation MCP Server

[![PyPI Version](https://img.shields.io/pypi/v/qt4-doc-mcp-server.svg)](https://pypi.org/project/qt4-doc-mcp-server/)
[![License](https://img.shields.io/github/license/jztan/qt4-doc-mcp-server.svg)](LICENSE)
[![Python Version](https://img.shields.io/pypi/pyversions/qt4-doc-mcp-server.svg)](https://pypi.org/project/qt4-doc-mcp-server/)
[![GitHub Issues](https://img.shields.io/github/issues/jztan/qt4-doc-mcp-server.svg)](https://github.com/jztan/qt4-doc-mcp-server/issues)
[![CI](https://github.com/jztan/qt4-doc-mcp-server/actions/workflows/pr-tests.yml/badge.svg)](https://github.com/jztan/qt4-doc-mcp-server/actions/workflows/pr-tests.yml)

Offline‑only MCP Server that serves Qt 4.8.4 documentation to Agents/LLMs and IDEs.
It loads local HTML docs, converts pages to Markdown, and provides fast full‑text
search via SQLite FTS5.

## Quickstart
1. Install the package: `pip install qt4-doc-mcp-server`.
2. Fetch and stage the Qt docs (one-time): `python scripts/prepare_qt48_docs.py --segments 4`.
3. Copy `.env` from the script output or create one manually (see table below).
4. Build the search index: `qt4-doc-build-index` (required for search functionality).
5. Run the server: `qt4-doc-mcp-server` (or `uv run python -m qt4_doc_mcp_server.main`).
6. Verify health: `curl -s http://127.0.0.1:8000/health` → `{ "status": "ok" }`.
7. Optional: warm the Markdown cache for faster responses: `qt4-doc-warm-md`.

## Project Structure

```
.
├─ README.md                    # Quick start, config, licensing
├─ LICENSE                      # MIT license for this codebase
├─ CHANGELOG.md                 # Keep a Changelog (Unreleased + releases)
├─ THIRD_PARTY_NOTICES.md       # Qt docs and deps licensing notes
├─ pyproject.toml               # Packaging, deps, console entry points
├─ scripts/
│  ├─ prepare_qt48_docs.py      # Download, extract, and stage Qt 4.8.4 docs; writes .env
├─ src/
│  └─ qt4_doc_mcp_server/
│     ├─ __init__.py            # Package version
│     ├─ main.py                # FastMCP app (+ /health) and CLI run()
│     ├─ config.py              # Env loader (dotenv) + startup checks
│     ├─ tools.py               # MCP tools (read_documentation, search_documentation)
│     ├─ fetcher.py             # Canonical URL + local path mapping
│     ├─ convert.py             # HTML extraction, link normalization, HTML→Markdown
│     ├─ cache.py               # LRU + Markdown store (disk) helpers
│     ├─ doc_service.py         # Read path orchestration (store + convert)
│     ├─ search.py              # FTS5 index build/query with BM25 ranking
│     └─ cli.py                 # CLI utilities (qt4-doc-warm-md, qt4-doc-build-index)
└─ tests/                       # pytest suite (e.g., test_doc_service.py)
```

## Requirements
- Python 3.11+
- Local Qt 4.8.4 HTML documentation (see below)

## Get the Qt 4.8.4 Docs

### Prepare Docs with Python helper (recommended)

```
python scripts/prepare_qt48_docs.py # copy docs by default into ./qt4-docs-html
```
OR
```
python scripts/prepare_qt48_docs.py --segments 4 # faster download with 4 segments
```

This will:
- Download and extract the Qt 4.8.4 source archive (or reuse if present)
- Stage the HTML docs at `qt4-docs-html` (symlink by default)
- Copy `LICENSE.FDL` next to the docs
- Create/update `.env` with `QT_DOC_BASE` and sensible defaults



## Configure (dotenv)
Create a `.env` file in the repo root. The helper script writes sensible defaults; adjust as needed:

| Variable | Default | Purpose |
| --- | --- | --- |
| `QT_DOC_BASE` | _required_ | Absolute path to the Qt 4.8.4 HTML docs (`.../doc/html`). |
| `INDEX_DB_PATH` | `.index/fts.sqlite` | Location of the SQLite FTS5 search index. |
| `MD_CACHE_DIR` | `.cache/md` | Directory for cached Markdown blobs + metadata. |
| `PREINDEX_DOCS` | `true` | Build search index automatically at startup if not present. |
| `PRECONVERT_MD` | `true` | Warm the Markdown cache automatically at startup. |
| `SERVER_HOST` | `127.0.0.1` | Bind address for the FastMCP server (`0.0.0.0` for containers). |
| `SERVER_PORT` | `8000` | TCP port for streamable HTTP transport. |
| `MCP_LOG_LEVEL` | `WARNING` | Logging verbosity (DEBUG/INFO/WARNING/ERROR). |
| `MD_CACHE_SIZE` | `512` | In-memory CachedDoc LRU capacity (counts pages). |
| `DEFAULT_MAX_MARKDOWN_LENGTH` | `20000` | Default maximum characters returned per request (prevents token limit issues). |

## Dev Setup and Run
```
uv venv .venv && source .venv/bin/activate

# Option 1: run without installing the package (dev-only)
# Using uv to run the module directly
uv run python -m qt4_doc_mcp_server.main

# Option 2: install and use the CLI
uv pip install -e .[dev]
qt4-doc-mcp-server
# Health check
curl -s http://127.0.0.1:8000/health

# Build the search index (required for search_documentation tool)
uv run qt4-doc-build-index

# Optional: preconvert all HTML→Markdown into the store for faster reads
uv run qt4-doc-warm-md

# Run tests (ensure TMPDIR points to a writable location when sandboxed)
uv run python -m pytest -q
```

## How It Works (high‑level)
- Offline‑only: no external HTTP fetches; everything reads from `QT_DOC_BASE`.
- HTML→Markdown: focused extraction of main content; normalized internal links;
  attribution appended.
- Markdown store: preconverted pages saved under `.cache/md` (sharded by URL hash)
  for fast reads; in‑memory LRU caches hot pages.
- Search: SQLite FTS5 index (title/headings/body) with BM25 ranking and context snippets.

## MCP Tools

The server provides two MCP tools:

1. **`read_documentation`** - Read and convert a specific Qt documentation page
2. **`search_documentation`** - Search across all Qt 4.8.4 documentation

### Example: read_documentation

Example MCP request/response (trimmed for brevity):

```json
// request
{
  "method": "tools/run",
  "params": {
    "name": "read_documentation",
    "arguments": {
      "url": "https://doc.qt.io/archives/qt-4.8/qstring.html",
      "fragment": "#details",
      "section_only": true,
      "max_length": 2000
    }
  }
}

// response
{
  "result": {
    "title": "QString Class",
    "canonical_url": "https://doc.qt.io/archives/qt-4.8/qstring.html",
    "markdown": "# QString Class\n...",
    "links": [
      {"text": "QStringList", "url": "https://doc.qt.io/archives/qt-4.8/qstringlist.html"}
    ],
    "attribution": "Content © The Qt Company Ltd./Digia — GNU Free Documentation License 1.3",
    "content_info": {
      "total_length": 15234,
      "returned_length": 2000,
      "start_index": 0,
      "truncated": true
    }
  }
}
```

**Note**: The `content_info` field appears when content is paginated or truncated. Use `start_index` and `max_length` parameters to retrieve additional pages. By default, responses are limited to 20,000 characters to avoid exceeding LLM token limits.

### Example: search_documentation

Example MCP request/response for searching:

```json
// request
{
  "method": "tools/run",
  "params": {
    "name": "search_documentation",
    "arguments": {
      "query": "signals slots",
      "limit": 5
    }
  }
}

// response
{
  "result": {
    "query": "signals slots",
    "count": 5,
    "results": [
      {
        "title": "Signals and Slots",
        "url": "https://doc.qt.io/archives/qt-4.8/signalsandslots.html",
        "score": 12.34,
        "context": "…used for communication between objects. <b>Signals</b> and <b>slots</b> mechanism is a central…"
      },
      {
        "title": "QObject Class Reference",
        "url": "https://doc.qt.io/archives/qt-4.8/qobject.html",
        "score": 8.76,
        "context": "…The QObject class supports <b>signals</b> and <b>slots</b> for inter-object communication…"
      }
    ]
  }
}
```

**Notes**:
- Search uses SQLite FTS5 with BM25 ranking for relevance
- Context snippets highlight matching terms with `<b>` tags
- The `limit` parameter controls maximum results (default: 10, max: 50)
- Build the index first with `qt4-doc-build-index` or set `PREINDEX_DOCS=true`

## MCP Client Configuration

The server exposes an HTTP endpoint at `http://127.0.0.1:8000/mcp`. Register it with your preferred MCP-compatible agent using the instructions below.

<details>
<summary><strong>Visual Studio Code (Native MCP Support)</strong></summary>

VS Code has built-in MCP support via GitHub Copilot (requires VS Code 1.102+).

**Using CLI (Quickest):**
```bash
code --add-mcp '{"name":"qt4-docs","type":"http","url":"http://127.0.0.1:8000/mcp"}'
```

**Using Command Palette:**
1. Open Command Palette (`Cmd/Ctrl+Shift+P`)
2. Run `MCP: Open User Configuration` (for global) or `MCP: Open Workspace Folder Configuration` (for project-specific)
3. Add the configuration:
   ```json
   {
     "servers": {
       "qt4-docs": {
         "type": "http",
         "url": "http://127.0.0.1:8000/mcp"
       }
     }
   }
   ```
4. Save the file. VS Code will automatically load the MCP server.

**Manual Configuration:**
Create `.vscode/mcp.json` in your workspace (or `mcp.json` in your user profile directory):
```json
{
  "servers": {
    "qt4-docs": {
      "type": "http",
      "url": "http://127.0.0.1:8000/mcp"
    }
  }
}
```

</details>

<details>
<summary><strong>Claude Code</strong></summary>

Add to Claude Code using the CLI command:

```bash
claude mcp add --transport http qt4-docs http://127.0.0.1:8000/mcp
```

Or configure manually in your Claude Code settings file (`~/.claude.json`):

```json
{
  "mcpServers": {
    "qt4-docs": {
      "type": "http",
      "url": "http://127.0.0.1:8000/mcp"
    }
  }
}
```

</details>

<details>
<summary><strong>Codex CLI</strong></summary>

Add to Codex CLI using the command:

```bash
codex mcp add qt4-docs -- npx -y mcp-client-http http://127.0.0.1:8000/mcp
```

Or configure manually in `~/.codex/config.toml`:

```toml
[mcp_servers.qt4-docs]
command = "npx"
args = ["-y", "mcp-client-http", "http://127.0.0.1:8000/mcp"]
```

**Note:** Codex CLI primarily supports stdio-based MCP servers. The above uses `mcp-client-http` as a bridge for HTTP transport.

</details>

<details>
<summary><strong>Kiro</strong></summary>

Kiro primarily supports stdio-based MCP servers. For HTTP servers, use an HTTP-to-stdio bridge:

1. Create or edit `.kiro/settings/mcp.json` in your workspace:
   ```json
   {
     "mcpServers": {
       "qt4-docs": {
         "command": "npx",
         "args": [
           "-y",
           "mcp-client-http",
           "http://127.0.0.1:8000/mcp"
         ],
         "disabled": false
       }
     }
   }
   ```
2. Save the file and restart Kiro. The Qt 4.8.4 documentation tools will appear in the MCP panel.

**Note:** Direct HTTP transport support in Kiro is limited. The above configuration uses `mcp-client-http` as a bridge to connect to HTTP MCP servers.

</details>

<details>
<summary><strong>Generic MCP Clients</strong></summary>

Most MCP clients use a standard configuration format. For HTTP servers:

```json
{
  "mcpServers": {
    "qt4-docs": {
      "type": "http",
      "url": "http://127.0.0.1:8000/mcp"
    }
  }
}
```

For clients that require a command-based approach with HTTP bridge:

```json
{
  "mcpServers": {
    "qt4-docs": {
      "command": "npx",
      "args": ["-y", "mcp-client-http", "http://127.0.0.1:8000/mcp"]
    }
  }
}
```

</details>

## Deployment
- **Direct (systemd, bare metal, CI runners):**
  - Install with `pip install qt4-doc-mcp-server`.
  - Ensure `.env` points to your Qt docs and writable cache/index directories.
  - Start with `qt4-doc-mcp-server`; add `PRECONVERT_MD=true` for faster first reads.
- **Containerization (roadmap):**
  - Docker support is planned; follow the repository for updates or open an issue if you need it sooner.

## Licensing
- Code: MIT License (see `LICENSE`).
- Qt docs: © The Qt Company Ltd./Digia, licensed under GFDL 1.3. This server
  converts locally obtained docs and includes attribution in outputs. If you
  redistribute a local mirror, include `LICENSE.FDL` and preserve notices.
- See `THIRD_PARTY_NOTICES.md` for more.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "qt4-doc-mcp-server",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "Kevin Tan <jingzheng.tan@gmail.com>",
    "keywords": "c++, documentation, mcp, model-context-protocol, qt4",
    "author": null,
    "author_email": "Kevin Tan <jingzheng.tan@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ed/0b/1828b7a7c4b5982da41088fa57e761284765cb7995f6fdc529725f30b6c1/qt4_doc_mcp_server-0.5.0.tar.gz",
    "platform": null,
    "description": "# Qt 4.8.4 Documentation MCP Server\n\n[![PyPI Version](https://img.shields.io/pypi/v/qt4-doc-mcp-server.svg)](https://pypi.org/project/qt4-doc-mcp-server/)\n[![License](https://img.shields.io/github/license/jztan/qt4-doc-mcp-server.svg)](LICENSE)\n[![Python Version](https://img.shields.io/pypi/pyversions/qt4-doc-mcp-server.svg)](https://pypi.org/project/qt4-doc-mcp-server/)\n[![GitHub Issues](https://img.shields.io/github/issues/jztan/qt4-doc-mcp-server.svg)](https://github.com/jztan/qt4-doc-mcp-server/issues)\n[![CI](https://github.com/jztan/qt4-doc-mcp-server/actions/workflows/pr-tests.yml/badge.svg)](https://github.com/jztan/qt4-doc-mcp-server/actions/workflows/pr-tests.yml)\n\nOffline\u2011only MCP Server that serves Qt 4.8.4 documentation to Agents/LLMs and IDEs.\nIt loads local HTML docs, converts pages to Markdown, and provides fast full\u2011text\nsearch via SQLite FTS5.\n\n## Quickstart\n1. Install the package: `pip install qt4-doc-mcp-server`.\n2. Fetch and stage the Qt docs (one-time): `python scripts/prepare_qt48_docs.py --segments 4`.\n3. Copy `.env` from the script output or create one manually (see table below).\n4. Build the search index: `qt4-doc-build-index` (required for search functionality).\n5. Run the server: `qt4-doc-mcp-server` (or `uv run python -m qt4_doc_mcp_server.main`).\n6. Verify health: `curl -s http://127.0.0.1:8000/health` \u2192 `{ \"status\": \"ok\" }`.\n7. Optional: warm the Markdown cache for faster responses: `qt4-doc-warm-md`.\n\n## Project Structure\n\n```\n.\n\u251c\u2500 README.md                    # Quick start, config, licensing\n\u251c\u2500 LICENSE                      # MIT license for this codebase\n\u251c\u2500 CHANGELOG.md                 # Keep a Changelog (Unreleased + releases)\n\u251c\u2500 THIRD_PARTY_NOTICES.md       # Qt docs and deps licensing notes\n\u251c\u2500 pyproject.toml               # Packaging, deps, console entry points\n\u251c\u2500 scripts/\n\u2502  \u251c\u2500 prepare_qt48_docs.py      # Download, extract, and stage Qt 4.8.4 docs; writes .env\n\u251c\u2500 src/\n\u2502  \u2514\u2500 qt4_doc_mcp_server/\n\u2502     \u251c\u2500 __init__.py            # Package version\n\u2502     \u251c\u2500 main.py                # FastMCP app (+ /health) and CLI run()\n\u2502     \u251c\u2500 config.py              # Env loader (dotenv) + startup checks\n\u2502     \u251c\u2500 tools.py               # MCP tools (read_documentation, search_documentation)\n\u2502     \u251c\u2500 fetcher.py             # Canonical URL + local path mapping\n\u2502     \u251c\u2500 convert.py             # HTML extraction, link normalization, HTML\u2192Markdown\n\u2502     \u251c\u2500 cache.py               # LRU + Markdown store (disk) helpers\n\u2502     \u251c\u2500 doc_service.py         # Read path orchestration (store + convert)\n\u2502     \u251c\u2500 search.py              # FTS5 index build/query with BM25 ranking\n\u2502     \u2514\u2500 cli.py                 # CLI utilities (qt4-doc-warm-md, qt4-doc-build-index)\n\u2514\u2500 tests/                       # pytest suite (e.g., test_doc_service.py)\n```\n\n## Requirements\n- Python 3.11+\n- Local Qt 4.8.4 HTML documentation (see below)\n\n## Get the Qt 4.8.4 Docs\n\n### Prepare Docs with Python helper (recommended)\n\n```\npython scripts/prepare_qt48_docs.py # copy docs by default into ./qt4-docs-html\n```\nOR\n```\npython scripts/prepare_qt48_docs.py --segments 4 # faster download with 4 segments\n```\n\nThis will:\n- Download and extract the Qt 4.8.4 source archive (or reuse if present)\n- Stage the HTML docs at `qt4-docs-html` (symlink by default)\n- Copy `LICENSE.FDL` next to the docs\n- Create/update `.env` with `QT_DOC_BASE` and sensible defaults\n\n\n\n## Configure (dotenv)\nCreate a `.env` file in the repo root. The helper script writes sensible defaults; adjust as needed:\n\n| Variable | Default | Purpose |\n| --- | --- | --- |\n| `QT_DOC_BASE` | _required_ | Absolute path to the Qt 4.8.4 HTML docs (`.../doc/html`). |\n| `INDEX_DB_PATH` | `.index/fts.sqlite` | Location of the SQLite FTS5 search index. |\n| `MD_CACHE_DIR` | `.cache/md` | Directory for cached Markdown blobs + metadata. |\n| `PREINDEX_DOCS` | `true` | Build search index automatically at startup if not present. |\n| `PRECONVERT_MD` | `true` | Warm the Markdown cache automatically at startup. |\n| `SERVER_HOST` | `127.0.0.1` | Bind address for the FastMCP server (`0.0.0.0` for containers). |\n| `SERVER_PORT` | `8000` | TCP port for streamable HTTP transport. |\n| `MCP_LOG_LEVEL` | `WARNING` | Logging verbosity (DEBUG/INFO/WARNING/ERROR). |\n| `MD_CACHE_SIZE` | `512` | In-memory CachedDoc LRU capacity (counts pages). |\n| `DEFAULT_MAX_MARKDOWN_LENGTH` | `20000` | Default maximum characters returned per request (prevents token limit issues). |\n\n## Dev Setup and Run\n```\nuv venv .venv && source .venv/bin/activate\n\n# Option 1: run without installing the package (dev-only)\n# Using uv to run the module directly\nuv run python -m qt4_doc_mcp_server.main\n\n# Option 2: install and use the CLI\nuv pip install -e .[dev]\nqt4-doc-mcp-server\n# Health check\ncurl -s http://127.0.0.1:8000/health\n\n# Build the search index (required for search_documentation tool)\nuv run qt4-doc-build-index\n\n# Optional: preconvert all HTML\u2192Markdown into the store for faster reads\nuv run qt4-doc-warm-md\n\n# Run tests (ensure TMPDIR points to a writable location when sandboxed)\nuv run python -m pytest -q\n```\n\n## How It Works (high\u2011level)\n- Offline\u2011only: no external HTTP fetches; everything reads from `QT_DOC_BASE`.\n- HTML\u2192Markdown: focused extraction of main content; normalized internal links;\n  attribution appended.\n- Markdown store: preconverted pages saved under `.cache/md` (sharded by URL hash)\n  for fast reads; in\u2011memory LRU caches hot pages.\n- Search: SQLite FTS5 index (title/headings/body) with BM25 ranking and context snippets.\n\n## MCP Tools\n\nThe server provides two MCP tools:\n\n1. **`read_documentation`** - Read and convert a specific Qt documentation page\n2. **`search_documentation`** - Search across all Qt 4.8.4 documentation\n\n### Example: read_documentation\n\nExample MCP request/response (trimmed for brevity):\n\n```json\n// request\n{\n  \"method\": \"tools/run\",\n  \"params\": {\n    \"name\": \"read_documentation\",\n    \"arguments\": {\n      \"url\": \"https://doc.qt.io/archives/qt-4.8/qstring.html\",\n      \"fragment\": \"#details\",\n      \"section_only\": true,\n      \"max_length\": 2000\n    }\n  }\n}\n\n// response\n{\n  \"result\": {\n    \"title\": \"QString Class\",\n    \"canonical_url\": \"https://doc.qt.io/archives/qt-4.8/qstring.html\",\n    \"markdown\": \"# QString Class\\n...\",\n    \"links\": [\n      {\"text\": \"QStringList\", \"url\": \"https://doc.qt.io/archives/qt-4.8/qstringlist.html\"}\n    ],\n    \"attribution\": \"Content \u00a9 The Qt Company Ltd./Digia \u2014 GNU Free Documentation License 1.3\",\n    \"content_info\": {\n      \"total_length\": 15234,\n      \"returned_length\": 2000,\n      \"start_index\": 0,\n      \"truncated\": true\n    }\n  }\n}\n```\n\n**Note**: The `content_info` field appears when content is paginated or truncated. Use `start_index` and `max_length` parameters to retrieve additional pages. By default, responses are limited to 20,000 characters to avoid exceeding LLM token limits.\n\n### Example: search_documentation\n\nExample MCP request/response for searching:\n\n```json\n// request\n{\n  \"method\": \"tools/run\",\n  \"params\": {\n    \"name\": \"search_documentation\",\n    \"arguments\": {\n      \"query\": \"signals slots\",\n      \"limit\": 5\n    }\n  }\n}\n\n// response\n{\n  \"result\": {\n    \"query\": \"signals slots\",\n    \"count\": 5,\n    \"results\": [\n      {\n        \"title\": \"Signals and Slots\",\n        \"url\": \"https://doc.qt.io/archives/qt-4.8/signalsandslots.html\",\n        \"score\": 12.34,\n        \"context\": \"\u2026used for communication between objects. <b>Signals</b> and <b>slots</b> mechanism is a central\u2026\"\n      },\n      {\n        \"title\": \"QObject Class Reference\",\n        \"url\": \"https://doc.qt.io/archives/qt-4.8/qobject.html\",\n        \"score\": 8.76,\n        \"context\": \"\u2026The QObject class supports <b>signals</b> and <b>slots</b> for inter-object communication\u2026\"\n      }\n    ]\n  }\n}\n```\n\n**Notes**:\n- Search uses SQLite FTS5 with BM25 ranking for relevance\n- Context snippets highlight matching terms with `<b>` tags\n- The `limit` parameter controls maximum results (default: 10, max: 50)\n- Build the index first with `qt4-doc-build-index` or set `PREINDEX_DOCS=true`\n\n## MCP Client Configuration\n\nThe server exposes an HTTP endpoint at `http://127.0.0.1:8000/mcp`. Register it with your preferred MCP-compatible agent using the instructions below.\n\n<details>\n<summary><strong>Visual Studio Code (Native MCP Support)</strong></summary>\n\nVS Code has built-in MCP support via GitHub Copilot (requires VS Code 1.102+).\n\n**Using CLI (Quickest):**\n```bash\ncode --add-mcp '{\"name\":\"qt4-docs\",\"type\":\"http\",\"url\":\"http://127.0.0.1:8000/mcp\"}'\n```\n\n**Using Command Palette:**\n1. Open Command Palette (`Cmd/Ctrl+Shift+P`)\n2. Run `MCP: Open User Configuration` (for global) or `MCP: Open Workspace Folder Configuration` (for project-specific)\n3. Add the configuration:\n   ```json\n   {\n     \"servers\": {\n       \"qt4-docs\": {\n         \"type\": \"http\",\n         \"url\": \"http://127.0.0.1:8000/mcp\"\n       }\n     }\n   }\n   ```\n4. Save the file. VS Code will automatically load the MCP server.\n\n**Manual Configuration:**\nCreate `.vscode/mcp.json` in your workspace (or `mcp.json` in your user profile directory):\n```json\n{\n  \"servers\": {\n    \"qt4-docs\": {\n      \"type\": \"http\",\n      \"url\": \"http://127.0.0.1:8000/mcp\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><strong>Claude Code</strong></summary>\n\nAdd to Claude Code using the CLI command:\n\n```bash\nclaude mcp add --transport http qt4-docs http://127.0.0.1:8000/mcp\n```\n\nOr configure manually in your Claude Code settings file (`~/.claude.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"qt4-docs\": {\n      \"type\": \"http\",\n      \"url\": \"http://127.0.0.1:8000/mcp\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><strong>Codex CLI</strong></summary>\n\nAdd to Codex CLI using the command:\n\n```bash\ncodex mcp add qt4-docs -- npx -y mcp-client-http http://127.0.0.1:8000/mcp\n```\n\nOr configure manually in `~/.codex/config.toml`:\n\n```toml\n[mcp_servers.qt4-docs]\ncommand = \"npx\"\nargs = [\"-y\", \"mcp-client-http\", \"http://127.0.0.1:8000/mcp\"]\n```\n\n**Note:** Codex CLI primarily supports stdio-based MCP servers. The above uses `mcp-client-http` as a bridge for HTTP transport.\n\n</details>\n\n<details>\n<summary><strong>Kiro</strong></summary>\n\nKiro primarily supports stdio-based MCP servers. For HTTP servers, use an HTTP-to-stdio bridge:\n\n1. Create or edit `.kiro/settings/mcp.json` in your workspace:\n   ```json\n   {\n     \"mcpServers\": {\n       \"qt4-docs\": {\n         \"command\": \"npx\",\n         \"args\": [\n           \"-y\",\n           \"mcp-client-http\",\n           \"http://127.0.0.1:8000/mcp\"\n         ],\n         \"disabled\": false\n       }\n     }\n   }\n   ```\n2. Save the file and restart Kiro. The Qt 4.8.4 documentation tools will appear in the MCP panel.\n\n**Note:** Direct HTTP transport support in Kiro is limited. The above configuration uses `mcp-client-http` as a bridge to connect to HTTP MCP servers.\n\n</details>\n\n<details>\n<summary><strong>Generic MCP Clients</strong></summary>\n\nMost MCP clients use a standard configuration format. For HTTP servers:\n\n```json\n{\n  \"mcpServers\": {\n    \"qt4-docs\": {\n      \"type\": \"http\",\n      \"url\": \"http://127.0.0.1:8000/mcp\"\n    }\n  }\n}\n```\n\nFor clients that require a command-based approach with HTTP bridge:\n\n```json\n{\n  \"mcpServers\": {\n    \"qt4-docs\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-client-http\", \"http://127.0.0.1:8000/mcp\"]\n    }\n  }\n}\n```\n\n</details>\n\n## Deployment\n- **Direct (systemd, bare metal, CI runners):**\n  - Install with `pip install qt4-doc-mcp-server`.\n  - Ensure `.env` points to your Qt docs and writable cache/index directories.\n  - Start with `qt4-doc-mcp-server`; add `PRECONVERT_MD=true` for faster first reads.\n- **Containerization (roadmap):**\n  - Docker support is planned; follow the repository for updates or open an issue if you need it sooner.\n\n## Licensing\n- Code: MIT License (see `LICENSE`).\n- Qt docs: \u00a9 The Qt Company Ltd./Digia, licensed under GFDL 1.3. This server\n  converts locally obtained docs and includes attribution in outputs. If you\n  redistribute a local mirror, include `LICENSE.FDL` and preserve notices.\n- See `THIRD_PARTY_NOTICES.md` for more.\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "Offline MCP Server for Qt 4.8.4 documentation",
    "version": "0.5.0",
    "project_urls": {
        "Changelog": "https://github.com/jztan/qt4-doc-mcp-server/blob/master/CHANGELOG.md",
        "Homepage": "https://github.com/jztan/qt4-doc-mcp-server",
        "Issues": "https://github.com/jztan/qt4-doc-mcp-server/issues",
        "Repository": "https://github.com/jztan/qt4-doc-mcp-server.git"
    },
    "split_keywords": [
        "c++",
        " documentation",
        " mcp",
        " model-context-protocol",
        " qt4"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a77332152559852ae5b7707ccb6fba401f0763fb745e63bbfd2e413c8698d812",
                "md5": "c4b25563c6176723d26632182e5d214e",
                "sha256": "9c54e5754b539671492233819543c5e197cb7d126034c3e5e054a66847861c0a"
            },
            "downloads": -1,
            "filename": "qt4_doc_mcp_server-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c4b25563c6176723d26632182e5d214e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 25282,
            "upload_time": "2025-10-26T01:19:14",
            "upload_time_iso_8601": "2025-10-26T01:19:14.759351Z",
            "url": "https://files.pythonhosted.org/packages/a7/73/32152559852ae5b7707ccb6fba401f0763fb745e63bbfd2e413c8698d812/qt4_doc_mcp_server-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ed0b1828b7a7c4b5982da41088fa57e761284765cb7995f6fdc529725f30b6c1",
                "md5": "a78e7d163c0d3d9e483811ef82420ec2",
                "sha256": "d8472f81d71072f020cb0d306eb1176f88c3273c4dac8fbdf0df0e7e80596c73"
            },
            "downloads": -1,
            "filename": "qt4_doc_mcp_server-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a78e7d163c0d3d9e483811ef82420ec2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 28773,
            "upload_time": "2025-10-26T01:19:15",
            "upload_time_iso_8601": "2025-10-26T01:19:15.559034Z",
            "url": "https://files.pythonhosted.org/packages/ed/0b/1828b7a7c4b5982da41088fa57e761284765cb7995f6fdc529725f30b6c1/qt4_doc_mcp_server-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-26 01:19:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jztan",
    "github_project": "qt4-doc-mcp-server",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "qt4-doc-mcp-server"
}
        
Elapsed time: 3.38004s