sap-sales-order-mcp
Provides tools for interacting with SAP S/4HANA Sales Order Management, including listing sales orders, retrieving order details and line items, and searching orders by customer.
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., "@sap-sales-order-mcpShow me all open sales orders for customer 17100001."
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.
sap-sales-order-mcp
Production-ready MCP server for SAP S/4HANA Sales Order Management. Sandbox-first, offline-testable, built on FastMCP.
A reference implementation showing how to build a maintainable, testable MCP server that connects Claude (or any MCP client) to an enterprise system. Uses the public SAP API Business Hub sandbox — no on-prem SAP install needed.
Why this repo exists: most MCP + SAP examples show a toy server with one tool and no error handling. This one applies the patterns from Anthropic's Claude Certified Architect (Foundations) curriculum — boundary descriptions, structured errors, offline mocks, and a tool-selection reliability harness — to a real (public) SAP API.
5-Minute Quickstart
# 1. Clone + install
git clone https://github.com/coding-with-abbi/sap-sales-order-mcp.git
cd sap-sales-order-mcp
pip install -e .
# 2. Smoke-test all 4 tools offline (no API key needed)
python mcp_server.py --selftest
# 3. Add your SAP API key (get it free at api.sap.com)
cp .env.example .env
# Edit .env: SAP_API_KEY=<your key>
# 4. Verify live connection
LIVE_TESTS=1 python -m pytest tests/test_integration_live.pyAdd to Claude Desktop (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"sap-sales-orders": {
"command": "python",
"args": ["/absolute/path/to/sap-sales-order-mcp/mcp_server.py"],
"env": {
"SAP_API_KEY": "your_key_here"
}
}
}
}Restart Claude Desktop, then ask: "Show me all open sales orders for customer 17100001."
Related MCP server: odata-mcp-proxy
Tools
Four tools, each with boundary descriptions (USE WHEN / DO NOT use) that guide Claude to pick the right one on ambiguous requests. See docs/ARCHITECTURE.md for the design rationale.
Tool | What it does | Typical prompt |
| Paginated list with optional filters (customer, type, status, created-since) | "Show me all open orders" |
| Single order header by ID (customer, amounts, status, dates) | "Details for order 1000001" |
| Line items of an order (material, quantity, price) | "What products are on order 1000001?" |
| Convenience wrapper: all orders for a specific customer | "Show orders for customer 17100001" |
Full contracts (docstrings): src/sap_sales_mcp/tools.py. More prompts + responses: docs/EXAMPLES.md.
Architecture Highlights
Offline-first. Unit tests +
--selftestrun against aMockSAPClientwith realistic OData v2 fixtures. No API key, no network. Live tests are opt-in viaLIVE_TESTS=1.Structured errors. Every failure returns a
ToolErrorwitherrorCategory(transient|validation|business|permission) +isRetryable— never a bare"failed"string. Claude can act on them.Boundary descriptions. Each tool's docstring explicitly states
USE WHENandDO NOT use for, with cross-references. A tool-selection-reliability harness empirically verifies that these descriptions guide the model correctly on ambiguous requests.Retry policy. Bounded exponential backoff (1s/2s/4s) on transient HTTP errors only. Never on validation, business, or permission errors.
Lazy imports. The offline codepath is stdlib-only —
httpx,mcp,python-dotenvare imported lazily in live functions. Unit tests run without them.Path-scoped rules.
.claude/rules/python.mdand.claude/rules/mcp-tool-design.mdload only when editing matching files — rootCLAUDE.mdstays lean.
Testing
# Unit tests (offline, always safe)
python -m pytest
# Tool-selection harness (deterministic proxy for LLM tool-picking)
python tool_selection_harness.py
# Integration tests against real SAP sandbox
LIVE_TESTS=1 python -m pytest tests/test_integration_live.pyCurrent status: 53 passed + 5 skipped (5 skipped = live tests, opt-in).
Documentation
docs/SETUP.md— Full setup guide (SAP API Hub, Claude Desktop, troubleshooting)docs/ARCHITECTURE.md— Design decisions + CCA-F pattern rationaledocs/EXAMPLES.md— 10 prompt/response examplesdocs/NEXT-STEPS.md— v2 ideas (create-order with approval gate, OAuth, more domains)CONTRIBUTING.md— How to contribute
Positioning
Built by Jacob Abb — AI Consultant & Engineer specialising in Enterprise-AI (RAG, Voicebots, SAP+GenAI). This project is part of a public reference portfolio; adapt it for your own SAP system or use it as a template for other SAP domains (Business Partner, Purchase Order, Materials).
Related: the patterns here (boundary descriptions, structured errors, tool-selection harness) come directly from Anthropic's Claude Certified Architect – Foundations curriculum.
Credits
SAP — API Business Hub for the sandbox
Anthropic — MCP protocol + Claude Certified Architect curriculum
FastMCP — the Python MCP framework this server is built on
License
MIT — use freely, adapt for your production SAP systems, fork it for other domains. PRs welcome (see CONTRIBUTING.md).
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 Servers
- Flicense-qualityDmaintenanceExposes SAP S/4HANA OData services as tools for LLMs, enabling users to list and create sales orders via the Model Context Protocol. It integrates with SAP BTP using the SAP Cloud SDK to provide secure access to enterprise data through natural language.
- Alicense-qualityFmaintenanceA config-driven MCP server that exposes OData and REST APIs as MCP tools, enabling AI assistants to query, manage, and monitor SAP backends through natural language.4027MIT
- Flicense-qualityBmaintenanceDemo MCP server that exposes order and customer data as read-only tools for AI assistants, simulating a business API or internal data source.
- Flicense-qualityBmaintenanceMCP server for interacting with SAP S/4HANA OData services. It enables querying and controlled creation/update of sales orders, products, customers, and pricing conditions, with safety features like dry-run mode and ETag-based updates.
Related MCP Connectors
Hosted MCP server exposing US hospital procedure cost data to AI assistants
Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.
Hosted Amazon Seller Central and Amazon Ads MCP server for Claude, ChatGPT, Cursor, and agents.
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/coding-with-abbi/sap-sales-order-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server