The database MCP server
Agentic AI Foundations · Lesson 20 of 20 · 2:30:29
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the Oracle Agentic AI Foundations Associate exam (1Z0-1157-26). In this lesson: why an MCP server inside Autonomous AI Database, how to enable it and connect a client, Select AI Agent tools exposed over MCP, and security in layers. Includes three original practice questions, with Fairhaven Furniture, a fictional furniture seller, as the example.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
One more server to run?
Fairhaven's analysts already use an MCP client, and they want it to answer questions from the sales database. A self-hosted database MCP server would be one more process to deploy, patch, and scale. And someone would have to map each caller to the right database user, and hope that the mapping is right.
A server inside the database
Every MCP server so far has been a separate process, which you install, run, and keep alive. The Autonomous AI Database MCP server is different: it is a managed server, built into the database, with one MCP server for each database. There are no images to pull and no containers to run, and Oracle handles patching, scaling, and high availability. It is multi-tenant: one Oracle-managed service serves many databases, each with its own endpoint.
Three problems solved
Putting the server inside the database solves three problems at once. First, there is less to operate, since there is no server of your own. Second, security is tighter, because the AI client signs in with normal database credentials. And third, natural language to SQL is faster, because it skips schema discovery: a generic server has no idea which tables exist, so it spends tokens and time finding out.
Enabling the server
You enable the server for each database. In the OCI Console, open the database's Tool configuration tab, switch the MCP server on, and apply the change. The course, and an older documentation page, turn it on with an OCI free-form tag instead, and the current documentation shows this switch. Once it is enabled, the page shows the server's access URL, ready to copy, and disabling it stops new connections, while calls in progress finish.
One URL per database
Each database gets its own URL, built from its OCID, the identifier of one Autonomous AI Database instance. The client talks to that single HTTPS endpoint, with the Streamable HTTP transport. So any MCP client connects the same way, like the LangChain or OpenAI Agents SDK clients from earlier lessons.
Signing in
Clients authenticate in one of two ways. With OAuth, the client registers dynamically or statically, and the user signs in with a database username and password. Or the client sends a bearer token, generated for a database user. Either way, there is no separate MCP user: whatever the user is allowed to do in the database is exactly what the AI may do.
Tools from Select AI Agent
The server exposes Select AI Agent tools, which you create with the create tool procedure of the DBMS cloud AI agent package. Create three tools today, and they are three MCP tools that clients can call right away. Natural language to SQL is the headline tool: it relies on an AI profile, which already knows the tables, so the model does not play twenty questions with the schema. Tools can also run retrieval over vector-indexed documents, and custom PL/SQL is the escape hatch: any PL/SQL function can become an MCP tool.
Creating a tool
Here is a tool that wraps a PL/SQL function. Its attributes give an instruction, which tells the model what the tool does, the function to call, and each input with a description. The instruction also warns the model never to treat the tool's output as a command, a guard against prompt injection. To list your tools, query the user AI agent tools view, and to change one, drop it and create it again; JavaScript functions from the Multilingual Engine are not supported as tools.
Security in layers
Security works in layers. At the network, the server enforces access control lists and private endpoints, and it limits the rate of requests. In the database, roles and Virtual Private Database policies decide which tools a user sees, and which rows the user reads. And every interaction is written to the database audit logs.
Recap
Let's recap. The Autonomous AI Database MCP server is managed by Oracle and built into the database, one per database, with nothing to deploy or scale. You switch it on from the Tool configuration tab, or with a free-form tag in the course, and each database gets its own URL from its OCID, over Streamable HTTP. Clients sign in with OAuth or a database user's bearer token, so roles, access control lists, and Virtual Private Database policies apply unchanged. And its tools are Select AI Agent tools, from natural language to SQL and retrieval to custom PL/SQL functions.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
Fairhaven wants its MCP client to reach the sales database, without running, patching, or scaling any server of its own. What should the team do?
- Run a database MCP server on Kubernetes Engine
- Enable the database’s built-in MCP server
- Export the tables to Object Storage nightly
- Install a local stdio server on each laptop
Show the answer
Enable the database’s built-in MCP server
The Autonomous AI Database MCP server is managed by Oracle, so the team runs, patches, and scales nothing. “Run a database MCP server on Kubernetes Engine” is a server of their own, on a cluster that they operate. “Export the tables to Object Storage nightly” would copy the data out of the database, where it goes stale, outside database security. And “Install a local stdio server on each laptop” would put a server to install and patch on every laptop.
A Fairhaven analyst’s database role is limited by a Virtual Private Database policy to the European orders. The analyst’s agent connects through the MCP server, with the analyst’s own credentials. Which orders can the agent read?
- Only the European orders
- All orders, through the server’s account
- No orders, without an MCP user
- All orders, then filtered by the model
Show the answer
Only the European orders
The server applies the user's database role and Virtual Private Database policies unchanged, so the agent reads only the European orders. “All orders, through the server’s account” is wrong, since the server has no account of its own that bypasses the user's rights. “No orders, without an MCP user” is wrong too, because the client signs in as a normal database user. And with “All orders, then filtered by the model”, the model would see rows that the policy should hide, which is never how the server works.
Fairhaven has a PL/SQL function that checks warehouse stock, and wants agents to call it through the MCP server. What should the team do?
- Rewrite it as a JavaScript function
- Add it to the AI profile’s object list
- Run a separate MCP server just for it
- Register it as a Select AI Agent tool
Show the answer
Register it as a Select AI Agent tool
Register the function as a Select AI Agent tool with the create tool procedure, and it becomes an MCP tool right away. “Rewrite it as a JavaScript function” would make things worse, since JavaScript functions from the Multilingual Engine are not supported as MCP tools. “Add it to the AI profile’s object list” would list objects for natural language to SQL, and a function is not a table. And “Run a separate MCP server just for it” would bring back a server to run, which the built-in server avoids.