接続の確立
The CData Code Assist MCP for Oracle defines each connection to Oracle OCI 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/Oracle OCI Data Provider/".
- On macOS, configuration files are stored in "~/Library/Application Support/CData/Oracle OCI 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.
Oracle OCI への接続
Oracle OCI は、以下の接続タイプをサポートしています。- Oracle Server
- OracleTNS
- LDAP
Oracle Server
適切なライブラリをPATH に追加(接続の前に で説明)したのち、次のプロパティを設定します。- User:Oracle データベースへの認証のためのユーザーId。
- Password:Oracle データベースへの認証のためのパスワード。
- Port:Oracle データベースをホスティングしているサーバーに接続する際のポート。
- ServiceName:Oracle データベースのサービス名。この値はOracle SQL*PLUS コマンドラインを使ってglobal_name をクエリ(select * from global_name)することで取得できます。
- Server:Oracle データベースをホスティングしているサーバーのホスト名またはIP アドレス。
OracleTNS
OracleTNS を介して認証するには、次のプロパティを設定します。- User:Oracle データベースへの認証のためのユーザーId。
- Password:Oracle データベースへの認証のためのパスワード。
- DataSource:接続記述子(TNS 接続文字列)または接続名は、接続先のデータベースを識別します。これらの値は、tnsnames.ora ファイルにあります。
次に例を示します。
DataSource='(DESCRIPTION=(ADDRESS=(protocol_address_information))(CONNECT_DATA= (SERVICE_NAME=service_name)))'
LDAP
LDAP サーバーを介して認証するには、次のプロパティを設定します。- User:Oracle データベースに関連付けられているユーザーアカウントのユーザーID。
- Password:指定されたユーザーアカウントに紐付けられたパスワード。
- LDAPUri:接続するLDAP サーバーに関連付けられたLDAP URI。
- LDAPUser:Oracle OCI データへの接続に使用する、指定したLDAP サーバー上のユーザーアカウント名。
- システム管理者が匿名でのLDAP ログインを許可している場合はオプションです。
- LDAPPassword:指定されたLDAP ユーザーに紐付けられたパスワード。
- システム管理者が匿名でのLDAP ログインを許可している場合はオプションです。
接続文字列は以下のようになります。
LDAPUri=ldap://myldap.com:389/SERVICE_EXMPL,cn=OracleContext,dc=example,dc=com; User=ORACLEUSER; Password=OracleUserPassword;