SAP OData services were not generating tools properly. The MCP bridge only created a generic "odata_service_info_for_sap" tool instead of tools for each EntitySet.
The XML parser struct tags were missing the sap: namespace prefix for SAP-specific attributes. The code used xml:"creatable,attr" instead of xml:"sap:creatable,attr", causing these attributes to not be parsed correctly from SAP metadata.
Updated the EntitySet struct in internal/metadata/parser.go to include the namespace prefix:
// SAP-specific attributes
Creatable string `xml:"sap:creatable,attr"`
Updatable string `xml:"sap:updatable,attr"`
Deletable string `xml:"sap:deletable,attr"`
Searchable string `xml:"sap:searchable,attr"`
Pageable string `xml:"sap:pageable,attr"`Setting --max-items 99999 caused the MCP server to fail during startup.
No validation on the --max-items parameter allowed extremely large values that could cause memory allocation issues when processing responses. Large values could lead to excessive memory usage when arrays are pre-allocated or when responses are buffered.
Added validation in cmd/odata-mcp/main.go to limit --max-items to a reasonable maximum of 10,000:
// Validate max-items parameter
if cfg.MaxItems > 10000 {
return fmt.Errorf("--max-items value %d is too large (maximum: 10000). Large values can cause memory issues", cfg.MaxItems)
}
if cfg.MaxItems < 0 {
return fmt.Errorf("--max-items value must be positive (got: %d)", cfg.MaxItems)
}When defining two OData services simultaneously in the configuration, Claude becomes unresponsive. The services work individually but not together.
This appears to be a client-side (Claude) issue rather than an MCP bridge problem:
- Tool Count: The two services generate a combined total of ~485 tools (113 + 372)
- Process Isolation: Each MCP server runs as a separate process, so they don't directly interfere with each other
- Resource Constraints: Claude may have limitations on the total number of tools it can handle from multiple MCP servers
- Use --tool-shrink: This flag shortens tool names and can help reduce memory usage
- Filter Entities: Use
--entitiesflag to limit tools to only necessary EntitySets - Disable Unused Operations: Use
--disableflag to remove unnecessary operation types - Run Services Separately: Consider activating only one service at a time based on context
{
"mcpServers": {
"odata-business-partner": {
"command": "/path/to/odata-mcp",
"args": [
"--service", "https://example.com/API_BUSINESS_PARTNER",
"--tool-shrink",
"--entities", "BusinessPartner,Contact,Address",
"--disable", "D",
"--max-items", "50"
]
}
}
}- For SAP Services: Test with a real SAP OData service to verify that EntitySets with
sap:attributes are now properly parsed - For Max Items: Test with various
--max-itemsvalues to ensure validation works correctly - For Multiple Services: Monitor Claude's resource usage when multiple MCP servers are active
fix: Address critical issues with SAP metadata parsing and max-items validation
- Fix SAP OData metadata parsing by adding sap: namespace prefix to XML struct tags
- Add validation for --max-items parameter (max: 10000) to prevent memory issues
- Document analysis for multiple service handling limitations in Claude
Fixes #12, #13, provides guidance for #14
SAP OData services require GUID values in filter expressions to be formatted with the guid prefix:
- ❌ Incorrect:
ChemicalRevisionUUID eq '06023781-a5b8-1eec-bf88-402534c04747' - ✅ Correct:
ChemicalRevisionUUID eq guid'06023781-a5b8-1eec-bf88-402534c04747'
The OData specification allows different formats for GUID values in filters. While standard OData accepts quoted GUIDs, SAP's implementation requires the guid prefix for proper type recognition.
Added automatic GUID format transformation for SAP services:
-
SAP Service Detection (
isSAPService()function):- URL patterns (containing "sap", "s4hana", "odata.sap")
- SAP-specific metadata attributes
- Service namespace containing "sap"
- Hints configuration with service_type containing "SAP"
-
GUID Format Transformation (
transformFilterForSAP()function):- Identifies all properties with type
Edm.Guidin the entity type - Parses filter expressions to find GUID values
- Automatically prefixes GUID values with
guidfor SAP compatibility
- Identifies all properties with type
-
Code Changes:
internal/bridge/bridge.go: Added transformation functionsinternal/models/models.go: Added SAP-specific fields to EntitySet structinternal/metadata/parser.go: Updated parser to capture SAP-specific attributes
The fix is automatically applied when:
- Service is detected as SAP
- Filter contains GUID field comparisons
- The GUID field is of type
Edm.Guidin metadata
No changes required for end users. The transformation is automatic.
Users can ensure SAP detection with hints:
{
"pattern": "*MY_SERVICE*",
"service_type": "SAP OData Service",
"field_hints": {
"ChemicalRevisionUUID": {
"type": "Edm.Guid"
}
}
}