A simple, step-by-step guide to exposing a custom database tool from Oracle Autonomous Database (ATP) and connecting it to Fusion AI Agent Studio using the Model Context Protocol (MCP) server.
We will create one simple tool inside our Autonomous Database that can fetch employee records for a given department. We will then expose this tool through the built-in MCP Server, and finally connect it to Fusion AI Agent Studio so an AI agent can call it directly.
Open the OCI Console and go to your Autonomous Database instance.
Open the Tags section of the database.
Add a free-form tag with the following details:
| Namespace | None |
| Key | adb$feature |
| Value | {"name":"mcp_server","enable":true} |
This function takes a department ID and returns the matching employees as JSON. It only accepts a department ID as input — it does not accept free-form SQL, which keeps the tool safe to expose.
Use DBMS_CLOUD_AI_AGENT.CREATE_TOOL to make this function discoverable by MCP
clients, such as Fusion AI Agent Studio.
Every Autonomous Database with the MCP Server enabled gets its own endpoint. You will need three things: the MCP instance URL, the token URL, and your database credentials.
| Tool Type | MCP |
| MCP Instance URL | https://dataaccess.adb.{region}.oraclecloudapps.com/adb/mcp/v1/databases/{database-ocid} |
| Token URL | https://dataaccess.adb.{region}.oraclecloudapps.com/adb/mcp/v1/databases/{database-ocid}/token |
| Transport Type | Streamable HTTP |
The client credentials connection configuration takes this shape:
Replace {region} with your database’s region identifier (for example,
ap-hyderabad-1), and {database-ocid} with your database’s OCID. Both
values are visible on the database details page in the OCI Console.
In Fusion AI Agent Studio, create a new connection and choose Tool Type: MCP.
Enter the MCP Instance URL and Token URL from Step 4.
Enter the client credentials configuration with your database username and password.
Set the Transport Type to Streamable HTTP.
Save the connection, then choose Check for Available Tools.
Fusion AI Agent Studio will now list every tool created using
DBMS_CLOUD_AI_AGENT.CREATE_TOOL — including the
GET_EMPLOYEE_HEADCOUNT_TOOL we created in Step 3.
Select the tool from the list. You can preview its name, its schema, and the exact input it expects.
Add the tool to your agent.
The agent can now call this tool whenever it needs employee data for a department,
passing DEPT_ID as the input.
It can be tempting to write one generic tool that accepts any SQL query and just runs it. This is easy to build, but it is not recommended for real use — it lets the connected AI agent (or anyone calling the tool) run any SELECT statement against the database.
Instead, keep each tool narrow: hard-code the SQL inside the function, and only accept the specific parameters the tool actually needs (like a department ID). This way, the agent can only ever do exactly what the tool was built for.
DBMS_CLOUD_AI_AGENT.CREATE_TOOLWritten for the Sirasoft technical team as a quick-reference guide for MCP + Autonomous Database integrations. If you are still getting your bearings on the Agent Studio terminology, start with our companion post on Oracle Fusion AI Agent Studio: Key Terms, Simply Explained.
Back to All Blogs