Hardware Manual RAG MCP Server
Enables querying hardware manuals (PDF/HTML) using local RAG with ChromaDB and embeddings, allowing Claude Code to look up pinouts, registers, and specifications.
README
Hardware Manual RAG MCP Server
A Model Context Protocol (MCP) server that provides Local RAG (Retrieval-Augmented Generation) over hardware manuals (PDF & HTML). It indexes your manuals into ChromaDB using local embeddings and exposes a query_hardware_manual tool so Claude Code can look up pinouts, registers, schematics, and other hardware specifications — all running locally inside a Docker container.
How It Works
Your PDF/HTML Manuals → Docker Container → ChromaDB (vectors) → Claude Code via MCP
- Files are parsed and chunked into 800-character overlapping segments
- Each chunk is embedded with
all-MiniLM-L6-v2(local, no API key needed) - Incremental indexing: only new or changed files are re-indexed on restart
- Vectors persist on a Docker named volume so 20+ MB of manuals aren't re-indexed every time
Prerequisites
- Docker & Docker Compose installed
- Claude Code (or any MCP-compatible client)
- At least ~2 GB free disk space (for Docker image + embedding model + vector store)
Option 1: Pull from GitHub Container Registry (GHCR)
The Docker image is published to GHCR. You don't need to clone the repo.
# Pull the latest image
docker pull ghcr.io/YOUR_ORG/hum_mcp:latest
Then use the docker-compose override below to use the prebuilt image.
docker-compose.prod.yml
Create a docker-compose.prod.yml file:
services:
hardware-mcp:
image: ghcr.io/YOUR_ORG/hum_mcp:latest
pull_policy: always
container_name: hardware-mcp
restart: unless-stopped
init: true
volumes:
- ./manuals_repo:/app/manuals:ro
- chroma_data:/app/chroma_db
environment:
- PYTHONUNBUFFERED=1
volumes:
chroma_data:
Replace
YOUR_ORGwith your GitHub username or organization name.
Start it:
docker compose -f docker-compose.prod.yml up -d
Option 2: Build from Source
Clone and build locally:
git clone https://github.com/YOUR_ORG/hum_mcp.git
cd hum_mcp
# Build and start the container
docker compose up -d --build
Setup
1. Place Your Hardware Manuals
Copy your PDF or HTML hardware manuals into the manuals_repo/ directory:
# Linux / macOS
cp ~/Downloads/stm32f4-datasheet.pdf ./manuals_repo/
cp ~/Downloads/esp32-technical-reference.html ./manuals_repo/
# Windows (PowerShell)
Copy-Item ~\Downloads\stm32f4-datasheet.pdf .\manuals_repo\
Supported formats: .pdf, .html, .htm
2. Start the Container
docker compose up -d
On first start, the container will:
- Download the embedding model (~80 MB,
all-MiniLM-L6-v2) — one time only - Index all manuals in
manuals_repo/into ChromaDB - Log progress to Docker logs
3. Verify It's Running
# Check container status
docker ps --filter name=hardware-mcp
# View indexing logs
docker logs hardware-mcp
Look for a line like:
Indexing complete: 2 file(s) indexed, 0 skipped, 45 total chunks in collection
Server ready — 45 total chunks available
Runtime Usage
Connect Claude Code
Add this to your MCP configuration file:
macOS / Linux: ~/.config/claude/config.json
Windows: %APPDATA%\Claude\config.json
{
"mcpServers": {
"hardware-manual-server": {
"command": "docker",
"args": ["exec", "-i", "hardware-mcp", "python", "-m", "mcp", "run", "src/server.py"]
}
}
}
Restart Claude Code after saving. You should see a tools icon appear indicating the MCP server is connected.
Query Your Manuals
Once connected, Claude Code can answer hardware questions by calling query_hardware_manual. Simply ask questions like:
- "What is the pinout for the STM32F407 SPI1 interface?"
- "What are the electrical characteristics of GPIO pins at 3.3V?"
- "Show me the register map for the UART control registers"
- "What is the maximum clock frequency for the ESP32-S3?"
The tool returns the top 5 most relevant chunks with source filenames and relevance scores.
Adding or Updating Manuals
- Add/update files in
manuals_repo/ - Restart the container:
docker compose restart
Only new or changed files are re-indexed — existing chunks are preserved.
Removing Manuals
- Delete the file from
manuals_repo/ - Restart the container — orphaned chunks are automatically cleaned up:
docker compose restart
Useful Commands
| Command | Description |
|---|---|
docker compose up -d |
Start the container (detached) |
docker compose down |
Stop and remove the container (vector data persists) |
docker compose restart |
Restart to pick up new/changed manuals |
docker compose down -v |
Destroy everything including the vector database |
docker logs hardware-mcp |
View server logs |
docker logs hardware-mcp -f |
Follow logs in real time |
docker exec -it hardware-mcp ls /app/manuals |
List indexed manuals inside the container |
docker compose build --no-cache |
Rebuild the image from scratch |
Project Structure
hum_mcp/
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── manuals_repo/ # ← Put your PDF/HTML manuals here
│ └── README.txt
├── src/
│ ├── __init__.py
│ └── server.py # Main application
└── .github/
└── workflows/
└── docker-build.yml
Troubleshooting
"No hardware manuals have been indexed yet"
Place at least one .pdf or .html file in manuals_repo/ and run docker compose restart.
"Error querying hardware manuals: …"
Check the logs for details: docker logs hardware-mcp
Container keeps restarting
This typically means the embedding model failed to download. Check your internet connection and retry:
docker compose down -v
docker compose up -d
Scanned PDFs (image-only) don't produce results
pypdf cannot extract text from scanned/image-based PDFs. Use OCR software to create text-searchable PDFs first, or convert them to HTML.
Slow first startup
The embedding model (~80 MB) is downloaded on first run. Subsequent starts are fast.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。