s7-1200-manual
Provides precise lookup of Siemens S7-1200/S7-1500 PLC manual content, including instruction syntax, parameter tables, data types, numeric ranges, sections, and tables of contents, by building a local searchable knowledge base from Siemens PDF manuals.
Click on "Deploy 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., "@s7-1200-manualLook up the syntax and parameters for the TON timer instruction."
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.
plc-manual-mcp
把带书签目录的 PLC 手册 PDF 转换成 SQLite + FTS5 全文知识库,并通过 MCP 服务器暴露给 AI 编程助手(ZCode / Claude Code / Cursor 等),让 AI 写 PLC 程序时能精确查询指令语法、参数表、数据类型与数值范围——而不是靠向量检索"大概召回"。
以《SIMATIC S7-1200 系统手册》为例开箱即用;任何带书签的 PDF 手册(S7-1500、CODESYS 等)都可用同一套流程建库。
本仓库不分发任何手册内容(PDF、提取文本、数据库均不入库,受版权保护)。请使用你合法获得的手册副本自行构建数据库。
工作原理
手册 PDF ──extract.mjs──▶ 全文文本 + 书签目录 (data/)
│
build_db.mjs
├─ 自动清洗页眉/页脚/运行头(按"跨页重复行"检测,无需针对特定 PDF 写规则)
├─ 按书签切分为章节(每节记录页码区间)
├─ 抽取指令索引(指令名 + 类别 + 页码)
└─ 写入 SQLite:sections + instructions + FTS5(中文按单字/双字分词)
│
s7db-server.mjs ◀── AI 编程助手通过 MCP 调用
├─ search_manual 全文检索 → 章节号/标题/页码/摘要
├─ get_instruction 某条指令完整手册内容(参数表/数据类型/错误码)
├─ get_section 按章节号取整节(如 3.3 数据类型、A.2.3 CPU 规范)
├─ list_instructions 指令清单(可按类别过滤)
├─ get_toc 章节目录
└─ db_info 库信息(来源手册版本等)Related MCP server: THE_Studio5000_AI_Assistant_V35
快速开始
要求:Node.js ≥ 22.5(使用内置 node:sqlite,需 FTS5 支持)。
git clone https://github.com/Jin-zishan/plc-manual-mcp.git
cd plc-manual-mcp
npm install
# 1. 把你的手册 PDF 放到任意位置(建议仓库目录外,避免误提交),然后:
npm run extract -- "D:\manuals\西门子-SIMATIC-S7-1200-系统手册.pdf"
npm run build # 生成 s7-1200.db + markdown/(均已 gitignore)
# 2. 自测
npm test # 模拟 MCP 客户端握手并跑示例查询构建结果(已自动忽略,不会进入 git):
s7-1200.db— SQLite 知识库(MCP 服务器查询的数据文件)markdown/— 按章节切分的 Markdown,供人工浏览data/— 中间产物(全文 JSON、书签目录)
注册到你的 AI 编程助手
MCP 服务器为 stdio 模式:node <仓库路径>/tools/s7db-server.mjs
ZCode(工作区 .zcode/config.json):
{
"mcp": {
"servers": {
"s7-1200-manual": {
"command": "node",
"args": ["C:\\path\\to\\plc-manual-mcp\\tools\\s7db-server.mjs"]
}
}
}
}Claude Code:
claude mcp add s7-1200-manual -- node C:\path\to\plc-manual-mcp\tools\s7db-server.mjsCursor(.cursor/mcp.json):
{
"mcpServers": {
"s7-1200-manual": {
"command": "node",
"args": ["C:\\path\\to\\plc-manual-mcp\\tools\\s7db-server.mjs"]
}
}
}通用 .mcp.json(多数支持 MCP 的客户端通用):
{
"mcpServers": {
"s7-1200-manual": {
"command": "node",
"args": ["/path/to/plc-manual-mcp/tools/s7db-server.mjs"]
}
}
}让 AI 主动查库
在项目里放一份 AGENTS.example.md(复制为 AGENTS.md),AI 就会在编写 PLC 程序前自动查询手册。核心规则:search_manual 定位 → get_instruction / get_section 取全文 → 引用页码出处。
给其他手册建库(S7-1500 / 其它 PDF)
流程完全相同。清洗与版本识别是自动的(按跨页重复行检测页眉页脚,按 A5Exxxxxx-xx 模式识别西门子版本号);章节切分依赖 PDF 书签——正式出版的西门子手册都有完整书签。指令索引的抽取模式(指令名: / ----[ 指令名 ]---- / XXX 指令)针对西门子手册设计,其他厂商手册仍可用 search_manual 全文检索覆盖。
在线补充:查西门子官方最新文档
本地的手册是静态快照。查最新版 TIA Portal 文档(含 S7-1200 G2、V16+ 新指令),推荐配合 Czarnak/siemens-docs-mcp(MIT):
pip install siemens-docs-mcp # Python 3.11+,提供 search_docs / read_page / get_toc / list_publications分工建议:本地库查"日常指令语法与参数"(快、离线、精确到页);新平台特性用 siemens-docs 查官方在线文档。
换手册后重建
npm run extract -- "新手册.pdf"
npm run build
npm testLicense
MIT — 代码可自由使用;手册 PDF 及其衍生内容(数据库、提取文本)版权归西门子等原出版方所有,请自行确保合法使用。
English (brief)
Convert a bookmarked PLC manual PDF (e.g. Siemens S7-1200 system manual) into a SQLite+FTS5 knowledge base served over MCP, so AI coding agents can precisely look up instruction syntax, parameter tables, data types and ranges while writing PLC programs. No manual content is distributed in this repo — run npm run extract -- your-manual.pdf && npm run build with your own legally obtained copy. Node ≥ 22.5, zero external services, works offline.
This server cannot be deployed
Maintenance
Related MCP Connectors
Provide your AI coding tools with token-efficient access to up-to-date technical documentation for…
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Structured knowledge base for AI agent solutions. Search, explore, and retrieve build logs.
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered PLC programming with natural language to ladder logic conversion, L5X and .ACD project generation, and semantic search through L5X files and documentation.37-
- FlicenseNot gradedqualityBmaintenanceConverts natural language specifications into working ladder logic and complete Studio 5000 projects, enabling AI-powered PLC programming with L5X and .ACD file generation, semantic search, and documentation access.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to generate and validate Siemens S7-1200 SCL code from process descriptions, leveraging an industrial automation knowledge base.MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to connect to Allen-Bradley, Siemens, and CODESYS PLC projects for discovering, asking questions about, analyzing, and proposing code changes, with access to live tag values and version exports under permission-scoped controls.-