SAP AI Assistant MCP Gateway
Enables natural-language interaction with SAP BTP destinations and OData services through MCP tools, allowing users to discover and query OData endpoints and get AI-generated answers.
README
SAP AI Assistant --- MCP Gateway
Version: 1.0.0
Status: Initial MVP / Stable
Platform: SAP Business Technology Platform (BTP)
Runtime: Cloud Foundry / Node.js
1. Overview
SAP AI Assistant is an AI-powered interface for interacting with SAP BTP destinations and connected OData services using natural language. It combines SAP BTP Destination Service, Model Context Protocol (MCP), OData V2/V4, LangChain, Groq, Node.js, Cloud Foundry, and a browser-based chat UI.
The user selects a configured destination and asks questions such as
Show me the first 5 products. The AI agent uses MCP tools to discover
and query the selected OData service and returns a natural-language
answer.
2. Architecture
SAP BTP
|
+--------v--------+
| Destination |
| Service |
+--------+--------+
|
+--------v--------+
| SAP AI Assistant|
| MCP Gateway |
| |
| Destination Mgmt|
| OData Discovery |
| OData Query |
| MCP Server |
| AI Agent |
+--------+--------+
|
+--------v--------+
| Groq LLM |
| llama-3.3-70b |
+--------+--------+
|
v
Browser UI
3. Core Features
- SAP BTP Destination Service integration
- Dynamic destination selection
- Destination synchronization
- Destination lookup
- MCP server and MCP client
- OData metadata discovery
- OData V2 and V4 support
- Natural-language OData querying
- LangChain tool-calling agent
- Groq LLM integration
- User-friendly chat responses
- Cloud Foundry deployment
- Health endpoint
- Info and version dialogs
4. MCP Tools
Tool Purpose
list_destinations Lists synchronized destinations
get_destination Retrieves destination details
sync_destinations Synchronizes destinations from SAP
BTP
discover_odata Discovers OData metadata and entity
sets
query_odata Executes an OData query against a
selected destination
5. Destination Flow
Destination names are not hard-coded into the AI agent. The client sends the selected destination with the question:
{
"message": "Show me the first 5 products",
"destination": "NORTHWIND_V4"
}
The backend passes both values to the agent:
UI -> /ai/chat -> askAgent({ question, destination }) -> MCP -> selected destination -> OData service
This allows destinations such as S4_PROD, S4_TEST, ARIBA,
SUCCESSFACTORS, or customer-specific destinations without changing
agent code.
6. HTTP Endpoints
Health
GET /health
Example response:
{ "status": "UP" }
List Destinations
GET /destinations
Destination Management
GET /destinationsom/destinations
Get Destination
GET /destination/:name
OData Discovery
GET /odata/:destination/discover
AI Chat
POST /ai/chat
Content-Type: application/json
Example request:
{
"message": "Show me the first 5 products",
"destination": "NORTHWIND_V4"
}
Example response:
{
"success": true,
"question": "Show me the first 5 products",
"destination": "NORTHWIND_V4",
"answer": "The first 5 products are..."
}
The UI displays the answer rather than exposing raw MCP/OData JSON to
normal users.
7. AI Agent Flow
- Receive the user question and selected destination.
- Connect to the MCP server.
- Retrieve available MCP tools.
- Bind the tools to the LLM.
- Allow the LLM to select the required tool(s).
- Execute MCP tools.
- Return tool results to the LLM.
- Produce a natural-language answer.
Question
|
v
LLM
|
+--> discover_odata
|
+--> query_odata
|
v
Tool Result
|
v
LLM
|
v
Final Answer
8. Environment Variables
GROQ_API_KEY
Required by the AI agent. Configure it in Cloud Foundry rather than committing it to source control:
cf set-env sap-mcp-gateway GROQ_API_KEY "<your-groq-api-key>"
cf restage sap-mcp-gateway
MCP_SERVER_URL
Defines the MCP endpoint. Local default:
http://localhost:8080/mcp
For Cloud Foundry, configure the deployed MCP endpoint as appropriate.
9. Deployment
cf login -sso
cf target -o <organization> -s <space>
cf push sap-mcp-gateway
cf app sap-mcp-gateway
cf logs sap-mcp-gateway --recent
Configure the Groq key and restage:
cf set-env sap-mcp-gateway GROQ_API_KEY "<your-key>"
cf restage sap-mcp-gateway
10. Example Development Destinations
NORTHWIND_V2
Name: NORTHWIND_V2
Type: HTTP
URL: https://services.odata.org/v2/northwind/northwind.svc/
Proxy Type: Internet
Authentication: NoAuthentication
NORTHWIND_V4
Name: NORTHWIND_V4
Type: HTTP
URL: https://services.odata.org/v4/northwind/northwind.svc/
Proxy Type: Internet
Authentication: NoAuthentication
These are demonstration destinations. Production systems should use appropriate SAP/customer destinations and authentication.
11. Security
Version 1 focuses on the MCP and destination integration foundation. Before enterprise production use, review or implement:
- XSUAA authentication
- Role-based access control
- Destination-level authorization
- User identity propagation where required
- Secure secret handling
- Audit logging
- Rate limiting
- Input validation
- OData query restrictions
- Result limits
- Sensitive-data protection
- Production monitoring
Never commit API keys to Git.
12. Known v1 Limitations
AI token usage
The current agent can perform multiple LLM/tool iterations and may accumulate metadata and tool results in the conversation. Large metadata responses can therefore increase token consumption.
Agent routing
The current implementation lets the LLM decide which MCP tools to call. Future versions can add deterministic routing for common operations to reduce unnecessary calls.
Authentication
Enterprise authentication and authorization are planned for a subsequent phase.
13. Version 1.0 Scope
Included in v1.0:
- [x] Cloud Foundry deployment
- [x] Health endpoint
- [x] Destination Service integration
- [x] Destination synchronization
- [x] Dynamic destination selection
- [x] MCP server
- [x] MCP client
- [x] MCP tool discovery
- [x] Destination tools
- [x] OData discovery
- [x] OData V2 support
- [x] OData V4 support
- [x] OData querying
- [x] Groq integration
- [x] LangChain agent
- [x] AI chat endpoint
- [x] Natural-language UI
- [x] User-friendly response rendering
- [x] Info dialog
- [x] Version dialog
- [x] Initial technical documentation
14. Roadmap
v1.1 --- AI Optimization
- Reduce unnecessary LLM iterations
- Reduce metadata sent to the LLM
- Limit query results
- Optimize tool-result handling
- Improve error recovery and latency
- Add deterministic routing where appropriate
v1.2 --- Security
- XSUAA
- User authentication
- RBAC
- Destination authorization
- Identity propagation
- Audit logging
v1.3 --- Enterprise OData
$select$filter$orderby$expand$top$skip- Pagination
- Result summarization
v2.0 --- SAP Enterprise MCP Platform
Potential integrations include S/4HANA, SuccessFactors, Ariba, SAP HANA Cloud, Integration Suite, SAP Build Process Automation, and SAP AI capabilities.
15. Architectural Principles
Destination agnostic
Customer-specific destination names should not be embedded in application logic.
Tool driven
The AI agent interacts with SAP systems through MCP tools.
Configuration over code
Environment-specific destinations and credentials remain outside application source code.
User-friendly output
Raw API and MCP JSON should not be exposed to normal users.
Extensible
New MCP tools should be addable without redesigning the entire application.
16. Release Information
Project: SAP AI Assistant / MCP Gateway
Version: 1.0.0
Status: Initial MVP / Stable
Platform: SAP BTP
Runtime: Node.js / Cloud Foundry
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。