
oisee/odata_mcp_go 是一个从 https://github.com/oisee/odata_mcp_go. 导入的 MCP 服务器候选。
概览
oisee/odata_mcp_go 是一个从 https://github.com/oisee/odata_mcp_go. 导入的 MCP 服务器候选。
概述(AI 翻译)
这是 OData 到模型上下文协议(MCP)桥的 Go 实现,通过 MCP 工具提供对 OData 服务的通用访问。
这是 Python OData-MCP 桥接实现的 Go 移植版,旨在更易于在不同操作系统上运行,性能更好,部署更简单。它支持 OData v2 和 v4 服务。
🆕 新内容(v1.6.0)
通用工具模式——一工具统治一切
最大的新增内容是**通用工具模式([--universal),这是大型OData服务的游戏规则改变者:
| 度规 | 标准模式 | 通用模式 | 约化 |
|---|---|---|---|
| 工具(北风) | 157 | 1 | 99.4% |
| 工具(SAP BP) | 485 | 1 | 99.8% |
| 代币使用量 | ~37,000 | ~900 | 97.6% |
为什么是选择加入? 通用模式改变了你与OData的互动方式:
- 标准模式:每个实体都有专用工具(
filter_Products、get_Orders等) - 通用模式:一个
odata工具,配备action、target和params
我们选择加入,原因是:
- 向后兼容性 — 现有配置和工作流程继续正常工作
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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:
# 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/
| Metric | Standard Mode | Universal Mode | Reduction |
|---|---|---|---|
| Tools (Northwind) | 157 | 1 | 99.4% |
| Tools (SAP BP) | 485 | 1 | 99.8% |
| Token usage | ~37,000 | ~900 | 97.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
odatatool withaction,target, andparams
We made it opt-in because:
- Backward compatibility — existing configs and workflows continue working
- Discoverability — per-entity tools are self-documenting; LLMs can see exactly what’s available
- Simplicity for small services — if you have 20 tools, per-entity mode works great
- 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:
./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:
| Issue | Problem | Fix |
|---|---|---|
| #12 | SAP OData shows no tools | Fixed XML namespace parsing (sap:creatable etc.) |
| #13 | --max-items 99999 crashes |
Added validation (max 10,000) |
| #14 | Multiple services = Claude stuck | Universal tool mode |
| #16 | GUID formatting wrong | Auto-detect SAP, add guid'...' prefix |
| #17 | Timeout instead of error | Immediate error response |
| #18 | Wildcard search fails | Parse SearchRestrictions annotation |
安装
docker run --rm -it odata-mcp --help配置
{
"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"
]
}
}
}