beian-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., "@beian-mcp-server查一下 baidu.com 的 ICP 备案信息"
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.
beian-mcp-server
中国备案信息查询 MCP 服务端。通过 MCP 协议提供工具接口,支持工信部 ICP 备案查询,可同时运行于 HTTP(Streamable HTTP) 与 stdio 两种传输模式。
功能特性
ICP 备案查询:通过 MCP 工具
query-icp查询中国大陆工信部 ICP 备案信息,支持按域名、单位名称、APP 名称等关键词检索,覆盖网站 / 移动应用 / 小程序 / 快应用等服务类型。双传输模式:通过环境变量
MCP_TRANSPORT一键切换 HTTP 与 stdio 模式,适配不同的 MCP 客户端接入方式。单文件构建 + 混淆:
esbuild打包为单一dist/index.cjs(CJS 格式),支持javascript-obfuscator混淆,便于分发部署。无状态请求处理:HTTP 模式下每次请求通过
McpServerFactory创建独立 server 实例,规避单例connect冲突,并兼容 2025 时代客户端的无状态回退。
Related MCP server: whois-mcp
技术栈
类别 | 技术 |
语言/运行时 | TypeScript(NodeNext)、Node.js |
MCP |
|
Web 框架 | Express 5 |
网络请求 | axios + axios-cookiejar-support + tough-cookie |
图像处理 | sharp(用于滑块验证码识别,ICP 查询流程) |
校验 | zod v4 |
构建 | esbuild(单文件打包)+ tsc-alias(路径别名)+ javascript-obfuscator(混淆) |
测试 | vitest |
目录结构
beian_mcp/
├── src/
│ ├── index.ts # 入口:注册工具、启动 HTTP / stdio 服务
│ ├── module/
│ │ └── icp.ts # 工信部 ICP 备案查询核心业务(含滑块验证码识别流程)
│ ├── api/
│ │ └── icp.ts # ICP 查询上游网页接口封装
│ ├── utils/
│ │ ├── captcha.ts # 滑块验证码识别(colorBlockSlider,基于 sharp)
│ │ ├── crypto.ts # 加解密工具
│ │ └── internet.ts # 网络请求工具
│ ├── tests/
│ │ └── module/
│ │ └── icp.test.ts # ICP 流程测试用例
│ └── types/
│ └── icp.ts # 备案查询类型定义与 ServiceType 枚举
├── scripts/
│ ├── build.mjs # 构建脚本:清空 dist → esbuild 打包 → 混淆
│ └── obfuscate.mjs # 混淆脚本(支持 .cjs)
├── dist/ # 构建产物(index.cjs)
├── package.json
└── tsconfig.json环境要求
Node.js ≥ 18(推荐 20+)
pnpm ≥ 11(项目通过
devEngines锁定,npx可能存在兼容问题,请使用pnpm)sharp 为原生模块,运行时需保留在
node_modules中(构建时已通过--external:sharp排除)
快速开始
# 1. 安装依赖
pnpm install
# 2. 开发模式(tsx 热运行,HTTP 模式)
pnpm dev运行
服务启动模式由环境变量 MCP_TRANSPORT 控制:
| 模式 | 说明 |
| HTTP | 监听 |
| stdio | 通过 stdin/stdout 与 MCP 客户端通信 |
HTTP 模式(默认)
# 使用默认端口 3000
node dist/index.cjs
# 自定义端口
$env:PORT = 8080; node dist/index.cjs启动后端点地址:http://127.0.0.1:3000/mcp,按下方「MCP 客户端配置」的 HTTP 示例接入。
stdio 模式
$env:MCP_TRANSPORT = "stdio"; node dist/index.cjs按下方「MCP 客户端配置」的 stdio 示例接入。
MCP 客户端配置
将下方 JSON 片段合并到你使用的 MCP 客户端(Claude Desktop / Cline / Cursor 等)的 mcpServers 配置中。各客户端字段定义一致,仅配置文件位置不同(如 Claude Desktop 的 claude_desktop_config.json、Cline 的扩展设置)。
HTTP 模式(远程接入)
先在本地启动服务(node dist/index.cjs),再配置:
{
"mcpServers": {
"beian-mcp-server": {
"type": "http",
"url": "http://127.0.0.1:3000/mcp",
"headers": {}
}
}
}stdio 模式(本地进程)
使用构建产物 dist/index.cjs:
{
"mcpServers": {
"beian-mcp-server": {
"command": "node",
"args": ["E:\\Project\\Web\\beian_mcp\\dist\\index.cjs"],
"env": { "MCP_TRANSPORT": "stdio" }
}
}
}开发调试时使用 tsx 直跑源码:
{
"mcpServers": {
"beian-mcp-server": {
"command": "pnpm",
"args": ["exec", "tsx", "src/index.ts"],
"env": { "MCP_TRANSPORT": "stdio" }
}
}
}注意:stdio 模式必须在
env中设置MCP_TRANSPORT=stdio,否则服务会以默认的 HTTP 模式启动并监听端口,客户端将无法通信。接入成功后,客户端
tools/list应能列出query-icp工具,即可开始查询备案信息。
构建
# 完整构建:单文件打包 + 混淆(产出 dist/index.cjs,混淆后约 5MB)
pnpm build
# 仅单文件打包、不做混淆(便于排查产物问题)
pnpm build:raw构建链路说明:
scripts/build.mjs清空dist目录;esbuild 打包为 CJS 单文件
dist/index.cjs(--format=cjs、--external:sharp保留原生模块、--alias:@=./src解析路径别名);scripts/obfuscate.mjs对产物执行混淆(--raw时跳过此步)。
说明:产物使用
.cjs扩展名输出,以规避package.json中"type": "module"导致的 ESM 解析问题(ESM 单文件下 express 依赖的动态require("tty")不被支持)。
测试
# 运行一次测试
pnpm test
# 监听模式
pnpm test:watchMCP 工具
query-icp
查询中国大陆工信部 ICP 备案信息。
参数 | 类型 | 必填 | 默认值 | 说明 |
| string | 是 | - | 查询关键词,如 |
| enum | 否 |
| 服务类型: |
返回结果为 JSON 文本,包含备案主体、许可证号、网站信息等。
已知限制
公安备案查询暂不支持:
query-police工具当前未实现(公安备案查询的验证码识别本地化方案尚未落地)。ICP 查询依赖第三方网页接口,若上游接口变更或触发WAF风控,查询可能失败并返回
[ICP 查询失败]错误信息。
许可
CC BY-NC-SA 4.0
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 Connectors
Query SEC EDGAR filings, XBRL financials, and company data through MCP. STDIO & Streamable HTTP.
Query WHOIS/RDAP information for domains, IP addresses, CIDR prefixes and ASNs. Self-hostable.
WHOIS/RDAP lookup, IP geolocation and Punycode conversion. 1400+ TLDs incl. IDN. No API key.
DNS, WHOIS/RDAP, DMARC/SPF, LEI, sitemap, web extract, VAT, QR. Paid per call in USDC, no signup.
Related MCP Servers
- FlicenseNot gradedqualityFmaintenanceEnables querying Chinese enterprise business data including company profiles, shareholder information, investments, branch offices, and key personnel through fuzzy search and detailed lookups.4
- AlicenseAqualityDmaintenanceA WHOIS domain name query server based on Model Context Protocol (MCP), supporting the resolution of over 877 top-level domains and 169 country code top-level domains, and providing comprehensive domain name registration information query functions.32Apache 2.0
- AlicenseAqualityNot gradedmaintenanceStdio-based MCP server with 12 tools for brand name availability and safety checks. Returns structured JSON for domains (with pricing), social handles, USPTO/EUIPO trademarks, app stores, package registries, safety scoring, batch comparison, and filing readiness.1218
- AlicenseAqualityCmaintenanceMCP server for querying ICP filing information and illegal blacklist data for websites, apps, mini-programs, and quick apps.41MIT
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/coolxi-tech/beian-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server