Code Assist MCP for SAP ByDesign

Build 25.0.9540

接続の確立

The CData Code Assist MCP for SAP ByDesign defines each connection to SAP ByDesign as a named configuration that an MCP Client (such as Claude Desktop) can use when sending natural language queries.

You create and manage these configurations using the CData Code Assist MCP Configuration Tool. The tool automatically handles formatting, storage, and registration with MCP clients.

Understanding Connection Configurations

Each connection configuration is stored in a .mcp file. This file includes the details needed to initialize the connector when an MCP Client starts a session.

  • On Windows, configuration files are stored in "~/AppData/Roaming/CData/SAP ByDesign Data Provider/".
  • On macOS, configuration files are stored in "~/Library/Application Support/CData/SAP ByDesign Data Provider/".

The .mcp file is a text file that contains a list of connection properties and a timestamp. For example:

#Tue May 20 15:48:40 EDT 2025
AuthScheme=Basic
User=myUser
Password=myPassword
Security Token=myToken

The configuration tool handles these settings automatically. Each saved configuration enables an MCP client to launch a dedicated MCP server instance with the correct connector and options. Manual file editing is not required.

このセクションでは、使用しているアカウントおよびサービスタイプの認証を提供し、接続する方法を説明します。

SAPByDesign Account の認証

SAP ByDesign に接続するには、次の接続プロパティを設定します。

分析サービスへの接続

  • URL:SAP ByDesign サイトのURL に設定。例:https://test.sapbydesign.com。
  • ServiceType:分析サービスのレポートを取得する場合はServiceType=AnalyticsService; を指定します。
  • ServiceName:データを取得するサービス名。指定しないか、1つのサービスのみ指定します。サービスのリストを指定したい場合は、BrowsableSchemas を参照してください。

    指定するサービスがわからない場合は、sys_schemas をクエリして利用可能なサービスを一覧表示できます。

  • User:アカウントのユーザー名に設定。
  • Password:アカウントのパスワードに設定。

分析サービスの接続文字列の例:

Url=https://test.sapbydesign.com;ServiceType=AnalyticsService;ServiceName=cc_home_analytics.svc;User=Test;Password=test;

カスタムサービスへの接続

  • URL:SAP ByDesign サイトのURL に設定。例:https://test.sapbydesign.com。
  • ServiceType:データを取得するカスタムサービスがある場合はServiceType=CustomService; を指定します。
  • ServiceName:データを取得するサービス名。指定しないか、1つのサービスのみ指定します。サービスのリストを指定したい場合は、BrowsableSchemas を参照してください。

    指定するサービスがわからない場合は、sys_schemas をクエリして利用可能なサービスを一覧表示できます。

  • User:アカウントのユーザー名に設定。
  • Password:アカウントのパスワードに設定。

カスタムサービスの接続文字列の例:

Url=https://test.sapbydesign.com;ServiceType=CustomService;ServiceName=khsalesorder;User=Test;Password=test;

ODataDataSource API への接続

  • URL:SAP ByDesign サイトのURL に設定。例:https://test.sapbydesign.com。
  • ServiceType:OData Data Source API (odata/analytics/ds) をクエリする場合は、ServiceType=ODataDataSource を指定します。
  • ServiceName:データを取得するサービス名。指定しないか、1つのサービスのみ指定します。サービスのリストを指定したい場合は、BrowsableSchemas を参照してください。

    指定するサービスがわからない場合は、sys_schemas をクエリして利用可能なサービスを一覧表示できます。

  • User:アカウントのユーザー名に設定。
  • Password:アカウントのパスワードに設定。

ODataDataSource 接続文字列の例:

Url=https://test.sapbydesign.com;ServiceType=ODataDataSource;ServiceName=Customer.svc;User=Test;Password=test;

Azure AD による認証(SSO)

組織がMicrosoft Entra ID(旧Azure Active Directory)を使用してユーザーID を管理している場合、シングルサインオン(SSO)を使用してSAP ByDesign への認証を行うことができます。 この方法では、ユーザーはユーザー名やパスワードを直接入力せずに接続できます。

Azure AD 認証を使用するには、以下の接続プロパティを設定します。

  • URL:SAP ByDesign サイトのURL に設定。
  • ServiceType:サービスのタイプを指定:AnalyticsServiceCustomService、またはODataDataSource
  • ServiceName:接続するサービス名に設定。
  • AuthSchemeAzureAD に設定。
  • InitiateOAuth:トークンの取得とリフレッシュを自動的に行うには、GETANDREFRESH に設定。
  • OAuthClientId:SAP ByDesign アプリケーションのOAuth クライアントID に設定。これはEntra ID アプリの登録とは別です。
  • SSOProperties:Azure AD 設定の詳細を含むセミコロン区切りの文字列。サポートされるキーについては、以下を参照してください。
Azure AD 接続文字列の例:
URL=https://my999999.businessbydesign.cloud.sap;
ServiceType=AnalyticsService;
ServiceName=cc_home_analytics.svc;
AuthScheme=AzureAD;
InitiateOAuth=GETANDREFRESH;
OAuthClientId=SAP_APP_CLIENT_ID;
SSOProperties='AzureTenant=TENANT_ID;OAuthClientId=AZURE_AD_APP_CLIENT_ID;OAuthClientSecret=AZURE_AD_CLIENT_SECRET;CallbackURL=http://localhost:33333'

サポートされるSSOProperties キー:

SSOProperties 接続プロパティには、Microsoft Entra ID(Azure AD)でのOAuth ベースの認証に必要なキーと値のペアのセミコロン区切りのリストが含まれます。 これらのキーは、Entra ID がSSO のために実装しているOAuth 2.0 認可コードフローで使用されるフィールドに対応しています。 本製品 は、これらの値を使用して、Microsoft ID プラットフォームへの必要なリクエストを構築します。

  • AzureTenant:Entra ID(Azure AD)テナントID。GUID または検証済みドメインを使用できます。
  • OAuthClientId:Entra ID アプリ登録時のクライアントID。これはSAP アプリのクライアントID とは異なります。
  • OAuthClientSecret:Entra ID アプリのクライアントシークレット。
  • CallbackURL:(オプション)Entra ID に登録されているリダイレクトURI。デフォルトはhttp://localhost:33333 です。
  • Scope:(オプション)認証時にリクエストするOAuth スコープ。

Note:OAuthClientId の値は2つあります。

  • トップレベルのOAuthClientId は、SAP ByDesign に登録されているアプリを指します。
  • SSOProperties 内のOAuthClientId は、Microsoft Entra ID に登録されているアプリを指します。
Microsoft Entra ID アプリケーションの登録の詳細については、Entra ID(Azure AD)アプリケーションの作成 を参照してください。

新しいカスタムODATA サービスを追加

  • SAP ByDesign ワークセンタービューで、[Application and User Management]をクリックします。
  • [OData Services]を選択します。
  • ドロップダウンリストから[Custom OData Services]を選択します。
  • これで現在のカスタムサービスのリストを見ることができます。新しいサービスを追加するには、[New]をクリックします。

SAP ByDesign URL の制約事項

SAP ByDesign 本製品 は、許容されるURI の長さの上限を超えないようにURL に制限をかけており、これによりサービスは[URI Too Long]エラーをスローします。

デフォルトでは、プロジェクションのカラムの長さは1000文字に制限されています。プロジェクションで選択されたカラムがこの制限を超えると、ドライバーはプロジェクション指定を解除してすべてのフィールドを取得します。これは、サービスレスポンスの遅延やペイロードの増加により、パフォーマンスに影響を及ぼす可能性があります。

分析サービス(ServiceType =AnalyticsService)の場合、ドライバーはプロジェクションのカラム数を減らす必要があることを示すエラーを返します。また、サーバー側のフィルタの長さも同じ理由で1000文字に制限されています。生成されたフィルタの長さがこの制限を超える場合、ドライバーは追加のフィルタをドロップしてクライアントサイドで処理します。

SAP ByDesign で、MaxSelectLength およびMaxFilterLength 隠し接続プロパティを使用して、これらの制限を有効または無効にできます。これらのプロパティのデフォルトはいずれも1000文字です。サービスにこれらの制限がない場合は、プロパティを-1に設定して長さの制限を無効にしてください。

SAP IAS

SAP IAS (SAP Identity Authentication Service) is SAP's cloud-based identity provider that enables secure user authentication across SAP and third-party applications. It is a user-based authentication mechanism and requires you to set AuthScheme to SAPIAS or to SAPIASPassword.

To enable SAP IAS authentication, you must first register and configure a custom SAP IAS application as described in SAP IAS SAML App Configuration guide.

Desktop Applications

You can authenticate from a desktop application using a custom IAS application registered in SAP Identity Authentication Service (IAS).

To authenticate via SAP IAS, set the following connection properties:

  • AuthScheme: SAPIAS.
  • InitiateOAuth: GETANDREFRESH.
  • OAuthClientId: The API Key of your SAP ByDesign OAuth2 client application.
  • SAPIASBaseURL: The base URL of the SAP Identity Authentication Service (IAS) tenant.
  • SSOProperties: A semicolon separated list of key-value pairs containing:
    • OAuthClientId: The client Id assigned to your custom SAP IAS application.
    • OAuthClientSecret: The client secret assigned to your custom SAP IAS application.
    (e.g. OAuthClientId=793cf9b4;OAuthClientSecret=K77FErG5S8B;)
  • CallbackURL: The redirect URI you defined when you registered your custom IAS application.

When you connect, the 本製品 opens the SAP IAS OAuth authorization endpoint in your default browser. Log in and authorize the application.

The 本製品 completes the OAuth flow by obtaining an SAML assertion from SAP IAS and exchanging it for an SAP ByDesign access token. This token is then used to authenticate API requests to SAP ByDesign. The OAuth credentials are saved to the location specified by the OAuthSettingsLocation. property and persist across connections.

When the access token expires, the 本製品 automatically refreshes it using the refresh token provided by SAP IAS.

Web Applications

To authenticate via SAP Identity Authentication Service (IAS) using a Web application, you must register a custom OpenId client in SAP IAS. You can then use the 本製品 to obtain and manage OAuth tokens used to access SAP ByDesign.

Get a SAP IAS OAuth Access Token

First, set these connection properties to obtain the OAuthAccessToken:

  • AuthScheme: SAPIAS.
  • OAuthClientId: The API Key of your SAP ByDesign OAuth2 client application.
  • SAPIASBaseURL: The base URL of the SAP Identity Authentication Service (IAS) tenant.
  • SSOProperties: A semicolon separated list of key-value pairs containing:
    • OAuthClientId: The client Id assigned to your custom SAP IAS application.
    • OAuthClientSecret: The client secret assigned to your custom SAP IAS application.
    (e.g. OAuthClientId=793cf9b4;OAuthClientSecret=K77FErG5S8B;)

To complete the OAuth exchange:

  1. Call the GetOAuthAuthorizationUrl stored procedure and set the CallbackUrl input parameter to the redirect URI you configured when registering your custom IAS application.
  2. Open the generated authorization URL in a browser, log in, and authorize the application. You will be redirected to the specified callback URL, which includes a code parameter in the query string.
  3. Call the GetOAuthAccessToken stored procedure. Set the AuthMode input to WEB. Set the Verifier input to the "code" parameter in the query string of the callback URL. If necessary, set the Permissions parameter to request custom permissions.

Once the access and refresh tokens are obtained, the 本製品 can use them to authenticate with SAP ByDesign and refresh tokens automatically as needed.

Automatic Refresh of the SAP IAS OAuth Access Token

To enable automatic token refresh, set the following properties on the initial connection:

On subsequent data connections, the values for OAuthAccessToken and OAuthRefreshToken are taken from OAuthSettingsLocation, and do not need to be set on the connection.

Headless Machines

To configure the 本製品 with a user account on a headless machine, you must first complete authentication on a separate device that has a web browser.

Install the 本製品 on a machine with browser access and perform the standard browser-based authentication flow, as described in the Desktop Applications section above. After successfully authenticating, the 本製品 will store the resulting OAuth values in the file specified by the OAuthSettingsLocation property. By default, this file is named OAuthSettings.txt.

Once you’ve verified that the connection works, copy the OAuthSettings.txt file to your headless machine.

On the headless machine, configure the following connection properties:

  • AuthScheme: SAPIAS.
  • InitiateOAuth: REFRESH.
  • OAuthClientId: The API Key of your SAP ByDesign OAuth2 client application.
  • SAPIASBaseURL: The base URL of the SAP Identity Authentication Service (IAS) tenant.
  • OAuthSettingsLocation: The location of your OAuth settings file. Make sure this location gives read and write permissions to the 本製品 to enable the automatic refreshing of the access token.
  • SSOProperties: A semicolon separated list of key-value pairs containing:
    • OAuthClientId: The client Id assigned to your custom SAP IAS application.
    • OAuthClientSecret: The client secret assigned to your custom SAP IAS application.
    (e.g. OAuthClientId=793cf9b4;OAuthClientSecret=K77FErG5S8B;)

Alternative: Password Grant Flow (No Browser Prompt)

As an alternative to the interactive Code Grant flow, you can use the OAuth Password Grant flow, which allows the application to authenticate without prompting the user in a browser. This flow is ideal for headless, background, or automated server-side applications.

To use the Password Grant flow, set the following connection properties:

  • AuthScheme: SAPIASPassword.
  • OAuthClientId: The API Key of your SAP ByDesign OAuth2 client application.
  • SAPIASBaseURL: The base URL of the SAP Identity Authentication Service (IAS) tenant.
  • SSOProperties: A semicolon separated list of key-value pairs containing:
    • OAuthClientId: The client Id assigned to your custom SAP IAS application.
    • OAuthClientSecret: The client secret assigned to your custom SAP IAS application.
    (e.g. OAuthClientId=793cf9b4;OAuthClientSecret=K77FErG5S8B;)
  • User: The IAS username to authenticate with.
  • Password: The corresponding password for the specified user.

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 25.0.9540