GoogleのMCP Toolbox for Databasesを素のOracleに接続する
設定
code:tools.yaml
sources:
oracle-myserver:
kind: oracle
connectionString: "localhost:1521/PDB_FOO"
user: username
password: password
oracle-myserver2:
kind: oracle
connectionString: "localhost:1521/PDB_FOO"
user: username2
password: password2
tools:
oracle_execute_sql_myserver: # ← tool name to call by AI
kind: oracle-execute-sql
source: oracle-myserver
description: Use this tool to execute sql statement.
oracle_execute_sql_myserver2:
kind: oracle-execute-sql
source: oracle-myserver2
description: Use this tool to execute sql statement on myserver2.
MCPサーバー設定
code:mcp.json
{
"servers": {
"db": {
"type": "stdio",
"command": "/path/to/toolbox",
"args": [
"--stdio",
"--tools-file",
"/path/to/tools.yaml"
]
}
}
}
これでAIが db_mcp_oracle_execute_sql_myserver, db_mcp_oracle_execute_sql_myserver2 とかを呼んでSQLを実行できるようになる (VSCode Copilot Chat の場合)