- Home
- MCP servers
- SAP OData
SAP OData
- typescript
7
GitHub Stars
typescript
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"gutjahrai-sap-odata-mcp-server": {
"command": "node",
"args": [
"/full/path/to/your/sap-odata-mcp-server/dist/index.js"
],
"env": {
"SAP_CLIENT": "100",
"SAP_TIMEOUT": "30000",
"SAP_PASSWORD": "your-password",
"SAP_USERNAME": "your-username",
"SAP_ENABLE_CSRF": "true",
"SAP_VALIDATE_SSL": "false",
"SAP_ODATA_BASE_URL": "https://your-sap-host:8000/sap/opu/odata/sap/"
}
}
}
}You can use this MCP server to connect SAP OData services, query entity sets, perform CRUD operations, and call OData function imports from AI assistants. It simplifies interacting with SAP systems through standard HTTP REST endpoints, handling authentication, CSRF protection, and service discovery so you can focus on building workflows and conversational experiences.
How to use
Connect to your SAP OData services and perform common data operations from your MCP client. Begin by configuring your SAP connection details, discovering available services, retrieving metadata, and then querying or mutating data in entity sets. You can also call OData function imports to execute server-side logic.
How to install
Prerequisites: Node.js 18+ and access to your SAP OData endpoints. You should also have SAP user credentials with appropriate authorizations.
Step-by-step setup commands:
mkdir sap-odata-mcp-server
cd sap-odata-mcp-server
mkdir src
# Copy the source files into src/
# src/index.ts, src/server.ts, src/handlers.ts, src/odata-client.ts, src/tool-definitions.ts, src/types.ts
# Copy configuration files
# package.json, tsconfig.json, .env.example
npm install
cp .env.example .env
# Edit .env with your SAP details
npm run build
After building, you start the server using the runtime command shown in your deployment or run context.
## Configuration and runtime details
Environment variables (required for SAP connection):
SAP_ODATA_BASE_URL=https://your-sap-host:8000/sap/opu/odata/sap/ SAP_USERNAME=your-sap-username SAP_PASSWORD=your-sap-password
Optional
SAP_CLIENT=100 SAP_TIMEOUT=30000 SAP_VALIDATE_SSL=false # for development with self-signed certs SAP_ENABLE_CSRF=true
## Claude Desktop integration (example configuration)
Add the MCP server to Claude Desktop so you can control SAP OData through natural language.
{ "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" } } } }
## Security and best practices
Enable CSRF protection for write operations and use HTTPS for all SAP OData connections. Store credentials securely, create dedicated service users with minimal permissions, and monitor access logs with alerting.
## Troubleshooting
Common issues include network errors, unauthorized access, forbidden permissions, and SSL certificate problems. Start by verifying connectivity to SAP OData endpoints, credentials, and required SAP authorizations. For development, you can disable SSL certificate validation, but enable proper certificates in production.
## Notes on usage patterns
Use the SAP OData connectivity features to discover services, query entity sets with filtering, sorting, and pagination, and perform CRUD operations. You can also call function imports to run server-side logic and retrieve computed results.
## Architecture at a glance
The server is organized with a modular TypeScript codebase that cleanly separates concerns: an HTTP/MCP server, request handlers, an OData client for SAP communication, tool definitions, and type definitions. The design emphasizes smart connection handling, service discovery, error handling, and CSRF protection.
## Available tools
### sap\_connect
Connect to SAP OData service with base URL and credentials to initialize a session.
### sap\_get\_services
Discover available OData services automatically through catalog or testing.
### sap\_get\_service\_metadata
Fetch metadata for a specified OData service.
### sap\_query\_entity\_set
Query an OData entity set with filtering, sorting, and pagination.
### sap\_get\_entity
Retrieve a single entity by its key values.
### sap\_create\_entity
Create a new entity in an entity set.
### sap\_update\_entity
Update an existing entity.
### sap\_delete\_entity
Delete an entity.
### sap\_call\_function
Call an OData function import.
### sap\_connection\_status
Check the current SAP OData connection status.
### sap\_disconnect
Disconnect from SAP OData service.