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.
⚠️ 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 files from the artifacts to your src/
directory:
src/index.ts
- Entry pointsrc/server.ts
- MCP server setupsrc/handlers.ts
- Request handlerssrc/odata-client.ts
- SAP OData clientsrc/tool-definitions.ts
- Tool definitionssrc/types.ts
- TypeScript typesCopy configuration files:
package.json
- Dependencies and scriptstsconfig.json
- TypeScript configuration.env.example
- Environment variables templateInstall dependencies:
npm install
cp .env.example .env
# Edit .env with your SAP details
npm run build
Create a .env
file 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"
}
}
}
}
Connect to SAP OData service.
Parameters:
baseUrl
(required): SAP OData service base URLusername
(required): SAP usernamepassword
(required): SAP passwordclient
(optional): SAP client numbertimeout
(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.
Parameters:
serviceName
(required): Name of the OData serviceQuery an OData entity set with filtering, sorting, and pagination.
Parameters:
serviceName
(required): Name of the OData serviceentitySet
(required): Name of the entity setselect
(optional): Array of fields to selectfilter
(optional): OData filter expressionorderby
(optional): OData orderby expressiontop
(optional): Number of records to returnskip
(optional): Number of records to skipexpand
(optional): Navigation properties to expandGet a specific entity by its key values.
Parameters:
serviceName
(required): Name of the OData serviceentitySet
(required): Name of the entity setkeyValues
(required): Object with key-value pairs for entity keysCreate a new entity in an entity set.
Update an existing entity.
Delete an entity.
Call an OData function import.
Check current SAP OData connection status.
Disconnect from SAP OData service.
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
Get list of available OData services
Get metadata for service GWSAMPLE_BASIC
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
$orderby=CreationDate desc,Material asc
$top=50&$skip=100
$expand=MaterialPlantData,MaterialSalesData
The SAP user needs these authorization objects:
/sap/opu/odata
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
SAP_VALIDATE_SSL=false
for developmentEnable detailed logging:
DEBUG=axios npm start
/sap/opu/odata
# 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
tool-definitions.ts
handlers.ts
server.ts
switch statementtypes.ts
if neededMIT License - see LICENSE file for details.
Hydrolix time-series datalake integration providing schema exploration and query capabilities to LLM-based workflows.
Interact with Tinybird serverless ClickHouse platform
Build robust data workflows, integrations, and analytics on a single intuitive platform.
Query Onchain data, like ERC20 tokens, transaction history, smart contract state.
An MCP server for Firebird SQL databases, enabling LLMs to securely access, analyze, and manipulate database content.
A read-only MCP server to query live Adobe Analytics data. Requires the CData JDBC Driver for Adobe Analytics.
An MCP server for querying data from the Kollect tool's API endpoints, such as /api/data, /api/snapshots, and /api/costs.
Interact with StarRocks
BigQuery database integration with schema inspection and query capabilities
Stock market API made for AI agents