Loading video player...
Do you have an existing Oracle database with years of tables, procedures and functional code? Do you want to expose a piece of this database to LLMs to more rapidly assist users perform required actions? Are you curious to see how easy it is to develop with MCP against an Autonomous AI database in the Cloud? Then this 12 min. getting started video is for you. The example code and video below will walk you through an introductory look at how to create your first MCP server to access an Oracle Autonomous AI database leveraging python and FastMCP libraries. The video begins by creating a new database user inside a 26ai ATP-S database in the Cloud. Once created we will showcase how to create a connect to the user account via VS Code and quickly install a sample table, load data and installing a sample pl/sql procedure to be leveraged by our MCP server. Next we will show how to create a bash profile with the required connection information to access our 26ai database and install the required python libraries locally to run FastMCP. With the setup complete we will walk through step by step each line of code on how to create your first MCP tool. The tool will inputs a parameter, use the parameter in a query the returns values from a table as a json payload. With our first MCP Server tool ready, we will showcase how to access the tool from a command line client to test our connection to the 26ai database an check for the desired data results. With the baseline knowledge in hand we will add second MCP tool that demonstrates how to call a database procedure with multiple input and output variables. We will walk the viewer through how to properly annotate the input and output variables to help your LLM better understand the MCP tools desired action and how to interact with it. Finally we will add a third tool that inputs a table name and returns the tables column comments to help the LLM understand the context of the data returned from our query or to understand how to better query a table. With all the code ready, we will add our MCP server directly to our VS Code development environment the call it directly from the embedded co-pilot chat session to demonstrate how the LLM can leverage the tools individually or in multiple steps to perform a desired action on only a subset of 26ai database objects. Please note this code and demo should be compatible with 19c and or 23ai ADB-S databases and with slight modifications to connect strings most any Oracle database. Github Repo and Sample Instructions: https://github.com/chipbaber/oracleInstantMCP All the sample MCP Tool code is inside the file https://github.com/chipbaber/oracleInstantMCP/blob/main/26ai_fastmcp.py The following pre-req videos and links may also be of use to setup your environment: Install a 26ai database on OCI and learn how to access the Database Actions SQL Studio watch: https://youtu.be/a350ebLzyV0 To download and install the Oracle Instant Client, SQL*Plus and your a 26ai Database Wallet. Please watch this instructional video: https://youtu.be/DyJRgrMDPx8 Follow the steps in this video install Visual Studio Code, connect to co-pilot and Oracle VS Studio plugin. https://www.youtube.com/watch?v=TvQb7H11zYM&list=PLsnBif_-5JnA8Hzvp8e1bQ3fo6VEvYEB0&index=4&pp=gAQBiAQB #codeinnovate #mcp #26ai #oracle #development #python