Back to Guides

How to Connect SAP to Claude AI

Step-by-step guide to connecting SAP S/4HANA, SAP Business One, and SAP ERP to Claude Desktop via MCP. Query SAP data with natural language.

Talk to Your SAP System Through Claude

Imagine asking Claude: "What are the open purchase orders for vendor X?" and getting a real-time answer straight from your SAP system. With AnythingMCP, you can convert SAP's OData and REST APIs into an MCP server that Claude can use directly.

What You Need

  • SAP S/4HANA, SAP Business One, or SAP ERP with OData/REST APIs enabled
  • Docker installed on your server
  • Claude Desktop (or any MCP-compatible AI client)
  • SAP technical user credentials

Step-by-Step Guide

Step 1: Deploy AnythingMCP

git clone https://github.com/HelpCode-ai/anythingmcp.git
cd anythingmcp && docker compose up -d

Step 2: Create a REST Connector for SAP

Open the AnythingMCP dashboard at http://localhost:3000 and create a new REST connector. Set the base URL to your SAP OData endpoint:

  • S/4HANA Cloud: https://your-tenant.s4hana.cloud.sap/sap/opu/odata/sap
  • S/4HANA On-Premise: https://your-sap-server:port/sap/opu/odata/sap
  • Business One: https://your-server:50000/b1s/v1

Import the OData service metadata as an OpenAPI spec.

Step 3: Configure SAP Authentication

  • On-Premise: Use Basic auth with your SAP technical user
  • SAP BTP / Cloud: Use OAuth 2.0 with SAP IAS or Azure AD
  • API Hub sandbox: Use API key

Add required headers like sap-client and x-csrf-token: fetch for write operations.

Step 4: Review and Customize Tools

AnythingMCP generates MCP tools from the SAP OData definitions. Rename tools to be clear (e.g., "get_purchase_orders" instead of "A_PurchaseOrder"), add descriptions, and select which operations to expose.

Step 5: Connect Claude Desktop

Add the MCP server to Claude Desktop's config file:

{
  "mcpServers": {
    "sap": {
      "url": "http://localhost:4000/mcp"
    }
  }
}

Step 6: Start Asking Questions

Now you can ask Claude things like:

  • "Show me all open purchase orders above €10,000"
  • "What's the inventory level for material 4711?"
  • "List all overdue invoices from customer ABC Corp"
  • "Create a purchase requisition for 100 units of material X"
  • "What's our revenue this quarter?"

Security Best Practices

  1. Use a dedicated technical user with minimal SAP authorizations
  2. Start read-only — Only expose GET operations initially
  3. Test in sandbox — Use SAP API Business Hub sandbox before production
  4. Enable audit logging in AnythingMCP to track all AI-initiated operations
  5. Set rate limits to protect your SAP system

Next Steps