Labsco
oisee logo

OData MCP Bridge (Go)

138

from oisee

A Go bridge providing universal access to OData v2 services through MCP tools, with support for multiple authentication methods.

🔥🔥🔥🔥✓ VerifiedPaid serviceAdvanced setup

OData MCP Bridge (Go)

A Go implementation of the OData to Model Context Protocol (MCP) bridge, providing universal access to OData services through MCP tools.

This is a Go port of the Python OData-MCP bridge implementation, designed to be easier to run on different operating systems with better performance and simpler deployment. It supports both OData v2 and v4 services.

🆕 What's New (v1.6.0)

Universal Tool Mode — One Tool to Rule Them All

The biggest addition is Universal Tool Mode (--universal), a game-changer for large OData services:

Copy & paste — that's it
# Before: 485 tools, ~37,000 tokens, Claude says "no API available"
./odata-mcp https://large-sap-service.com/odata/

# After: 1 tool, ~900 tokens, works perfectly
./odata-mcp --universal https://large-sap-service.com/odata/
MetricStandard ModeUniversal ModeReduction
Tools (Northwind)157199.4%
Tools (SAP BP)485199.8%
Token usage~37,000~90097.6%

Why is it opt-in? Universal mode changes how you interact with OData:

  • Standard mode: Each entity gets dedicated tools (filter_Products, get_Orders, etc.)
  • Universal mode: One odata tool with action, target, and params

We made it opt-in because:

  1. Backward compatibility — existing configs and workflows continue working
  2. Discoverability — per-entity tools are self-documenting; LLMs can see exactly what's available
  3. Simplicity for small services — if you have 20 tools, per-entity mode works great
  4. Explicit choice — users should consciously choose the trade-off

When to use --universal:

  • Service has 50+ entity sets
  • Running multiple OData services simultaneously
  • Experiencing "no API available" or tool selection failures
  • Want minimal token footprint

See Universal Tool Architecture for the full story.

MCP Header Forwarding

New --forward-mcp-headers flag enables passing HTTP headers from MCP clients to OData services:

Copy & paste — that's it
./odata-mcp --transport streamable-http --forward-mcp-headers https://secured-service.com/odata/

This enables:

  • Dynamic authentication — pass credentials per-request instead of at startup
  • Multi-tenant scenarios — different users with different tokens
  • Custom headersX-* headers flow through to OData

Issue Fixes Bonanza

This release fixes 10 open issues:

IssueProblemFix
#12SAP OData shows no toolsFixed XML namespace parsing (sap:creatable etc.)
#13--max-items 99999 crashesAdded validation (max 10,000)
#14Multiple services = Claude stuckUniversal tool mode
#16GUID formatting wrongAuto-detect SAP, add guid'...' prefix
#17Timeout instead of errorImmediate error response
#18Wildcard search failsParse SearchRestrictions annotation
#19Timeout hides SAP errorReturn actual error message
#22BaseType not exposedAdded to EntityType model
#23Header handling--forward-mcp-headers flag
#25Windows build no .exeFixed Makefile for Windows

Previous Releases

  • AI Foundry Compatibility (v1.5.1): --protocol-version flag for AI Foundry's 2025-06-18 protocol
  • SAP GUID Filtering (v1.5.0): Automatic guid'...' formatting for SAP services
  • Streamable HTTP Transport (v1.5.0): Modern MCP protocol with --transport streamable-http

Features

  • Universal OData Support: Works with both OData v2 and v4 services
  • Dynamic Tool Generation: Automatically creates MCP tools based on OData metadata
  • Multiple Authentication Methods: Basic auth, cookie auth, and anonymous access
  • SAP OData Extensions: Full support for SAP-specific OData features including CSRF tokens
  • Comprehensive CRUD Operations: Generated tools for create, read, update, delete operations
  • Advanced Query Support: OData query options ($filter, $select, $expand, $orderby, etc.)
  • Function Import Support: Call OData function imports as MCP tools
  • Flexible Tool Naming: Configurable tool naming with prefix/postfix options
  • Entity Filtering: Selective tool generation with wildcard support
  • Cross-Platform: Native Go binary for easy deployment on any OS
  • Read-Only Modes: Restrict operations with --read-only or --read-only-but-functions
  • MCP Protocol Debugging: Built-in trace logging with --trace-mcp for troubleshooting
  • Service-Specific Hints: Flexible hint system with pattern matching for known service issues
  • Full MCP Compliance: Complete protocol implementation for all MCP clients
  • Multiple Transports: Support for stdio (default), HTTP/SSE, and Streamable HTTP
  • AI Foundry Compatible: Configurable protocol version for AI Foundry and other MCP clients

Generated Tools

The bridge automatically generates MCP tools based on the OData service metadata:

Entity Set Tools

For each entity set, the following tools are generated (if the entity set supports the operation):

  • filter_{EntitySet} - List/filter entities with OData query options
  • count_{EntitySet} - Get count of entities with optional filter
  • search_{EntitySet} - Full-text search (if supported by the service)
  • get_{EntitySet} - Get a single entity by key
  • create_{EntitySet} - Create a new entity (if allowed)
  • update_{EntitySet} - Update an existing entity (if allowed)
  • delete_{EntitySet} - Delete an entity (if allowed)

Function Import Tools

Each function import is mapped to an individual tool with the function name.

Service Information Tool

  • odata_service_info - Get metadata and capabilities of the OData service

Examples

Northwind Service (v2)

Copy & paste — that's it
# Connect to the public Northwind OData v2 service
./odata-mcp --trace https://services.odata.org/V2/Northwind/Northwind.svc/

# This will show generated tools like:
# - filter_Products_for_northwind
# - get_Products_for_northwind  
# - filter_Categories_for_northwind
# - get_Orders_for_northwind
# - etc.

Northwind Service (v4)

Copy & paste — that's it
# Connect to the public Northwind OData v4 service
./odata-mcp --trace https://services.odata.org/V4/Northwind/Northwind.svc/

# OData v4 is automatically detected and handled appropriately
# Supports v4 specific features like:
# - $count parameter instead of $inlinecount
# - contains() filter function
# - New data types (Edm.Date, Edm.TimeOfDay, etc.)

SAP OData Service

Copy & paste — that's it
# Connect to SAP service with CSRF token support
./odata-mcp --user admin --password secret \
  https://my-sap-system.com/sap/opu/odata/sap/SERVICE_NAME/

Differences from Python Version

While maintaining the same CLI interface and functionality, this Go implementation offers:

  • Better Performance: Native compiled binary with lower memory usage
  • Easier Deployment: Single binary with no runtime dependencies
  • Cross-Platform: Native binaries for Windows, macOS, and Linux
  • Type Safety: Go's type system provides better reliability
  • Simpler Installation: No need for Python runtime or package management

Versioning

This project uses automatic versioning based on git tags and commit history:

  • Tagged releases: Uses git tags (e.g., v1.0.0)
  • Development builds: Uses 0.1.<commit-count> format
  • Uncommitted changes: Appends -dirty suffix
Copy & paste — that's it
# Check current version
make version

# Create a release
git tag -a v1.0.0 -m "Release v1.0.0"
git push origin v1.0.0

See VERSIONING.md for detailed versioning guide.

Releasing

This project uses automated GitHub Actions for releases. See RELEASING.md for the release process.

Security

This project includes comprehensive security measures to prevent credential leaks. See SECURITY.md for details.

Important: Never commit .zmcp.json or any files containing real credentials.

Documentation

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

For questions and community discussion, visit our GitHub Discussions.

Development

For development setup and testing:

Copy & paste — that's it
# Run tests
make test

# Run with verbose output for debugging
./odata-mcp --verbose --trace-mcp https://my-service.com/odata/

# Check MCP compliance
./simple_compliance_test.sh

License

This project is licensed under the MIT License - see the LICENSE file for details.