CREATE TABLE hotels (
id NUMBER PRIMARY KEY,
name VARCHAR2(80) NOT NULL,
location VARCHAR2(80) NOT NULL,
price_tier VARCHAR2(80) NOT NULL,
checkin_date DATE NOT NULL,
checkout_date DATE NOT NULL,
booked NUMBER NOT NULL CHECK (booked IN (0, 1))
);
alter session set nls_date_format = 'YYYY-MM-DD';
INSERT INTO hotels(id, name, location, price_tier, checkin_date, checkout_date, booked)
VALUES (1, 'Hilton Basel', 'Basel', 'Luxury', '2024-04-22', '2024-04-20', 0);
INSERT INTO hotels(id, name, location, price_tier, checkin_date, checkout_date, booked)
VALUES (2, 'Marriott Zurich', 'Zurich', 'Upscale', '2024-04-14', '2024-04-21', 0);
INSERT INTO hotels(id, name, location, price_tier, checkin_date, checkout_date, booked)
VALUES (3, 'Hyatt Regency Basel', 'Basel', 'Upper Upscale', '2024-04-02', '2024-04-20', 0);
INSERT INTO hotels(id, name, location, price_tier, checkin_date, checkout_date, booked)
VALUES (4, 'Radisson Blu Lucerne', 'Lucerne', 'Midscale', '2024-04-24', '2024-04-05', 0);
INSERT INTO hotels(id, name, location, price_tier, checkin_date, checkout_date, booked)
VALUES (5, 'Best Western Bern', 'Bern', 'Upper Midscale', '2024-04-23', '2024-04-01', 0);
INSERT INTO hotels(id, name, location, price_tier, checkin_date, checkout_date, booked)
VALUES (6, 'InterContinental Geneva', 'Geneva', 'Luxury', '2024-04-23', '2024-04-28', 0);
INSERT INTO hotels(id, name, location, price_tier, checkin_date, checkout_date, booked)
VALUES (7, 'Sheraton Zurich', 'Zurich', 'Upper Upscale', '2024-04-27', '2024-04-02', 0);
INSERT INTO hotels(id, name, location, price_tier, checkin_date, checkout_date, booked)
VALUES (8, 'Holiday Inn Basel', 'Basel', 'Upper Midscale', '2024-04-24', '2024-04-09', 0);
INSERT INTO hotels(id, name, location, price_tier, checkin_date, checkout_date, booked)
VALUES (9, 'Courtyard Zurich', 'Zurich', 'Upscale', '2024-04-03', '2024-04-13', 0);
INSERT INTO hotels(id, name, location, price_tier, checkin_date, checkout_date, booked)
VALUES (10, 'Comfort Inn Bern', 'Bern', 'Midscale', '2024-04-04', '2024-04-16', 0);
commit;
exit;
mcp-toolbox % chmod +x toolbox
mcp-toolbox %
export ORACLE_CONNECTION_STRING="ホスト名:ポート番号/サービス名"
export ORACLE_PASSWORD="パスワード"
ORACLE_USE_OCI=false
mcp-toolbox % export ORACLE_CONNECTION_STRING="localhost:1521/freepdb1"
mcp-toolbox % export ORACLE_USERNAME="apexdev"
mcp-toolbox % export ORACLE_PASSWORD="パスワード"
mcp-toolbox % ORACLE_USE_OCI=false
mcp-toolbox %
./toolbox --prebuilt oracledb
mcp-toolbox % ./toolbox --prebuilt oracledb
2026-09-07T14:24:21.940256+09:00 INFO "Starting MCP Toolbox for Databases version 1.10.0+binary.darwin.arm64.21f972f"
2026-09-07T14:24:21.942172+09:00 INFO "Using prebuilt tool configurations for: oracledb"
2026-09-07T14:24:21.942183+09:00 WARN "These prebuilt configs are intended for 'build-time' use cases, where agents are helping trusted developers build things. They are not secure enough for 'run time' use cases, where the agent will be talking to potentially untrusted developers."
2026-09-07T14:24:22.016809+09:00 INFO "Initialized 1 sources: oracle-source"
2026-09-07T14:24:22.016839+09:00 INFO "Initialized 0 authServices: "
2026-09-07T14:24:22.016862+09:00 INFO "Initialized 0 embeddingModels: "
2026-09-07T14:24:22.017076+09:00 INFO "Initialized 7 tools: list_top_sql_by_resource, list_tablespace_usage, list_invalid_objects, execute_sql, list_tables, list_active_sessions, get_query_plan"
2026-09-07T14:24:22.017088+09:00 INFO "Initialized 0 prompts: "
2026-09-07T14:24:22.017102+09:00 INFO "Initialized 2 groups: default, oracle_database_tools"
2026-09-07T14:24:22.017493+09:00 WARN "wildcard (*) allows any website to access the primitives. This creates a security risk regardless of whether you are in a production or local development environment. Recommended to use --allowed-origins with specific local addresses."
2026-09-07T14:24:22.017532+09:00 WARN "wildcard (*) hosts allow any domain to access this resource, making it vulnerable to DNS rebinding attacks regardless of whether you are in a production or local development environment. For improved security, use the --allowed-hosts flag to specify trusted domains."
2026-09-07T14:24:22.017822+09:00 INFO "Server ready to serve!"
npx @modelcontextprotocol/inspector
% npx @modelcontextprotocol/inspector
Starting MCP inspector...
MCP Inspector Web is up and running at:
http://127.0.0.1:6274?MCP_INSPECTOR_API_TOKEN=26f426782a8a0ed97e6e2d79b1fd4941d91f06803defe71e92a0d77e22dbeb0e
Sandbox (MCP Apps): http://127.0.0.1:6275/sandbox
Auth token: 26f426782a8a0ed97e6e2d79b1fd4941d91f06803defe71e92a0d77e22dbeb0e
Secrets: OS keychain
Opening browser...
ブラウザが起動し、MCP Inspectorの画面が開きます。
kind: source
name: my-oracle-instance
type: oracle
connectionString: ${ORACLE_CONNECTION_STRING}
user: ${ORACLE_USERNAME}
password: ${ORACLE_PASSWORD}
---
# Execute arbitrary SQL.
kind: tool
name: execute_sql
type: oracle-execute-sql
source: my-oracle-instance
description: Use this tool to execute sql statement.
---
# List All hotels.
kind: tool
name: list_all_hotels
type: oracle-sql
source: my-oracle-instance
statement: |
SELECT * FROM hotels
description: |
Use this tools to list all hotels.
---
# List hotels located in specific location.
kind: tool
name: list_hotels_in_the_location
type: oracle-sql
source: my-oracle-instance
statement: |
SELECT * FROM hotels WHERE location = :1
FETCH FIRST :2 ROWS ONLY
description: |
List hotels located in specified location.
Return the specified number of hotels.
Example:
{{
"location": "Basel",
"limit": 10
}}
parameters:
- name: location
type: string
description: location of the hotel
- name: limit
type: integer
description: number of the hotels to be returned
./toolbox --config tools.yaml
mcp-toolbox % ./toolbox --config tools.yaml
2026-09-07T15:34:36.871842+09:00 INFO "Starting MCP Toolbox for Databases version 1.10.0+binary.darwin.arm64.21f972f"
2026-09-07T15:34:36.926093+09:00 INFO "Initialized 1 sources: my-oracle-instance"
2026-09-07T15:34:36.926127+09:00 INFO "Initialized 0 authServices: "
2026-09-07T15:34:36.926146+09:00 INFO "Initialized 0 embeddingModels: "
2026-09-07T15:34:36.926185+09:00 INFO "Initialized 3 tools: execute_sql, list_all_hotels, list_hotels_in_the_location"
2026-09-07T15:34:36.926192+09:00 INFO "Initialized 0 prompts: "
2026-09-07T15:34:36.926206+09:00 INFO "Initialized 1 groups: default"
2026-09-07T15:34:36.926224+09:00 WARN "wildcard (*) allows any website to access the primitives. This creates a security risk regardless of whether you are in a production or local development environment. Recommended to use --allowed-origins with specific local addresses."
2026-09-07T15:34:36.926339+09:00 WARN "wildcard (*) hosts allow any domain to access this resource, making it vulnerable to DNS rebinding attacks regardless of whether you are in a production or local development environment. For improved security, use the --allowed-hosts flag to specify trusted domains."
2026-09-07T15:34:36.926503+09:00 INFO "Server ready to serve!"
Autonomous AI Database MCP Server
https://www.oracle.com/autonomous-database/mcp-server/
ユースケースによっては、オープンソースのMCPサーバーも検討する価値はあるでしょう。例えば、オンプレミスのOracle Database向けのMCPサーバーはSQLclかORDSで実装することになりますが、現状では両方ともカスタム・ツールの実装をサポートしていません。また、Oracle Databaseの他にもデータ・ソースがあり、それらを同様にOIDC認証したい場合など、認証はMCP Toolboxが行うためデータ・ソースごとの設定は不要になります。確認していませんが、OIDC認証で受け取るIDトークンのsubの値をSQLの引数として渡すこともできるようなので、データの検索範囲も認証されたユーザーに応じて制限できそうです。






















