Skip to main content
Glama
SAP MCP Gateway

SAP MCP Gateway

by Joekay9223

SAP MCP Gateway

A sanitized reference implementation for connecting SAP Business One to MCP-compatible AI clients.

This repository demonstrates a gateway architecture for Service Layer access, read-only SQL analysis, OAuth/PKCE client flows, local action drafts and explicit write gates. It is a public competence showcase and not a production deployment package.

Included

  • MCP over stdio and HTTP

  • SAP Business One Service Layer reads with bounded pagination

  • Optional read-only SQL analysis with query and result limits

  • Draft, preflight, review and explicit execution workflow for SAP actions

  • OAuth discovery, dynamic client registration and PKCE authorization flow

  • Audit logging, stream-size protections and defensive error handling

  • Unit and integration-style tests with synthetic data

Related MCP server: SAP Datasphere MCP Server

Quick start

npm ci
npm run typecheck
npm run build
npm test
npm run lint

Copy .env.example to .env for local experimentation. The values in that file are placeholders; never commit credentials or live endpoints.

For a container build:

docker compose -f docker-compose.example.yml up --build

Architecture

  • src/server.ts — process entry point

  • src/http/ — HTTP and MCP transport

  • src/mcp/ — MCP server construction

  • src/sap/ — Service Layer and SQL client adapters

  • src/tools/ — tool schemas, read operations and guarded action workflows

  • src/security/ — authentication, OAuth and write safety gates

  • src/store/ — local draft and audit persistence

  • tests/ — automated tests using synthetic fixtures

See docs/architecture.md and docs/security.md for the public design notes.

Public boundary

This split intentionally excludes customer data, generated deployment output, live validation scripts, SSH/Tailscale instructions, server names, production URLs, private operational runbooks and company-specific domain templates. The examples use reserved .invalid hostnames and synthetic values.

The gateway defaults to read-only behavior. Enabling SAP writes requires deliberate configuration and should only be done in an isolated development environment after an independent review.

License

Licensed under the PolyForm Noncommercial License 1.0.0. Private and noncommercial use is permitted; commercial or business use is not permitted under this license. Dependencies and any third-party code remain subject to their own licenses.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      An enterprise-grade MCP server that enables AI agents to execute SAP RFC functions and read business data securely through the Model Context Protocol.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Production-ready MCP server enabling AI assistants to interact with SAP Datasphere for real tenant data discovery, metadata exploration, analytics operations, ETL data extraction, database user management, data lineage analysis, and column-level data profiling.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server enabling AI agents to explore SAP HANA schemas, execute SQL with guardrails, and access database metadata, monitoring, and business domain semantics.
      44
      685 npm
      MIT
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Connects SAP Business One to Claude, ChatGPT, and Copilot, providing 12 MCP tools to read business partners, items, sales orders, invoices, quotations, and delivery notes, and to create sales orders.
      AGPL 3.0