# b1-mcp-server for SAP B1

> b1-mcp-server for SAP B1 is an open-source MCP server for databases. Guarded SAP Business One access over HANA, MS SQL and Service Layer for AI clients. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Repository:** https://github.com/bersimao/b1-mcp-server
- **MCP Registry name:** io.github.bersimao/b1-mcp-server
- **Categories:** [databases](https://ai-powered.com/categories/databases), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

Most of the design effort here goes into restraint. The SQL path runs SELECT statements only, and every INSERT, UPDATE, DELETE, DROP, CREATE, ALTER or EXEC is refused on the server with no confirmation bypass. Anonymous DO BEGIN..END blocks are judged by the most dangerous statement inside them, so a write tucked behind a trailing SELECT is still treated as a write.

The server starts unconnected. Named connection profiles are read from a connections file in the user's Claude config folder, and the AI picks one at runtime with connect_database, so one session can move between client databases without a restart. A profile can configure the database side, the Service Layer side, or both, and Service Layer profiles are read-only unless the file lists PATCH, POST or DELETE explicitly. Even then each write needs per-call human approval, through an MCP approval form by default.

Credentials can be kept in an encrypted file (AES-256-GCM, scrypt-derived key) managed through a creds subcommand that only reads passwords from an interactive terminal. Connection attempts and calls are logged as JSON Lines, and each tool has a sliding-window rate limit. It runs on Node.js 22 or newer.

## Features

- **Seven MCP tools:** Covers connecting, SQL queries, Service Layer reads and writes, schema lookup and connection checks.
- **Select-only SQL:** Write and DDL statements are blocked server-side, including ones hidden inside anonymous blocks.
- **Runtime profile switching:** Named profiles let the AI move between client databases without restarting the server.
- **Approval-gated writes:** Service Layer PATCH, POST and DELETE need per-call human acceptance and an allowed-methods list.
- **Encrypted credentials:** Profiles can be stored in an AES-256-GCM encrypted file managed from an interactive terminal.
- **Audit log and rate limits:** Calls and policy denials are written as JSON Lines, and each tool has a sliding-window limit.
- **OData v3 and v4 roots:** Works with the /b1s/v1 and /b1s/v2 Service Layer endpoints, using whichever root the profile sets.

## Good for

- Query SAP Business One tables in HANA or MS SQL without risking writes
- Look up items, orders or business partners through the Service Layer
- Inspect database schema while building reports or integrations
- Switch between several client databases in one consulting session
- Apply approved Service Layer updates to a development company

## Install

### Claude Code (Terminal)

```sh
claude mcp add b1-mcp-server -- npx -y b1-mcp-server
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "b1-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "b1-mcp-server"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "b1-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "b1-mcp-server"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "b1-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "b1-mcp-server"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "b1-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "b1-mcp-server"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "b1-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "b1-mcp-server"
      ]
    }
  }
}
```

## Tools

- `connect_database`: Select a named connection profile at runtime.
- `execute_sql`: Run validated read-only SQL against the database.
- `execute_service_layer`: Send GET requests to the Service Layer.
- `execute_service_layer_write`: Send PATCH, POST or DELETE requests to the Service Layer with approval.
- `execute_service_layer_write_unattended`: Run the same writes without approval, for development profiles only.
- `get_schema_info`: Return database schema information.
- `check_connection`: Check the state of the current connection.

## FAQ

### Can the AI change data through the SQL tool?

No. The SQL path only runs SELECT; writes and DDL are blocked on the server, and writes are meant to be run by a person in a database client.

### How do Service Layer writes get approved?

By default the server shows an MCP approval form for each write. A profile can instead rely on the client's own permission prompt, or opt out of approval for development use only.

### Which databases are supported?

SAP HANA and Microsoft SQL Server, plus the Service Layer OData API on the v1 and v2 roots.

### Where are connection details kept?

In profile files under the user's Claude config folder, optionally encrypted with a passphrase.

### What does it need to run?

Node.js 22 or newer; start it with npx b1-mcp-server.

### Is b1-mcp-server for SAP B1 free?

Yes. b1-mcp-server for SAP B1 is open source, so you can use and self-host it for free.

### How do I add b1-mcp-server for SAP B1 to Claude Code?

Run this command in your terminal: claude mcp add b1-mcp-server -- npx -y b1-mcp-server

### What are the best alternatives to b1-mcp-server for SAP B1?

The closest alternatives to b1-mcp-server for SAP B1 are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/b1-mcp-server-for-sap-b1
