Electronics Docs MCP Server
Provides LLMs with direct access to official vendor PDF documentation for electronics components (TI, ST, ADI) via a local SQLite full-text index and PDF retrieval tools.
README
Electronics Docs MCP Server
An MCP (Model Context Protocol) server that gives LLMs direct access to official vendor PDF documentation (Texas Instruments, STMicroelectronics, and Analog Devices), with a local SQLite full-text index (FTS5 + BM25) so answers can be grounded in real datasheet and TRM text.
Tools
| Tool | Role |
|---|---|
**lookup_doc** |
Part + question: FTS on the local index only; if no match, returns suggestedDocuments (links from the vendor site). Does not download PDFs — use read_doc next. |
search_docs |
List PDF links for a part (metadata only). |
**read_doc** |
Index a PDF by direct URL — use for /lit/ds/symlink/....pdf and any link the user already has. Optional part / title. |
query_doc_content |
BM25 search; each hit includes **docUrl** and **pageNum**. |
**read_doc_page** |
Full indexed text for page or page range (docUrl from search results). |
When to use: lookup for index check + suggested URLs; **read_doc** to index; **read_doc_page** after query_doc_content when you need full page text. TI symlink datasheets often need read_doc directly. See [src/resources/tool-usage-guide.md](src/resources/tool-usage-guide.md).
MCP resources
| URI | Content |
|---|---|
electronics-docs://guide/tool-usage |
Markdown guide: when to use each tool, how to phrase queries, limits. Source: [src/resources/tool-usage-guide.md](src/resources/tool-usage-guide.md). |
The server advertises **instructions** on initialize pointing agents to this resource.
Cursor skill (optional)
Project skills: electronics-docs-mcp, electronics-docs-mcp-ti, electronics-docs-mcp-st, electronics-docs-mcp-adi. Copy to ~/.cursor/skills/ if you want them globally.
Supported vendors
| Vendor ID | Name | Status |
|---|---|---|
TI |
Texas Instruments | Supported |
ST |
STMicroelectronics | Supported |
ADI |
Analog Devices | Supported |
Recent changes (server v2.7.x)
- Analog Devices (
ADI): NewAnalogDevicesProvider— PDF discovery fromanalog.com/en/products/<slug>.html, slug fallbacks on 404,lookup_docfilters PCN andmds.analog.comfrom suggestions only; same MCP tools as TI/ST. - Vendor list: Supported vendors are derived from the
vendorsmap inmcpServerFactory.ts(includinglist_indexed_documentsvalidation). Tool schemas list all supported IDs. - STMicroelectronics (
ST): Removed the blind “canonical datasheet” URL fallback that could suggestst.com/.../datasheet/<slug>.pdffor non‑ST parts. Legacy DB rows matching that synthetic pattern are skipped when mergingsearch_docsresults. - PDF download (
read_doc): Retries on transient errors (502/503/504, timeouts, etc.); longer default timeout foranalog.com;Accept-Languageon Analog PDF requests;Refererfor native fetch chosen by host (analog.com,ti.com,st.com).
Adding a new vendor (hot plug)
- Create
src/providers/YourVendorProvider.tsextendingVendorProvider. - Implement
searchDocs,readDoc,queryContent, and optionally override**lookupDoc**and**getDocumentPageText**for orchestrated behavior and page reads. - Register the provider in
[src/mcpServerFactory.ts](src/mcpServerFactory.ts)undervendors(supported vendor IDs and tool descriptions follow this map automatically). - Rebuild:
npm run buildand restart the MCP process.
Development
npm install
npm run build # compiles TS → build/ and copies src/resources/*.md to build/resources/
npm start # stdio MCP server (for Cursor / Claude Desktop)
npm run start:http # HTTP MCP server on port 3000 (for network / remote use)
Transport modes
This server supports two transports that share identical tools and resources:
| Mode | Entry point | Transport | Use case |
|---|---|---|---|
| stdio | src/index.ts |
StdioServerTransport |
Cursor, Claude Desktop (local) |
| HTTP | src/server-http.ts |
StreamableHTTPServerTransport (stateless) |
LAN testing, remote deployment, multi-client |
The shared logic lives in src/mcpServerFactory.ts — both entry points call createMcpServer().
stdio mode (local — Cursor / Claude Desktop)
How "local" works
This server speaks MCP over stdio, not HTTP. The IDE spawns node …/build/index.js (or Docker with -i) and talks to the process over pipes. There is nothing to "open in the browser"; exposure = registering the command in Cursor / Claude so they start the binary for each session.
The SQLite index lives at ~/.electronics-docs-mcp/docs.db on the host (or /root/.electronics-docs-mcp/ inside Linux containers unless you mount a volume).
Cursor MCP config (Node — recommended)
Use an absolute path to build/index.js. Adjust the drive/path for your machine.
{
"mcpServers": {
"electronics-docs": {
"command": "node",
"args": ["D:/Projects Cursor/mcp-docs/build/index.js"]
}
}
}
After editing MCP settings, reload the window or restart the MCP server so it picks up rebuilds.
Cursor MCP config (Docker)
Build the image first (npm run build is required so build/ exists before docker build).
npm run build
docker build -t electronics-docs-mcp .
Cursor runs the container with -i so stdin stays open for the stdio protocol. Persist the index on a named volume (maps to /root/.electronics-docs-mcp in the image):
{
"mcpServers": {
"electronics-docs": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "electronics-docs-mcp-data:/root/.electronics-docs-mcp",
"electronics-docs-mcp"
]
}
}
}
On first run Docker creates the volume electronics-docs-mcp-data. To reset the index: remove the volume (docker volume rm electronics-docs-mcp-data) or delete docs.db inside it.
Claude Desktop
Same command / args as Cursor in claude_desktop_config.json (e.g. %APPDATA%\Claude on Windows).
HTTP mode (LAN / remote)
The HTTP server exposes the same MCP tools and resources over MCP Streamable HTTP (POST /mcp).
Each request is fully independent — no session state is kept in memory.
Quick start
# Development (tsx, auto-reload)
npm run start:http
# Production (compiled)
npm run build
npm run start:http:prod
Default: http://0.0.0.0:3000/mcp
Environment variables
| Variable | Default | Description |
|---|---|---|
PORT |
3000 |
TCP port to listen on |
HOST |
0.0.0.0 |
Interface to bind (127.0.0.1 for local-only) |
MCP_AUTH_TOKEN |
(unset) | When set, all requests must carry Authorization: Bearer <token> |
Health check
curl http://localhost:3000/health
# {"status":"ok","server":"electronics-docs-mcp","version":"2.7.0"}
Test a tool call (curl)
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}'
With auth token:
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer mysecret" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Cursor mcp.json (remote Streamable HTTP)
Cursor reads MCP settings from a JSON file at the user level (not per-project):
| OS | Path |
|---|---|
| Windows | %USERPROFILE%\.cursor\mcp.json — e.g. C:\Users\YourName\.cursor\mcp.json |
| macOS / Linux | ~/.cursor/mcp.json |
Merge the block below into the top-level "mcpServers" object (alongside any other servers you already use).
Required fields for this server
| Field | Value |
|---|---|
type |
"streamableHttp" — tells Cursor to use the Streamable HTTP MCP client (POST to /mcp). Without it, the client may POST to / and you get Cannot POST /. |
url |
Full URL ending in /mcp — e.g. http://192.168.1.100:3000/mcp or https://your-subdomain.trycloudflare.com/mcp. Do not use only the origin (https://host/) or Cursor will target / instead of /mcp. |
headers (optional) |
Only if the server was started with MCP_AUTH_TOKEN. Use Authorization": "Bearer YOUR_TOKEN" — the word Bearer plus a space before the secret is required; the server compares the token after Bearer to MCP_AUTH_TOKEN. |
Example — LAN (no auth on server)
{
"mcpServers": {
"electronics-docs-remote": {
"type": "streamableHttp",
"url": "http://192.168.1.100:3000/mcp"
}
}
}
Example — LAN or tunnel with MCP_AUTH_TOKEN
{
"mcpServers": {
"electronics-docs-remote": {
"type": "streamableHttp",
"url": "http://192.168.1.100:3000/mcp",
"headers": {
"Authorization": "Bearer YOUR_SECRET_TOKEN"
}
}
}
}
Example — Cloudflare quick tunnel (cloudflared tunnel --url http://localhost:3000)
The printed URL must include /mcp. Quick tunnels get a new *.trycloudflare.com hostname each run — update url whenever you restart cloudflared without a named tunnel.
{
"mcpServers": {
"electronics-docs-remote": {
"type": "streamableHttp",
"url": "https://random-name.trycloudflare.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_SECRET_TOKEN"
}
}
}
}
After editing mcp.json, reload the Cursor window (or restart MCP) so the config is picked up.
Claude Desktop uses its own file (e.g. claude_desktop_config.json on Windows under %APPDATA%\Claude\) — same url / headers ideas apply if the client supports HTTP MCP.
Exposing to the internet
Option A — ngrok (fastest, for short-term testing)
npm install -g ngrok
ngrok http 3000
# → https://abc123.ngrok.io (public HTTPS tunnel to localhost:3000)
Set in Cursor (~/.cursor/mcp.json or %USERPROFILE%\.cursor\mcp.json on Windows):
{
"mcpServers": {
"electronics-docs-remote": {
"type": "streamableHttp",
"url": "https://abc123.ngrok.io/mcp",
"headers": { "Authorization": "Bearer mysecret" }
}
}
}
Option B — Cloudflare Tunnel (free, stable, no open port)
# Install: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/
cloudflared tunnel --url http://localhost:3000
# → https://some-name.trycloudflare.com
Option C — Docker + VPS / cloud (permanent deployment)
Build a production image that starts the HTTP server:
# Add to Dockerfile (replace the existing CMD)
CMD ["node", "build/server-http.js"]
Deploy on any Node-capable platform:
# Railway / Fly.io / Render — set env vars in dashboard:
# PORT=3000 (usually auto-set by platform)
# MCP_AUTH_TOKEN=<your-secret>
# Fly.io example
fly launch --name electronics-docs-mcp
fly secrets set MCP_AUTH_TOKEN=mysecret
fly deploy
Option D — Docker Compose (self-hosted server)
# docker-compose.yml
services:
mcp-http:
build: .
command: node build/server-http.js
ports:
- "3000:3000"
environment:
- PORT=3000
- MCP_AUTH_TOKEN=mysecret
volumes:
- mcp-data:/root/.electronics-docs-mcp
restart: unless-stopped
volumes:
mcp-data:
npm run build
docker compose up -d
Option E — Vercel (serverless)
The repo includes api/index.ts and vercel.json so the HTTP MCP runs as a Vercel Node function. The build runs npm run build (TypeScript → build/, resources copied, then scripts/ensure-public-dir.cjs so a public/ directory exists). vercel.json sets outputDirectory: public so Vercel does not fail with “No Output Directory named public”. If the dashboard overrides this, set Output Directory to public or leave it empty and rely on vercel.json.
- Install the CLI:
npm i -g vercel - From the project root:
vercel(link the project) thenvercel --prodfor production. - In the Vercel dashboard → your project → Settings → Environment Variables, add:
| Name | Value | Environments |
|---|---|---|
MCP_AUTH_TOKEN |
Your secret (same value you use in Authorization: Bearer …) |
Production, Preview |
ELECTRONICS_DOCS_DB_DIR |
/tmp/electronics-docs-mcp |
Production, Preview |
Redeploy after changing env vars.
URLs after deploy
- MCP (Streamable HTTP):
https://<your-project>.vercel.app/mcp— rewrites invercel.jsonmap/mcp→/api/mcp. - Health:
https://<your-project>.vercel.app/health - Direct function path (same behavior):
https://<your-project>.vercel.app/api/mcp
Cursor mcp.json
{
"mcpServers": {
"electronics-docs-vercel": {
"type": "streamableHttp",
"url": "https://YOUR_PROJECT.vercel.app/mcp",
"headers": {
"Authorization": "Bearer YOUR_MCP_AUTH_TOKEN"
}
}
}
}
Caveats
- Serverless timeouts: Default Hobby limit is 10s per invocation; long PDF indexing may hit it. Pro allows longer functions (see
vercel.jsonmaxDuration). Prefer indexing heavy PDFs locally or on a long-running host. - SQLite: The index lives under
ELECTRONICS_DOCS_DB_DIR(e.g./tmp). On serverless, storage is ephemeral — the DB may reset when the function cold-starts or scales. For a durable index, use self-hosted Option D or a VM. better-sqlite3: Native module; if the build fails on Vercel, check Node version in Project Settings and build logs.- Secrets: Never commit tokens to git. Set
MCP_AUTH_TOKENonly in the Vercel UI orvercel env add.
Project structure
api/
└── index.ts # Vercel serverless: Express app → /api/mcp, /api/health
src/
├── index.ts # stdio entry point (Cursor / Claude Desktop)
├── httpApp.ts # Express app factory (shared: local HTTP + Vercel)
├── server-http.ts # HTTP entry point (LAN / remote / cloud)
├── mcpServerFactory.ts # shared MCP server logic (tools + resources)
├── resources/
│ └── tool-usage-guide.md # Copied to build/resources/ on build
├── cache/
│ └── DocumentCache.ts # SQLite + FTS5
└── providers/
├── VendorProvider.ts
├── TexasInstrumentsProvider.ts
└── StMicroelectronicsProvider.ts
Indexed data is stored under ~/.electronics-docs-mcp/docs.db.
Testing
npm test
# build + run.ts all (see run-default-smoke.cjs)
scripts/agent-flow/run.ts covers resource, search, lookup (TI + ST), and optionally read/query/page/flow. By default RUN_E2E_NETWORK is false in that script, so PDF downloads are skipped. Set RUN_E2E_NETWORK = true in run.ts for full read/query/page (network required).
npx tsx scripts/agent-flow/run.ts --tool search --vendor ST
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。