SAP OData to MCP Server for BTPのロゴ

SAP OData to MCP Server for BTP

コミュニティ
lemaiwo

BTP CloudFoundry Node.js MCP server for SAP OData services integration

公開者lemaiwo
リポジトリbtp-sap-odata-to-mcp-server
言語TypeScript
フォーク
66
スター
132
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    SAP OData to MCP Server for BTPは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 利用可能なツール(0個)

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

  • コピーして使える設定

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

  • オープンソースプロジェクトの注目度

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

SAP OData to MCP Server for BTP🚀

🎯 Project Goal

Transform your SAP S/4HANA or ECC system into a conversational AI interface by exposing all OData services as dynamic MCP tools. This enables natural language interactions with your ERP data:

  • "Show me 10 banks" → Automatically queries the Bank entity with $top=10
  • "Update bank with ID 1 to have street number 5" → Executes PATCH operation on Bank entity
  • "Create a new customer with name John Doe" → Performs POST to Customer entity
  • "List all purchase orders from this week" → Applies $filter for date range on PurchaseOrder entity

🏗️ Architecture Overview - 3-Level Progressive Discovery

Core Components:

  1. 🔍 Level 1 - Discovery: Lightweight search returning minimal service/entity lists (token-optimized)
  2. 📋 Level 2 - Metadata: Full schema details on-demand for selected entities
  3. ⚡ Level 3 - Execution: Authenticated CRUD operations using metadata from Level 2
  4. 🔌 MCP Protocol Layer: Full compliance with MCP 2025-06-18 specification
  5. 🌐 HTTP Transport: Session-based Streamable HTTP for web applications
  6. 🔐 BTP Integration: Seamless authentication via SAP BTP Destination service

3-Level Approach Benefits:

  • Token Efficient: Level 1 returns 90% less data than full schemas
  • Progressive Detail: Fetch full schemas only when needed
  • Better LLM Experience: Smaller responses, clearer workflow
  • Reduced Context: From 200+ tools down to just 3

✨ Key Features

🎨 Natural Language to OData

  • Smart Query Translation: Converts natural language to proper OData queries
  • Context-Aware Operations: Understands entity relationships and constraints
  • Parameter Inference: Automatically maps user intent to tool parameters

🔄 Dynamic CRUD Operations

  • Read Operations: Entity sets with filtering, sorting, pagination
  • Create Operations: New entity creation with validation
  • Update Operations: Partial and full entity updates
  • Delete Operations: Safe entity deletion with confirmation

🚀 Production-Ready

  • Session Management: Automatic session creation and cleanup
  • Error Handling: Comprehensive error handling with user-friendly messages
  • Logging: Detailed logging for debugging and monitoring
  • Security: DNS rebinding protection, CORS, Helmet security

📊 Real-Time Metadata

  • Service Catalog: Live discovery of available services
  • Entity Schemas: Dynamic schema generation from OData metadata
  • Capability Detection: Automatic detection of CRUD capabilities per entity

🏛️ System Architecture

┌─────────────────────┐    ┌───────────────────────────┐    ┌─────────────────────┐
│                     │    │                           │    │                     │
│   🤖 AI Agent       │    │   🖥️  SAP MCP Server     │    │   🏢 SAP            │
│   - Claude          │◄──►│   - Service Discovery     │◄──►│   - OData Services  │
│   - GPT-4           │    │   - CRUD Tool Registry    │    │   - Business Logic  │
│   - Local LLMs      │    │   - Session Management    │    │   - Master Data     │
│                     │    │   - BTP Authentication    │    │                     │
└─────────────────────┘    └───────────────────────────┘    └─────────────────────┘
                                           │                                       
                                           ▼                                       
                           ┌───────────────────────────┐                          
                           │                           │                          
                           │   ☁️  SAP BTP Platform    │                          
                           │   - Destination Service   │                          
                           │   - Connectivity Service  │                          
                           │   - XSUAA Security        │                          
                           │                           │                          
                           └───────────────────────────┘                          

🎯 Use Cases

📈 Business Intelligence Queries

User: "Show me top 10 customers by revenue this quarter"
→ Tool: r-CustomerService-Customer
→ Parameters: $filter, $orderby, $top

📝 Data Maintenance

User: "Update supplier ABC123 to have status 'Active'"
→ Tool: u-SupplierService-Supplier
→ Parameters: SupplierId="ABC123", Status="Active"

📊 Analytical Insights

User: "How many open purchase orders are there?"
→ Tool: r-PurchaseOrderService-PurchaseOrder
→ Parameters: $filter=Status eq 'Open'&$count=true

🔧 System Administration

User: "List all inactive users in the system"
→ Tool: r-UserService-User
→ Parameters: $filter=Status eq 'Inactive'

🛠️ Installation & Setup

Prerequisites

  • Node.js 18.x or higher
  • SAP S/4HANA or ECC system with OData services enabled
  • SAP BTP account with Destination and Connectivity services
  • TypeScript knowledge for customization

🚀 Usage Examples

Natural Language Queries

The MCP server automatically translates these natural language commands to the appropriate tool calls:

Natural LanguageGenerated Tool CallOData Query
"Show me 10 banks"r-BankService-BankGET /BankSet?$top=10
"Find banks in Germany"r-BankService-BankGET /BankSet?$filter=Country eq 'DE'
"Update bank 123 name to ABC Corp"u-BankService-BankPATCH /BankSet('123')
"Create a new customer John Doe"c-CustomerService-CustomerPOST /CustomerSet
"Delete order 456"d-OrderService-OrderDELETE /OrderSet('456')

📋 Available Tools - 3-Level Architecture

The server exposes 3 progressive discovery tools instead of hundreds of individual CRUD tools:

Level 1: discover-sap-data

Purpose: Lightweight search for services and entities

Returns: Minimal data (serviceId, serviceName, entityName, entityCount)

Usage:

javascript
// Search for customer entities
discover-sap-data({ query: "customer" })

// Get all available services
discover-sap-data({ query: "" })

// Search in specific category
discover-sap-data({ query: "sales", category: "sales" })

Fallback: If no matches found, returns ALL services with entity lists


Level 2: get-entity-metadata

Purpose: Get complete schema for a specific entity

Returns: Full schema with properties, types, keys, capabilities

Usage:

javascript
// Get full schema for Customer entity
get-entity-metadata({
  serviceId: "API_BUSINESS_PARTNER",
  entityName: "Customer"
})

Output: All properties, types, nullable flags, maxLength, keys, capabilities


Level 3: execute-sap-operation

Purpose: Perform authenticated CRUD operations

Operations: read, read-single, create, update, delete

Usage:

javascript
// Read customers
execute-sap-operation({
  serviceId: "API_BUSINESS_PARTNER",
  entityName: "Customer",
  operation: "read",
  filterString: "CustomerName eq 'ACME'"
})

// Update customer
execute-sap-operation({
  serviceId: "API_BUSINESS_PARTNER",
  entityName: "Customer",
  operation: "update",
  parameters: { CustomerID: "123", CustomerName: "New Name" }
})

Workflow Example

1. discover-sap-data → "customer"
   ↓ Returns: List of customer-related entities

2. get-entity-metadata → "API_BUSINESS_PARTNER", "Customer"
   ↓ Returns: Full schema with all properties

3. execute-sap-operation → read/create/update/delete
   ✓ Executes operation with proper parameters

Protocol Version: 2025-06-18

Supported Capabilities:

  • ✅ Tools with listChanged notifications
  • ✅ Resources with listChanged notifications
  • ✅ Logging with level control
  • ✅ Session Management for HTTP transport
  • ✅ Error Handling with proper error codes

Transport Support

  • ✅ Streamable HTTP (recommended)
  • ✅ Stdio for command line usage
  • ✅ Session-based with automatic cleanup
  • ✅ DNS Rebinding Protection

🔒 Security & Authentication

SAP BTP Integration

  • Uses BTP Destination service for S/4HANA or ECC authentication
  • Supports Principal Propagation and OAuth2
  • Automatic token refresh and session management
  • Secure credential storage in BTP

HTTP Security

  • Helmet.js security headers
  • CORS protection with configurable origins
  • DNS rebinding attack prevention
  • Request rate limiting (configurable)

Session Security

  • Automatic session expiration (24h default)
  • Secure session ID generation
  • Session cleanup on server restart
  • Memory leak prevention

📚 API Reference

Health Check

http
GET /health
{
  "status": "healthy",
  "activeSessions": 3,
  "discoveredServices": 25,
  "version": "2.0.0"
}

Server Info

http
GET /mcp
{
  "name": "btp-sap-odata-to-mcp-server",
  "protocol": { "version": "2025-06-18" },
  "capabilities": { "tools": {}, "resources": {} },
  "features": ["Dynamic service discovery", "CRUD operations"],
  "activeSessions": 3
}

Documentation

http
GET /docs
{
  "title": "SAP MCP Server API",
  "endpoints": {...},
  "mcpCapabilities": {...},
  "usage": {...}
}

🎬 Demo

See the MCP server in action:

MCP Demo

⚙️ Environment Variable: Disable ReadEntity Tool Registration

To disable registration of the ReadEntity tool for all entities in all services, set the following in your .env file:

env
DISABLE_READ_ENTITY_TOOL=true

This will prevent registration of the ReadEntity tool for all entities and services.

⚡ Quick Start

インストール

TypingMind
{
  "mcpServers": {
    "btp-sap-odata-to-mcp-server": {
      "command": "npx",
      "args": [
        "btp-sap-odata-to-mcp-server"
      ]
    }
  }
}

SAP OData to MCP Server for BTPのMCPを複数のAIモデルで活用

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

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

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

1

MCP設定を開く

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

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

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

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

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

SAP OData to MCP Server for BTPをサーバーとして追加

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

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

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

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

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

よくある質問

SAP OData to MCP Server for BTP MCPサーバーは何に使いますか?

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

TypingMindでは、複数のAIモデルでSAP OData to MCP Server for BTP MCPを利用できますか?

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

TypingMindでSAP OData to MCP Server for BTP MCPを使うメリットは何ですか?

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

SAP OData to MCP Server for BTP MCPをTypingMindに接続するにはどうすればよいですか?

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

TypingMindでSAP OData to MCP Server for BTP MCPのどのようなツールを利用できますか?

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

SAP OData to MCP Server for BTP MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

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

関連するMCPサーバー

すべて見る

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

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