Qt4 Documentation MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Qt4 Documentation MCP ServerSearch Qt 4.8.4 docs for QObject"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Qt Documentation MCP Server
mcp-name: io.github.jztan/qt4-doc-mcp-server
Bring locally installed Qt 4.8, Qt 5, or Qt 6 documentation to your AI coding assistant. Works offline with one selected documentation set at a time.
Tool Reference | Changelog | Contributing | Troubleshooting
Related MCP server: MCP Local Context
✨ Features
🔌 Offline-First - Works entirely with local documentation
🔍 Full-Text Search - Find what you need across all Qt docs
⚡ Smart Caching - Fast responses for repeated queries
🎯 Fragment Support - Extract specific sections when needed
🛠️ MCP Standard - Compatible with Claude, VS Code, and other MCP clients
📦 Prerequisites
Python 3.11+ required (not needed when using the Docker image)
Qt HTML Documentation for one supported release (Qt 4.8, Qt 5, or Qt 6)
The included helper downloads Qt 4.8.4 only.
Point
QT_DOC_BASEdirectly at an existing Qt 5/6 offline documentation root.
~500MB disk space for docs + cache + search index
SQLite with FTS5 support (included in Python 3.11+ by default)
🚀 Installation
From PyPI (Recommended)
pip install qt4-doc-mcp-serverFrom Source
git clone https://github.com/jztan/qt4-doc-mcp-server.git
cd qt4-doc-mcp-server
uv sync --lockedSetup Qt Documentation
# Automated setup (recommended, requires the cloned repo)
python scripts/prepare_qt48_docs.py --segments 4
# This will:
# - Download Qt 4.8.4 source archive
# - Extract HTML documentation
# - Create .env with sensible defaults
# - Copy GFDL license fileThe helper script ships with the repo, not the PyPI package. Installed from PyPI only? Download the docs manually instead:
curl -LO https://download.qt.io/archive/qt/4.8/4.8.4/qt-everywhere-opensource-src-4.8.4.tar.gz
tar -xzf qt-everywhere-opensource-src-4.8.4.tar.gz qt-everywhere-opensource-src-4.8.4/doc/html
mv qt-everywhere-opensource-src-4.8.4/doc/html ./qt4-docs-htmlThen create a .env with QT_DOC_BASE pointing at that directory (see Configuration below).
Quick Start Commands
# 1. Install
pip install qt4-doc-mcp-server
# 2. Setup Qt docs
python scripts/prepare_qt48_docs.py --segments 4
# 3. Build search index (optional; the server builds it on first start)
qt-doc-build-index
# 4. Start server
qt-doc-mcp
# 5. Verify health
curl -s http://127.0.0.1:8000/healthThe legacy qt4-doc-mcp-server command remains available as an alias for existing client configurations.
Agent-friendly FTS CLI
After building the index, agents can search and receive materialized absolute Markdown paths:
qt-doc-cli "accessible applications" --limit 5The command reads the same .env settings as the server. Before searching, it automatically builds a missing/outdated FTS index and fully warms an incomplete Markdown cache. It then prints each result's title, absolute .md path, and FTS snippet to stdout; preparation messages, errors, and warnings go to stderr. Use qt-doc-warm-md --force after changing documentation in place.
🐳 Docker
Prebuilt multi-arch images (amd64/arm64) are published to GitHub Container Registry on every release. The container is offline-only: you mount your prepared Qt doc/html directory read-only at /docs, and all derived state (Markdown cache and search index) lives in a volume at /data.
# Prepare Qt docs on the host first (one-time, writes to ./qt4-docs-html)
python scripts/prepare_qt48_docs.py --segments 4
# Run from GHCR
docker run -d --name qt4-doc-mcp-server -p 8000:8000 \
-v "$PWD/qt4-docs-html:/docs:ro" \
-v qt4-doc-data:/data \
ghcr.io/jztan/qt4-doc-mcp-server:latest
# Verify
curl -s http://127.0.0.1:8000/healthUsing only the published image, without cloning this repo? Download the Qt 4.8.4 docs directly instead of running the prepare script:
curl -LO https://download.qt.io/archive/qt/4.8/4.8.4/qt-everywhere-opensource-src-4.8.4.tar.gz
tar -xzf qt-everywhere-opensource-src-4.8.4.tar.gz qt-everywhere-opensource-src-4.8.4/doc/html
mv qt-everywhere-opensource-src-4.8.4/doc/html ./qt4-docs-htmlAny existing Qt 5 or Qt 6 doc/html tree (from the Qt installer or distro documentation packages) works as the mount source too.
First start converts and indexes the documentation into the /data volume; subsequent starts reuse it. Depending on the docset size, the first start can take a minute or two before the health endpoint responds.
Docker Compose
With docs in the default ./qt4-docs-html location, no configuration is needed:
docker compose up -dFor docs elsewhere (including Qt 5 or Qt 6 doc/html trees, which the server also supports), point QT_DOC_HTML_PATH at them. If port 8000 is taken on the host, set HOST_PORT in the same file (with plain docker run, change the left side of -p instead):
cp .env.docker.example .env.docker # set QT_DOC_HTML_PATH
docker compose --env-file .env.docker up -dOr use the convenience script, which checks Docker is running, creates .env.docker on first run, builds and starts the service, and waits for the health endpoint:
./deploy.shPoint your MCP client at http://127.0.0.1:8000/mcp (streamable HTTP). Qt documentation is licensed under GFDL 1.3; the container serves your local copy and never redistributes it.
⚙️ Configuration
These settings apply to native (pip or source) runs. In Docker they are already set inside the container (QT_DOC_BASE=/docs, QT_DOC_STATE_DIR=/data, SERVER_HOST=0.0.0.0); the QT_DOC_HTML_PATH variable in .env.docker is not a server setting, just the host path mounted at /docs.
Create a .env file in the repo root. The helper script writes sensible defaults; adjust as needed:
Variable | Default | Purpose |
| required | Absolute path to one Qt 4.8, Qt 5, or Qt 6 HTML documentation root. The server detects the active docset. |
|
| Optional writable directory for the FTS index and Markdown cache. Use this when the documentation root is read-only. |
|
| Build search index automatically at startup if not present. |
|
| Warm the Markdown cache automatically at MCP startup. |
|
| Bind address for the FastMCP server ( |
|
| TCP port for streamable HTTP transport. |
|
| Logging verbosity (DEBUG/INFO/WARNING/ERROR). |
|
| In-memory CachedDoc LRU capacity (counts pages). |
|
| Default maximum characters returned per request (prevents token limit issues). |
The tools identify documents by their exact root-relative Markdown path, not an online URL. For example, use qcompleter.md for a Qt 4 page, qtdoc/accessible.md for a Qt 5/6 global page, or qtcore/qobject.md for a Qt 5/6 Core page. By default, each docset stores its own index and Markdown cache under $QT_DOC_BASE/.index/, so switching QT_DOC_BASE reuses its existing derived state. Set QT_DOC_STATE_DIR to relocate both to a writable directory. The Markdown cache mirrors the documentation tree: for example, qtcore/qobject.md is cached as .index/md/qtcore/qobject.md plus qobject.meta.json with the default state directory.
🔌 MCP Client Setup
By default, 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.
Stdio transport
Run the server over stdio instead of HTTP with:
qt-doc-mcp --transport stdioFor stdio-only MCP clients, configure that command with args: ["--transport", "stdio"]. Startup indexing and Markdown-cache progress are written to stderr, leaving stdout exclusively for MCP protocol messages.
VS Code has built-in MCP support via GitHub Copilot (requires VS Code 1.102+).
Using CLI (Quickest):
code --add-mcp '{"name":"qt-docs","type":"http","url":"http://127.0.0.1:8000/mcp"}'Using Command Palette:
Open Command Palette (
Cmd/Ctrl+Shift+P)Run
MCP: Open User Configuration(for global) orMCP: Open Workspace Folder Configuration(for project-specific)Add the configuration:
{ "servers": { "qt-docs": { "type": "http", "url": "http://127.0.0.1:8000/mcp" } } }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):
{
"servers": {
"qt-docs": {
"type": "http",
"url": "http://127.0.0.1:8000/mcp"
}
}
}Add to Claude Code using the CLI command:
claude mcp add --transport http qt-docs http://127.0.0.1:8000/mcpOr configure manually in your Claude Code settings file (~/.claude.json):
{
"mcpServers": {
"qt-docs": {
"type": "http",
"url": "http://127.0.0.1:8000/mcp"
}
}
}Add to Codex CLI using the command:
codex mcp add qt-docs -- npx -y mcp-client-http http://127.0.0.1:8000/mcpOr configure manually in ~/.codex/config.toml:
[mcp_servers.qt-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.
Kiro primarily supports stdio-based MCP servers. For HTTP servers, use an HTTP-to-stdio bridge:
Create or edit
.kiro/settings/mcp.jsonin your workspace:{ "mcpServers": { "qt-docs": { "command": "npx", "args": [ "-y", "mcp-client-http", "http://127.0.0.1:8000/mcp" ], "disabled": false } } }Save the file and restart Kiro. The active Qt 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.
Most MCP clients use a standard configuration format. For HTTP servers:
{
"mcpServers": {
"qt-docs": {
"type": "http",
"url": "http://127.0.0.1:8000/mcp"
}
}
}For clients that require a command-based approach with HTTP bridge:
{
"mcpServers": {
"qt-docs": {
"command": "npx",
"args": ["-y", "mcp-client-http", "http://127.0.0.1:8000/mcp"]
}
}
}🛠️ Available Tools
The server provides 2 MCP tools for working with the active local Qt documentation set:
read_documentation- Read and convert pages from the active Qt documentation set to MarkdownFragment extraction (
#details,#public-functions)Pagination with
start_indexandmax_lengthSection-only mode for targeted content
Returns Markdown with normalized links and GFDL attribution
search_documentation- Full-text search across the active Qt documentation setSQLite FTS5 with BM25 relevance ranking
Context snippets with highlighted matches
Configurable result limits (default: 10, max: 50)
For detailed API documentation including parameters, return values, examples, and error handling, see the Tool Reference.
📚 Related Resources
📄 License
Code: MIT License (see
LICENSE).Qt Documentation: © The Qt Company Ltd. and contributors, licensed under GFDL 1.3. This server converts locally obtained docs and includes attribution in outputs. If you redistribute a local mirror, include
LICENSE.FDLand preserve notices.See
THIRD_PARTY_NOTICES.mdfor more details.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceAn MCP server that provides full-text search over documentation using Whoosh, enabling AI assistants to find up-to-date, authoritative answers.MIT
- Alicense-qualityDmaintenanceA simple MCP server for local documentation with RAG capabilities, enabling AI assistants to access and search local documents.2MIT
- Alicense-qualityAmaintenanceProvides a local MCP server for searching and retrieving documentation from 22+ open-source projects, enabling AI coding assistants to access up-to-date docs without network dependency.202MIT
- Alicense-qualityBmaintenanceAn MCP server that gives AI coding assistants access to up-to-date API documentation via RAG by crawling documentation sites, indexing them into a vector store, and enabling semantic queries.MIT
Related MCP Connectors
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
An MCP server that gives your AI access to the source code and docs of all public github repos
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jztan/qt4-doc-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server