b1-mcp-server for SAP B1
What it does
MCP server for SAP Business One database (HANA / MS SQL) and Service Layer operations
- Connects 在你的电脑上运行
- Account or key No key needed
- Category 数据库与数据集
安装
选择你使用的 AI 应用,然后复制设置。
通过 3/3 项检查 · 在你的电脑上运行
第一步:你用哪个 AI?
选择你用的应用,步骤会显示在下方。
可连接 Claude,但需要先准备
需要先在电脑上安装 Node.js(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用
打开电脑版 Claude 应用的设置文件
SettingsDeveloperEdit Config
粘贴这些设置并保存文件
{ "mcpServers": { "b1": { "command": "npx", "args": [ "-y", "b1-mcp-server" ] } } }退出 Claude 再重新打开
试一试
用 b1-mcp-server for SAP B1 告诉我你能帮我做什么,然后做一件给我看✓ 如果 Claude 说正在使用 b1-mcp-server for SAP B1,或回答中出现 b1-mcp-server for SAP B1 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同
ChatGPT 暂时无法连接 b1-mcp-server for SAP B1
b1-mcp-server for SAP B1 需要安装在你的电脑上,而 ChatGPT 只能连接在网上运行的服务器
你可以改用这些方式
A · 使用能连接 b1-mcp-server for SAP B1 的应用
- 需要先在电脑上安装 Node.js(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用
- 需要先在电脑上安装 Node.js(只需一次)
- 需要先在电脑上安装 Node.js(只需一次)
- 需要先在电脑上安装 Node.js(只需一次)
B · 数据库与数据集 类中能连接 ChatGPT 的其他服务器
从同类中使用较多的里挑选,仅限用地址即可连接、无需密钥的
- Supabase✓ ChatGPT
- Appwrite MCP✓ ChatGPT
- Pg Aiguide✓ ChatGPT
可连接 Claude Code,但需要先准备
需要先在电脑上安装 Node.js(只需一次)
打开终端
Mac:按 Command+空格,输入 Terminal · Windows:打开 PowerShell
粘贴这条命令并按 Enter
claude mcp add --scope user b1 -- npx -y b1-mcp-server在 Claude Code 中输入 /mcp
应能看到 b1-mcp-server for SAP B1 在列表中并显示已连接
试一试
用 b1-mcp-server for SAP B1 告诉我你能帮我做什么,然后做一件给我看✓ 如果 Claude Code 说正在使用 b1-mcp-server for SAP B1,或回答中出现 b1-mcp-server for SAP B1 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同
可连接 Cursor,但需要先准备
需要先在电脑上安装 Node.js(只需一次)
在 Cursor 中以 Agent 模式打开 AI 聊天
试一试
用 b1-mcp-server for SAP B1 告诉我你能帮我做什么,然后做一件给我看✓ 如果 Cursor 说正在使用 b1-mcp-server for SAP B1,或回答中出现 b1-mcp-server for SAP B1 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 Cursor 帮助页面核实 · 你的界面可能因版本略有不同
可连接 VS Code,但需要先准备
需要先在电脑上安装 Node.js(只需一次)
在 VS Code 中以 Agent 模式打开 AI 聊天
试一试
用 b1-mcp-server for SAP B1 告诉我你能帮我做什么,然后做一件给我看✓ 如果 VS Code 说正在使用 b1-mcp-server for SAP B1,或回答中出现 b1-mcp-server for SAP B1 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 VS Code 帮助页面核实 · 你的界面可能因版本略有不同
开发者专用:终端命令和 JSON 设置
安装在电脑上
Claude Code
claude mcp add --scope user b1 -- npx -y b1-mcp-serverClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"b1": {
"command": "npx",
"args": [
"-y",
"b1-mcp-server"
]
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"b1": {
"command": "npx",
"args": [
"-y",
"b1-mcp-server"
]
}
}
}VS Code (mcp.json)
{
"servers": {
"b1": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"b1-mcp-server"
]
}
}
}这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
一览
哪些应用可以使用它
依据这个服务器的连接方式和各应用自己的文档,检查于 2026年11月10日。
在你的电脑上运行,适用于
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月12日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 bersimao 验证,该账户拥有此仓库
- ✓ 通过
仍在维护
代码最后更新于4天前
- ✓ 通过
有许可证
使用 MIT
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
讨论
提问、分享技巧或报告无法使用。按“有帮助”数量排序。
用户评价
还没有评价
与“数据库与数据集”中的其他服务器比较i
- 星标数多于此分类中其他 1171 个服务器的 88%
- 发布到注册中心的时间比此分类中其他 1171 个服务器的 80% 更新
- 基础检查结果等于或优于此分类中其他 1171 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
b1-mcp-server for SAP B1 安全吗?
它在 3 项适用的基础检查中通过了 3 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于4天前,最新版本(1.6.0)于10天前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
有什么可以替代它?
同一分类中有:Dbx, MCP Toolbox for Databases, MCP Toolbox for Databases
同类别的其他选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
MCP Toolbox for Databases
MCP Toolbox for Databases enables your agent to connect to your database.
MCP Toolbox for Databases
MCP Toolbox for Databases enables your agent to connect to your database.
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
b1-mcp-server
A secure Model Context Protocol server that gives an AI client (e.g. Claude Code) guarded access to SAP Business One via both the database (HANA / MS SQL) and the Service Layer OData API.
Features
- 7 MCP tools:
connect_database,execute_sql,execute_service_layer(GET),execute_service_layer_write(PATCH / POST / DELETE),execute_service_layer_write_unattended(the same writes without approval, development profiles only),get_schema_info,check_connection. - Multi-environment: switch between client databases at runtime via named connection profiles. No restart needed.
- Read-only by design: the SQL path executes only
SELECT. EveryINSERT/UPDATE/DELETE/DROP/CREATE/ALTER/EXECis blocked server-side with no confirmation bypass — writes are handed to a human to run in a real DB client. - Server-side guardrails: all raw SQL submitted to
execute_sqlgoes through the same validation whether the user or the AI wrote it. AnonymousDO BEGIN..ENDblocks are classified by the most dangerous statement inside them, so a write hidden behind a trailingSELECTis still a write. - Audit trail: selected-profile connection attempts and database/Service Layer calls that reach policy or execution are recorded as JSON Lines, including policy denials.
- Rate limiting per tool with sliding window.
Install
Requires Node.js 22 or newer.
npx b1-mcp-server
Or add to your Claude Code MCP config:
{
"mcpServers": { "b1-db": { "command": "npx", "args": ["-y", "b1-mcp-server"] } } }
Dependencies
Five runtime dependencies: @modelcontextprotocol/sdk, zod, @sap/hana-client and mssql (plus generic-pool, which backs the HANA connection pool). Database access is a local driver — src/db/directDb.ts — built directly on the HANA and MS SQL clients; Service Layer traffic goes through the strict-TLS adapter in src/sl/serviceLayerAdapter.ts using Node's own fetch and https. No HTTP framework, no axios, no PostgreSQL driver.
The package ships with no overrides block, so npx -y b1-mcp-server installs the same tree a project install does (overrides never applied to npx, which runs without a root package.json). As of 1.6.0, npm audit --omit=dev reports 0 vulnerabilities.
Connection profiles
The server starts unconnected. Connections are loaded from ~/.claude/connections.json (one profile per environment) and selected at runtime by the AI via the connect_database tool.
Profile matching behavior in connect_database:
- Exact match by
idordbNameis preferred. - Partial matches are accepted only when they resolve to a single profile.
- Ambiguous partial matches are rejected with a list of candidates.
Example ~/.claude/connections.json:
[
{ "id": "client_a_prd", "dbType": "hana", "dbServer": "10.0.0.10:30015", "dbName": "SBO_CLIENT_A", "dbUser": "B1ADMIN", "dbPassword": "•••", "slUrl": "https://10.0.0.10:50000/b1s/v2", "slUser": "manager", "slPassword": "•••", "slAllowedMethods": ["GET", "PATCH", "POST"] }, { "id": "client_b_hmg", "dbType": "mssql", "dbServer": "10.0.0.20:1433", "dbName": "SBO_CLIENT_B_HMG", "dbUser": "SA", "dbPassword": "•••" } ]
Every profile requires id, dbType and dbName. Add dbServer and dbUser to configure DirectDb; add slUrl and slUser to configure Service Layer. Each configured side also requires its non-empty password (dbPassword or slPassword). Missing/empty passwords fail locally without a login attempt, avoiding an unnecessary failure that may count toward account lockout under the configured login policy. Non-empty password strings are passed through without trimming. Either side, or both sides, can be configured in one profile.
slAllowedMethods (optional) lists the HTTP verbs the Service Layer tools may send for that profile: any of GET, PATCH, POST, DELETE (case-insensitive). Without it a profile is read-only (["GET"]); every write verb must be listed explicitly. PUT is not supported, because it replaces the whole entity and wipes every field the body omits. An invalid value (unknown verb, empty list, not an array) skips that profile instead of guessing. The list is applied on connect and printed by connect_database; editing it re-logs the Service Layer on the next connect_database call. Allowing a write verb does not waive approval: every write still needs the per-call human acceptance described under the security posture.
slWriteApproval (optional) chooses who approves a write. "elicitation" (default): the server asks through an MCP approval form. "client": the server sends no form and relies on the MCP client's own permission prompt — for setups where the form cannot reach the user, such as Claude Code Remote Control, which forwards permission prompts but not MCP forms. client is honoured only when the MCP client identifies itself as Claude Code; any other client falls back to elicitation. The server cannot see that prompt, so the mode is only as strong as the client's permission settings: list mcp__ __execute_service_layer_write under permissions.ask, never allow, and do not use it with --dangerously-skip-permissions. Without that rule, answering the first prompt with "Yes, don't ask again" saves an allow rule and every later write runs unprompted. Keep production profiles on elicitation. connect_database prints the mode that applies to the current client; editing it re-logs the Service Layer.
"none" is for development companies where a prompt on every write slows the work down. execute_service_layer_write behaves as in client mode, and the profile also unlocks execute_service_layer_write_unattended, which runs the same writes with no approval at all, for any MCP client. That tool refuses every profile not set to "none", so you can list mcp__ __execute_service_layer_write_unattended under permissions.allow and keep the normal write tool under permissions.ask: development profiles run unprompted and every other profile still prompts. The opt-in lives only in the connections file, so it is only as safe as that file: never set "none" on a profile that points at production data.
Both SAP Service Layer roots are supported: /b1s/v1 for OData v3 and /b1s/v2 for OData v4. Login, health checks and relative Service Layer requests use the exact root configured by the profile. Request validation is version-neutral; callers pass only the relative endpoint (for example, Items?$select=ItemCode&$top=1). OData query and payload differences remain the caller's responsibility; configure the root supported by the target SAP B1 installation. SAP deprecated OData v3 starting with SAP Business One 10.0 FP 2405 and made OData v4 the primary protocol, so prefer /b1s/v2 when the target installation supports it; see the Service Layer API reference.
Encrypted credentials (optional, recommended)
The profiles can be stored encrypted in ~/.claude/connections.enc.json instead of the plain-text file (same profile array, AES-256-GCM, key derived from a passphrase with scrypt). Manage it with the creds subcommand of the same binary. Every command reads the passphrase and the passwords only from an interactive terminal: never from an argument, environment variable or pipe, so they stay out of shell history and out of anything an AI tool call can type.
b1-mcp creds migrate # encrypt the existing plain-text file (once)
b1-mcp creds init # or start an empty encrypted file b1-mcp creds add # add a profile b1-mcp creds edit # Enter keeps a value, "-" clears it b1-mcp creds remove b1-mcp creds list # ids and capabilities, never passwords b1-mcp creds passwd # change the passphrase b1-mcp creds unlock # unlock every running server
With npx, the same commands are npx b1-mcp-server creds … (for example npx b1-mcp-server creds edit client_a_prd). From a clone, run node /path/to/dist/index.js creds …. The is the first column of creds list (or of connect_database with "list"). The locked server prints the exact unlock command for its own install.
- With an encrypted file the server starts locked:
connect_databaseanswers with the unlock command and nothing else. Runcreds unlockin your own terminal. It sends the passphrase over a Unix socket in a private directory ($XDG_RUNTIME_DIR/b1-mcp/, or~/.claude/run/; mode0700, socket0600). The server keeps only the derived key in memory, closes the socket, and stops accepting attempts after 5 wrong passphrases until it restarts. Oneunlockreaches every running server (Claude Code, Codex…). - The passphrase is never asked for through the MCP client.
add/edit/removetake effect on the nextconnect_databasewithout a new unlock. Afterpasswd, running servers lock again on their next read.migratedoes not delete the plain-text file. Change the database and Service Layer passwords afterwards (old copies may survive in backups and sync folders), then delete it. While both files exist the server refuses the plain-text one.- Plain text stays supported, with a warning in the logs and in
connect_databaseoutput. - Native Windows: encrypted credentials are not supported yet (no private Unix socket); use the plain-text file there, or run under WSL.
- Forgotten passphrase = recreate the profiles; there is no recovery.
What it protects: copies of the file (stolen disk, backups, cloud sync, malware that copies files, the Windows side reading a WSL disk). What it does not: code running as your own OS user, which can replace the server or read its memory; a keylogger. An AI agent with shell access runs as your OS user, so encryption alone does not keep the credentials from it. With npx this holds in full: the package is unpacked into your npm cache, which your user (and the agent) can modify.
Separate OS user (strong boundary, manual setup)
The boundary against same-user code is a dedicated OS user that owns the credentials. It cannot be set up through npx; on Linux, roughly:
- Create a system user (e.g.
b1mcp) with a private home. The connection files, audit log, trust store and unlock socket follow that user's home. - Install the package root-owned (e.g.
/opt/b1-mcp,npm ci --omit=devas root) and run it with a root-ownednode, never one under your home (nvm). - Allow exactly that command with a
sudoersrule (NOPASSWD, no extra arguments, noSETENV, environment reset), and set the MCP command tosudo -n -u b1mcp. Runcredsthroughsudo -u b1mcpwith your password, so only a human can add profiles or unlock.
This only holds if your user cannot become root without a password. Check for passwordless sudo, membership in the docker group, and on WSL the Windows in