SAP OData MCP Server
About
An MCP server for integrating with SAP OData services, configured via environment variables.
Details
- Author
- gutjahrai
- Categories
- Database, API, Other
- Tags
- #business-operations
Jump to
Setup
Install SAP OData MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/gutjahrai/sap-odata-mcp-server
Follow the installation instructions in the repository README, then restart your MCP client.
An MCP server for integrating with SAP OData services, configured via environment variables.
A Model Context Protocol (MCP) server for integrating SAP systems with AI assistants like Claude using OData REST APIs. This server provides tools for connecting to SAP OData services, querying entity sets, executing CRUD operations, and calling OData functions.
- SAP OData Connectivity: Connect to SAP systems via OData REST APIs
- Smart Connection Handling: Properly handles SAP OData URL structures and 404 responses
- Service Discovery: Automatically discover available OData services via catalog or common service testing
- Entity Set Queries: Query any OData entity set with filtering, sorting, and pagination
- CRUD Operations: Create, Read, Update, and Delete operations on OData entities
- Function Imports: Execute OData function imports and custom functions
- CSRF Token Handling: Automatic CSRF token management for secure operations
- Modular Architecture: Clean, maintainable TypeScript codebase with separation of concerns
- Node.js 18+
- SAP system with OData services enabled
- Network access to SAP OData endpoints
- SAP user credentials with appropriate authorizations
⚠️Advantage: No SAP RFC SDK installation required! Uses standard HTTP/REST APIs.
mkdir sap-odata-mcp-server cd sap-odata-mcp-server mkdir src
-
Copy the source filesfrom the artifacts to yoursrc/directory:
- src/index.ts- Entry point
- src/server.ts- MCP server setup
- src/handlers.ts- Request handlers
- src/odata-client.ts- SAP OData client
- src/tool-definitions.ts- Tool definitions
- src/types.ts- TypeScript types
- package.json- Dependencies and scripts
- tsconfig.json- TypeScript configuration
- .env.example- Environment variables template
cp .env.example .env # Edit .env with your SAP details
Create a.envfile with your SAP system details:
# Required SAP OData Configuration SAP_ODATA_BASE_URL=https://your-sap-host:8000/sap/opu/odata/sap/ SAP_USERNAME=your-sap-username SAP_PASSWORD=your-sap-password # Optional Configuration SAP_CLIENT=100 SAP_TIMEOUT=30000 SAP_VALIDATE_SSL=false # for development with self-signed certificates SAP_ENABLE_CSRF=true
Add to your Claude Desktop configuration file:
macOS:~/Library/Application Support/Claude/claude_desktop_config.json
Windows:%APPDATA%/Claude/claude_desktop_config.json
{ "mcpServers": { "sap-odata": { "command": "node", "args": ["/full/path/to/your/sap-odata-mcp-server/dist/index.js"], "env": { "SAP_ODATA_BASE_URL": "https://your-sap-host:8000/sap/opu/odata/sap/", "SAP_USERNAME": "your-username", "SAP_PASSWORD": "your-password", "SAP_CLIENT": "100", "SAP_VALIDATE_SSL": "false" } } } }
- baseUrl(required): SAP OData service base URL
- username(required): SAP username
- password(required): SAP password
- client(optional): SAP client number
- timeout(optional): Request timeout in milliseconds (default: 30000)
- validateSSL(optional): Validate SSL certificates (default: true)
- enableCSRF(optional): Enable CSRF token handling (default: true)
Get list of available OData services with intelligent discovery.
Get metadata for a specific OData service.
- serviceName(required): Name of the OData service
Query an OData entity set with filtering, sorting, and pagination.
- serviceName(required): Name of the OData service
- entitySet(required): Name of the entity set
- select(optional): Array of fields to select
- filter(optional): OData filter expression
- orderby(optional): OData orderby expression
- top(optional): Number of records to return
- skip(optional): Number of records to skip
- expand(optional): Navigation properties to expand
Get a specific entity by its key values.
- serviceName(required): Name of the OData service
- entitySet(required): Name of the entity set
- keyValues(required): Object with key-value pairs for entity keys
Check current SAP OData connection status.
Once configured, you can interact with SAP using natural language in Claude:
Connect to SAP OData service at https://sap-host:8000/sap/opu/odata/sap/ using username DEVELOPER and password mypassword
Query BusinessPartnerSet from GWSAMPLE_BASIC, select BusinessPartnerID and CompanyName, top 10
Query SalesOrderSet from ZSD_SALES_SRV, filter by CreationDate ge datetime'2024-01-01T00:00:00', order by CreationDate desc, top 20
Get entity from MaterialSet in ZMM_MATERIAL_SRV with key Material = '000000000000000001'
Create entity in CustomerSet with data: {"CustomerNumber": "1000", "CustomerName": "Test Customer", "Country": "US"}
$filter=MaterialType eq 'FERT' and CreationDate ge datetime'2024-01-01T00:00:00'
$select=Material,MaterialDescription,MaterialType,BaseUnit
$expand=MaterialPlantData,MaterialSalesData
- SAP NetWeaver 7.0 or higher
- SAP Gateway component activated
- OData services enabled and configured
The SAP user needs these authorization objects:
- S_SERVICE: Service authorization for OData endpoints
- S_ICF: Internet Communication Framework authorization
- S_TCODE: Transaction authorization for BAPIs (if using function imports)
- Transaction SICF: Activate ICF services at/sap/opu/odata
- Transaction /IWFND/MAINT_SERVICE: Manage and activate OData services
- Transaction /IWFND/GW_CLIENT: Test OData service calls
src/ ├── index.ts # Entry point - starts the server ├── server.ts # MCP server setup and request routing ├── handlers.ts # Business logic for each tool ├── odata-client.ts # SAP OData HTTP client ├── tool-definitions.ts # MCP tool schemas └── types.ts # TypeScript type definitions
- Smart Connection Testing: Handles SAP's URL structure where base URLs return 404
- Service Discovery: Multiple methods to find available OData services
- Error Handling: Comprehensive error handling with helpful messages
- Type Safety: Full TypeScript support with proper interfaces
- CSRF Protection: Automatic CSRF token management for write operations
- Verify SAP system is running and accessible
- Check hostname/port in SAP_ODATA_BASE_URL
- Verify firewall settings allow HTTP/HTTPS traffic
- Check SAP_USERNAME and SAP_PASSWORD
- Verify user account is not locked
- Ensure user has S_SERVICE authorization
- Check user has required SAP authorizations
- Verify S_ICF authorization for OData paths
- Contact SAP administrator for permission review
- This is normal for SAP OData base URLs without service names
- Verify OData services are activated (SICF transaction)
- Use service discovery to find available services
- SetSAP_VALIDATE_SSL=falsefor development
- Install proper certificates for production
- Check certificate chain and expiration
- Test OData URL in browser: Navigate to your SAP OData URL
- Check service activation: Transaction SICF →/sap/opu/odata
- Verify gateway services: Transaction /IWFND/MAINT_SERVICE
- Test with gateway client: Transaction /IWFND/GW_CLIENT
- Use HTTPSfor all SAP OData connections
- Store credentials securely- never hardcode passwords
- Create dedicated service userswith minimal required permissions
- Enable CSRF protectionfor write operations
- Implement proper authorizationin SAP for OData services
- Monitor access logsand set up alerting
- Regular security auditsof user permissions
- Use VPN or private networksfor SAP access
- Implement IP restrictionswhere possible
- Enable SAP Gateway securityfeatures
- Use proper certificate management
- GWSAMPLE_BASIC- Basic sample service for testing
- GWDEMO- Comprehensive demo service
- RMTSAMPLEFLIGHT- Flight booking demo
- API_MATERIAL_SRV- Material Management
- API_BUSINESS_PARTNER- Business Partner Management
- API_SALES_ORDER_SRV- Sales Order Management
- API_PURCHASEORDER_PROCESS_SRV- Purchase Order Processing
- MM (Materials Management): MaterialSet, MaterialPlantDataSet
- SD (Sales & Distribution): SalesOrderSet, CustomerSet, PricingConditionSet
- FI (Financial Accounting): GeneralLedgerEntrySet, AccountingDocumentSet
- HR (Human Resources): EmployeeSet, OrganizationalUnitSet
# Build TypeScript npm run build # Start production server npm start # Development mode with auto-reload npm run dev # Code quality npm run lint npm run format
- Add tool definitionintool-definitions.ts
- Implement handlerinhandlers.ts
- Add routeinserver.tsswitch statement
- Update typesintypes.tsif needed
- Build and test
- Fork the repository
- Create a feature branch
- Make your changes with proper TypeScript types
- Test with a real SAP system
- Submit a pull request
MIT License - see LICENSE file for details.
Connect to SAP Netweaver Gateway data using CData's MCP Server. Requires a separately licensed CData JDBC Driver.
MCP Server for Kingdee K3Cloud (金蝶云星空) — one of the most widely used ERP systems in China. Connects AI assistants (Claude Desktop, Cursor, Cline, Cherry Studio, etc.) to Kingdee ERP via natural language.
Interact with Odoo instances using the XML-RPC API. Requires configuration via environment variables or config files.
Official Airtable MCP server and skills for working with bases, records, workflows, and business operations from AI agents.
MCP Server For Apache Doris, an MPP-based real-time data warehouse.
Interact with Airtable's API to manage bases, tables, and records.
Access and manage Airtable bases, tables, and records using the Airtable Web API.
Interact with AWS Amplify Gen2 data models using natural language and Cognito authentication.
Connect SAP Business One (SQL Server) to Claude AI Desktop via MCP. Query financials, inventory, sales, and purchasing with natural language.
Access live U.S. congressional data from the Congress.gov API.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





