OData MCP 桥接(Go)のロゴ

OData MCP 桥接(Go)

コミュニティ
oisee

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

公開者oisee
リポジトリodata_mcp_go
言語Go
フォーク
36
スター
141
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    OData MCP 桥接(Go)は、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには141件のスターと36件のフォークがあります。

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:

bash
# 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:

bash
./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 headers — X-* 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

Installation

Download Binary

Download the appropriate binary for your platform from the releases page.

Pre-built binaries are available for:

  • Linux (amd64)
  • Windows (amd64)
  • macOS (Intel and Apple Silicon)

Build from Source

Quick Build (Go required)

bash
git clone https://github.com/oisee/odata_mcp_go.git
cd odata_mcp_go
go build -o odata-mcp cmd/odata-mcp/main.go

Using Makefile (Recommended)

bash
# Build for current platform
make build

# Build for all platforms
make build-all

# Build for all platforms with WSL integration (copies to /mnt/c/bin)
make build-all-wsl

# Build and test
make dev

# Check current version
make version

# See all options
make help

Using Build Script

bash
# Build for current platform
./build.sh

# Build for all platforms
./build.sh all

# See all options
./build.sh help

Cross-Compilation Examples

bash
# Using Make
make build-linux     # Linux (amd64)
make build-windows   # Windows (amd64)
make build-macos     # macOS (Intel + Apple Silicon)

# WSL-specific builds (copies Windows binary to /mnt/c/bin)
make build-windows-wsl  # Build Windows + WSL integration
make build-all-wsl      # Build all platforms + WSL integration

# Using build script
./build.sh linux     # Linux (amd64)
./build.sh windows   # Windows (amd64)
./build.sh macos     # macOS (Intel + Apple Silicon)

# Manual Go build
GOOS=linux GOARCH=amd64 go build -o odata-mcp-linux cmd/odata-mcp/main.go
GOOS=windows GOARCH=amd64 go build -o odata-mcp.exe cmd/odata-mcp/main.go

Docker Build

bash
# Build Docker image
make docker

# Or manually
docker build -t odata-mcp .

# Run in container
docker run --rm -it odata-mcp --help

Building in WSL (Windows Subsystem for Linux)

When building in WSL, you can use special targets that automatically copy the Windows binary to your Windows file system:

bash
# Build all platforms and copy Windows binary to C:\bin
make build-all-wsl

# Build only Windows and copy to C:\bin
make build-windows-wsl

Note: These commands will check if /mnt/c/bin exists and skip the copy if not found, so they're safe to use on any system.

Usage

Claude Desktop Configuration

Claude Desktop uses the stdio transport by default. Here are example configurations:

Finding Your Configuration File

The Claude Desktop configuration file location varies by platform:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Basic Configuration

json
{
    "mcpServers": {
        "northwind-v2": {
            "command": "C:/bin/odata-mcp.exe",
            "args": [
                "--service",
                "https://services.odata.org/V2/Northwind/Northwind.svc/",
                "--tool-shrink"
            ]
        },
        "northwind-v4": {
            "command": "C:/bin/odata-mcp.exe",
            "args": [
                "--service",
                "https://services.odata.org/V4/Northwind/Northwind.svc/",
                "--tool-shrink"
            ]
        }
    }
}

With Authentication

json
{
    "mcpServers": {
        "my-sap-service": {
            "command": "/usr/local/bin/odata-mcp",
            "args": [
                "--service",
                "https://my-sap-system.com/sap/opu/odata/sap/MY_SERVICE/",
                "--user",
                "myusername",
                "--password",
                "mypassword",
                "--tool-shrink",
                "--entities",
                "Products,Orders,Customers"
            ]
        }
    }
}

Using Environment Variables (More Secure)

json
{
    "mcpServers": {
        "my-secure-service": {
            "command": "/usr/local/bin/odata-mcp",
            "args": [
                "--service",
                "https://my-service.com/odata/",
                "--tool-shrink"
            ],
            "env": {
                "ODATA_USERNAME": "myusername",
                "ODATA_PASSWORD": "mypassword"
            }
        }
    }
}

Note: Claude Desktop currently doesn't support reading environment variables from your system. The env field in the configuration sets environment variables specifically for that MCP server process.

Security Best Practices for Claude Desktop

  1. Use environment variables in the env field rather than hardcoding credentials in args
  2. Limit entity access using the --entities flag to only expose necessary data
  3. Use read-only accounts when possible for OData services
  4. Store configuration file securely with appropriate file permissions

Note: Claude Desktop does not currently support API key authentication for MCP servers. All MCP servers run locally with the same permissions as Claude Desktop itself.

Read-Only Configuration Examples

json
{
    "mcpServers": {
        "production-readonly": {
            "command": "/usr/local/bin/odata-mcp",
            "args": [
                "--service",
                "https://production.company.com/odata/",
                "--read-only",
                "--tool-shrink"
            ],
            "env": {
                "ODATA_USERNAME": "readonly_user",
                "ODATA_PASSWORD": "readonly_pass"
            }
        },
        "dev-with-functions": {
            "command": "/usr/local/bin/odata-mcp",
            "args": [
                "--service", 
                "https://dev.company.com/odata/",
                "--read-only-but-functions",
                "--trace-mcp"  // Enable debugging
            ]
        }
    }
}

Claude Code CLI Compatibility

The Claude Code CLI has stricter property name validation than other Claude tools. If you encounter errors like:

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"tools.17.custom.input_schema.properties: Property keys should match pattern ^[a-zA-Z0-9_.-]{1,64}$"}}

Use the --claude-code-friendly flag to remove the $ prefix from OData parameter names:

json
{
    "mcpServers": {
        "northwind-claude-code": {
            "command": "/usr/local/bin/odata-mcp",
            "args": [
                "--service",
                "https://services.odata.org/V2/Northwind/Northwind.svc/",
                "--claude-code-friendly",  // Removes $ from parameter names
                "--tool-shrink"
            ]
        }
    }
}

This transforms parameter names:

  • $filter → filter
  • $select → select
  • $expand → expand
  • $orderby → orderby
  • $top → top
  • $skip → skip
  • $count → count

The server internally maps these friendly names back to their OData equivalents when making requests.

Operation Filtering Configuration Examples

json
{
    "mcpServers": {
        "large-service-readonly": {
            "command": "/usr/local/bin/odata-mcp",
            "args": [
                "--service",
                "https://large-erp.company.com/odata/",
                "--disable", "cud",  // Disable create, update, delete
                "--tool-shrink",
                "--entities", "Orders,Products,Customers"
            ],
            "env": {
                "ODATA_USERNAME": "readonly_user",
                "ODATA_PASSWORD": "readonly_pass"
            }
        },
        "minimal-tools": {
            "command": "/usr/local/bin/odata-mcp",
            "args": [
                "--service",
                "https://api.company.com/odata/",
                "--enable", "gf",  // Only get and filter operations
                "--tool-shrink"
            ]
        },
        "no-actions": {
            "command": "/usr/local/bin/odata-mcp", 
            "args": [
                "--service",
                "https://api.company.com/odata/",
                "--disable", "a",  // Disable all function imports/actions
                "--verbose"
            ]
        }
    }
}

### AI Foundry Configuration

For AI Foundry integration, use the `--protocol-version` flag to specify the `2025-06-18` protocol:

```json
{
    "mcpServers": {
        "odata-for-ai-foundry": {
            "command": "/usr/local/bin/odata-mcp",
            "args": [
                "--service",
                "https://your-odata-service.com/",
                "--protocol-version", "2025-06-18",
                "--user", "your-username",
                "--password", "your-password"
            ]
        }
    }
}

Or via command line:

bash
./odata-mcp --service https://your-service.com/odata --protocol-version "2025-06-18"

See the AI Foundry Compatibility Guide for detailed setup instructions.

Transport Options

The OData MCP bridge supports two transport mechanisms:

  1. STDIO (default) - Standard input/output communication, used by Claude Desktop
  2. HTTP/SSE - HTTP server with Server-Sent Events for web-based clients

🔒 SECURITY MODEL: HTTP transport uses a strict security model.

Security Requirements:

  • Localhost: Token required (--mcp-token)
  • Non-localhost: Token + TLS required, no exceptions
  • All interfaces (0.0.0.0/::): Requires --allow-all-interfaces + token + TLS

Token can be any string - for dev, --mcp-token dev works fine.

Using Streamable HTTP Transport (Modern MCP Protocol)

New in v1.5.0: Support for Streamable HTTP transport (protocol version 2024-11-05)

bash
# Start server with Streamable HTTP (recommended for modern clients)
./odata-mcp --transport streamable-http https://services.odata.org/V2/Northwind/Northwind.svc/

# Use custom localhost port
./odata-mcp --transport streamable-http --http-addr localhost:3000 https://services.odata.org/V2/Northwind/Northwind.svc/

Streamable HTTP endpoints:

  • POST /mcp - Main MCP endpoint (supports automatic SSE upgrade)
  • GET /health - Health check endpoint
  • POST /sse - Legacy SSE endpoint (for backward compatibility)

Using HTTP/SSE Transport (Legacy)

bash
# Start server on localhost (default: localhost:8080)
./odata-mcp --transport http --mcp-token "dev" https://services.odata.org/V2/Northwind/Northwind.svc/

# Use custom localhost port
./odata-mcp --transport http --http-addr localhost:3000 --mcp-token "dev" https://services.odata.org/V2/Northwind/Northwind.svc/

# Non-localhost requires token + TLS
./odata-mcp --transport http --http-addr 192.168.1.100:8080 \
  --mcp-token "my-secret-token" --tls --tls-cert cert.pem --tls-key key.pem \
  https://services.odata.org/V2/Northwind/Northwind.svc/

# All interfaces requires explicit flag + token + TLS
./odata-mcp --transport http --http-addr 0.0.0.0:8080 \
  --allow-all-interfaces --mcp-token "my-secret-token" \
  --tls --tls-cert cert.pem --tls-key key.pem \
  https://services.odata.org/V2/Northwind/Northwind.svc/

Legacy HTTP/SSE endpoints:

  • GET /health - Health check endpoint
  • GET /sse - Server-Sent Events endpoint for real-time communication
  • POST /rpc - JSON-RPC endpoint for request/response communication

Testing HTTP/SSE Transport

  1. Using the provided HTML client:

    bash
    # Start the server
    ./odata-mcp --transport http https://services.odata.org/V2/Northwind/Northwind.svc/
    
    # Open examples/sse_client.html in a web browser
  2. Using curl:

    bash
    # Test SSE endpoint
    curl -N -H 'Accept: text/event-stream' http://localhost:8080/sse
    
    # Test RPC endpoint
    curl -X POST http://localhost:8080/rpc \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'
  3. Using the test scripts:

    bash
    # Test SSE with interactive script
    ./test_sse.sh
    
    # Test HTTP/RPC communication
    ./test_http_rpc.sh

Basic Usage

bash
# Using positional argument
./odata-mcp https://services.odata.org/V2/Northwind/Northwind.svc/

# Using --service flag
./odata-mcp --service https://services.odata.org/V2/Northwind/Northwind.svc/

# Using environment variable
export ODATA_SERVICE_URL=https://services.odata.org/V2/Northwind/Northwind.svc/
./odata-mcp

Authentication

bash
# Basic authentication
./odata-mcp --user admin --password secret https://my-service.com/odata/

# Cookie file authentication
./odata-mcp --cookie-file cookies.txt https://my-service.com/odata/

# Cookie string authentication  
./odata-mcp --cookie-string "session=abc123; token=xyz789" https://my-service.com/odata/

# Environment variables
export ODATA_USERNAME=admin
export ODATA_PASSWORD=secret
./odata-mcp https://my-service.com/odata/

Tool Naming Options

bash
# Use custom prefix instead of postfix
./odata-mcp --no-postfix --tool-prefix "myservice" https://my-service.com/odata/

# Use custom postfix
./odata-mcp --tool-postfix "northwind" https://my-service.com/odata/

# Use shortened tool names
./odata-mcp --tool-shrink https://my-service.com/odata/

Entity and Function Filtering

bash
# Filter to specific entities (supports wildcards)
./odata-mcp --entities "Products,Categories,Order*" https://my-service.com/odata/

# Filter to specific functions (supports wildcards)  
./odata-mcp --functions "Get*,Create*" https://my-service.com/odata/

Read-Only Modes

bash
# Hide all modifying operations (create, update, delete, and functions)
./odata-mcp --read-only https://my-service.com/odata/
./odata-mcp -ro https://my-service.com/odata/  # Short form

# Hide create/update/delete but allow function imports
./odata-mcp --read-only-but-functions https://my-service.com/odata/
./odata-mcp -robf https://my-service.com/odata/  # Short form

Operation Type Filtering

Fine-grained control over which operation types are available. Operation types are:

  • C - Create operations
  • S - Search operations
  • F - Filter/list operations
  • G - Get (single entity) operations
  • U - Update operations
  • D - Delete operations
  • A - Actions/function imports
  • R - Read operations (expands to S, F, G)
bash
# Enable only read operations (search, filter, get)
./odata-mcp --enable "r" https://my-service.com/odata/
./odata-mcp --enable "sfg" https://my-service.com/odata/  # Same as above

# Disable all modifying operations
./odata-mcp --disable "cud" https://my-service.com/odata/

# Enable only get and filter operations
./odata-mcp --enable "gf" https://my-service.com/odata/

# Disable actions/function imports
./odata-mcp --disable "a" https://my-service.com/odata/

# Case-insensitive
./odata-mcp --disable "CUD" https://my-service.com/odata/

Note: --enable and --disable cannot be used together.

Universal Tool Mode

For large OData services with many entities, the standard per-entity tool generation can create hundreds of tools, causing:

  • Context rot: LLMs struggle to reason when tool count exceeds ~128
  • High token usage: Tool schemas can consume 15,000-40,000 tokens
  • Tool selection failures: LLMs may report "no API available"

Universal mode solves this by generating a single tool that handles all operations:

bash
# Enable universal tool mode
./odata-mcp --universal https://my-service.com/odata/

# Compare tool counts
./odata-mcp --trace https://my-service.com/odata/           # Standard: many tools
./odata-mcp --universal --trace https://my-service.com/odata/  # Universal: 1 tool

When to use universal mode:

  • Service has more than ~50 entity sets
  • Using multiple OData services simultaneously
  • Experiencing "no API available" errors with large services

Universal tool usage:

json
{"action": "list", "target": "Products", "params": {"filter": "Price gt 100", "top": 10}}
{"action": "get", "target": "Products", "params": {"key": {"ProductID": 1}}}
{"action": "create", "target": "Orders", "params": {"data": {"CustomerID": "C001"}}}
{"action": "call", "target": "ReleaseOrder", "params": {"OrderID": "O001"}}

Debugging and Inspection

bash
# Enable verbose output
./odata-mcp --verbose https://my-service.com/odata/

# Trace mode - show all tools without starting server
./odata-mcp --trace https://my-service.com/odata/

# Enable MCP protocol trace logging (saves to temp directory)
./odata-mcp --trace-mcp https://my-service.com/odata/
# Linux/WSL: /tmp/mcp_trace_*.log
# Windows: %TEMP%\mcp_trace_*.log

Service Hints

The OData MCP bridge includes a flexible hint system to provide guidance for services with known issues or special requirements:

bash
# Use default hints.json from binary directory
./odata-mcp https://my-service.com/odata/

# Use custom hints file
./odata-mcp --hints-file /path/to/custom-hints.json https://my-service.com/odata/

# Inject hint directly from command line
./odata-mcp --hint "Remember to use \$expand for complex queries" https://my-service.com/odata/

# Combine file and CLI hints (CLI has higher priority)
./odata-mcp --hints-file custom.json --hint '{"notes":["Override note"]}' https://my-service.com/odata/

Configuration

Command Line Flags

FlagDescriptionDefault
--serviceOData service URL
-u, --userUsername for basic auth
-p, --passwordPassword for basic auth
--cookie-filePath to cookie file (Netscape format)
--cookie-stringCookie string (key1=val1; key2=val2)
--tool-prefixCustom prefix for tool names
--tool-postfixCustom postfix for tool names
--no-postfixUse prefix instead of postfixfalse
--tool-shrinkUse shortened tool namesfalse
--entitiesComma-separated entity filter (supports wildcards)
--functionsComma-separated function filter (supports wildcards)
--sort-toolsSort tools alphabeticallytrue
-v, --verboseEnable verbose outputfalse
--debugAlias for --verbosefalse
--traceShow tools and exit (debug mode)false
--trace-mcpEnable MCP protocol trace loggingfalse
--read-only, -roHide all modifying operationsfalse
--read-only-but-functions, -robfHide create/update/delete but allow functionsfalse
--enableEnable only specified operation types (C,S,F,G,U,D,A,R)
--disableDisable specified operation types (C,S,F,G,U,D,A,R)
--hints-filePath to hints JSON filehints.json in binary dir
--hintDirect hint JSON or text from CLI
--transportTransport type: 'stdio', 'http' (SSE), or 'streamable-http'stdio
--http-addrHTTP server address (with --transport http/streamable-http)localhost:8080
--mcp-tokenAuthentication token for HTTP transport (required)
--mcp-token-filePath to file containing authentication token
--tlsEnable TLS for HTTP transportfalse
--tls-certPath to TLS certificate file
--tls-keyPath to TLS key file
--allow-all-interfacesAllow binding to 0.0.0.0/:: (requires --mcp-token and --tls)false
--legacy-datesEnable legacy date format conversiontrue
--no-legacy-datesDisable legacy date format conversionfalse
--convert-dates-from-sapConvert SAP date formats in responsesfalse
--response-metadataInclude __metadata blocks in responsesfalse
--pagination-hintsAdd pagination information to responsesfalse
--max-response-sizeMaximum response size in bytes5MB
--max-itemsMaximum number of items in response100
--verbose-errorsProvide detailed error contextfalse
--claude-code-friendly, -cRemove $ prefix from OData parameters for Claude Code CLI compatibilityfalse
--protocol-versionOverride MCP protocol version (e.g., '2025-06-18' for AI Foundry)2024-11-05
--forward-mcp-headersForward HTTP headers from MCP connection to OData service (Streamable HTTP only)false
--universalUse single universal OData tool instead of per-entity tools (reduces context for large services)false

Environment Variables

VariableDescription
ODATA_SERVICE_URL or ODATA_URLOData service URL
ODATA_USERNAME or ODATA_USERUsername for basic auth
ODATA_PASSWORD or ODATA_PASSPassword for basic auth
ODATA_COOKIE_FILEPath to cookie file
ODATA_COOKIE_STRINGCookie string

.env File Support

Create a .env file in the working directory:

env
ODATA_SERVICE_URL=https://my-service.com/odata/
ODATA_USERNAME=admin
ODATA_PASSWORD=secret

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)

bash
# 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)

bash
# 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

bash
# 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
bash
# 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.

Troubleshooting

MCP Client Issues

If you're experiencing issues with MCP clients (Claude Desktop, RooCode, GitHub Copilot):

  1. Enable trace logging to diagnose protocol issues:

    bash
    ./odata-mcp --trace-mcp https://my-service.com/odata/

    Then check the trace file in your temp directory.

  2. Common issues and solutions:

    • Tools not appearing: Ensure the service URL is correct and accessible
    • Validation errors: Update to the latest version which includes MCP compliance fixes
    • Connection failures: Check authentication credentials and network connectivity
  3. Service-specific hints: The odata_service_info tool now includes automatic hints for known problematic services

See TROUBLESHOOTING.md for detailed troubleshooting guide.

Service Hints System

The OData MCP bridge includes a sophisticated hint system that helps users work around known service issues and provides implementation guidance.

Hint File Format

Create a hints.json file with the following structure:

json
{
  "version": "1.0",
  "hints": [
    {
      "pattern": "*/sap/opu/odata/*",
      "priority": 10,
      "service_type": "SAP OData Service",
      "known_issues": ["List of known issues"],
      "workarounds": ["List of workarounds"],
      "field_hints": {
        "FieldName": {
          "type": "Edm.String",
          "format": "Expected format",
          "example": "12345",
          "description": "Field description"
        }
      },
      "examples": [
        {
          "description": "Example description",
          "query": "filter_EntitySet with $filter=...",
          "note": "Additional note"
        }
      ]
    }
  ]
}

Pattern Matching

The hint system supports wildcard patterns:

  • * matches any sequence of characters
  • ? matches a single character
  • Multiple patterns can match the same service (hints are merged by priority)

Default Hints

The bridge includes default hints for common services:

  • SAP OData Services (*/sap/opu/odata/*): General SAP OData guidance including the critical workaround for HTTP 501 errors using $expand
  • SAP PO Tracking (*SRA020_PO_TRACKING_SRV*): Specific hints for purchase order tracking including field formatting
  • Northwind Demo (*Northwind*): Identifies the public demo service

Using Hints

Hints appear in the odata_service_info tool response under implementation_hints:

bash
# View hints for your service
./odata-mcp https://my-service.com/odata/
# Then call the odata_service_info tool in your MCP client

# The response includes:
{
  "implementation_hints": {
    "service_type": "SAP OData Service",
    "known_issues": [...],
    "workarounds": [...],
    "field_hints": {...},
    "examples": [...],
    "hint_source": "Hints file: hints.json"
  }
}

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:

bash
# 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.

インストール

TypingMind
{
  "mcpServers": {
    "odata-mcp-go": {
      "command": "odata-mcp",
      "args": [
        "--service",
        "{{config.ODATA_SERVICE_URL}}"
      ],
      "env": {
        "ODATA_SERVICE_URL": "<ODATA_SERVICE_URL>"
      }
    }
  }
}

OData MCP 桥接(Go)のMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度OData MCP 桥接(Go)に接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

OData MCP 桥接(Go)をサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. OData MCP 桥接(Go)のMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "odata-mcp-go": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてOData MCP 桥接(Go)のMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. OData MCP 桥接(Go)のMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
OData MCP 桥接(Go)を使ってこのタスクを手伝ってもらえますか?
OData MCP 桥接(Go)
はい、読みました。
OData MCP 桥接(Go)で調べた結果をお伝えします。

よくある質問

OData MCP 桥接(Go) MCPサーバーは何に使いますか?

OData MCP 桥接(Go)は、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでOData MCP 桥接(Go) MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでOData MCP 桥接(Go)を利用できます。

TypingMindでOData MCP 桥接(Go) MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。OData MCP 桥接(Go)を接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

OData MCP 桥接(Go) MCPをTypingMindに接続するにはどうすればよいですか?

OData MCP 桥接(Go)はTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでOData MCP 桥接(Go) MCPのどのようなツールを利用できますか?

OData MCP 桥接(Go)はMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

OData MCP 桥接(Go) MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。OData MCP 桥接(Go)で認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇