- Home
- MCP servers
- OracleDB
OracleDB
- python
34
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"rahgadda-oracledb_mcp_server": {
"command": "uv",
"args": [
"run",
"oracledb_mcp_server"
],
"env": {
"DEBUG": "True",
"QUERY_LIMIT_SIZE": "10",
"TABLE_WHITE_LIST": "ACCOUNTS,CUS_ACC_RELATIONS,CUSTOMERS",
"COLUMN_WHITE_LIST": "ACCOUNTS.ACC_AAD_ID,CUS_ACC_RELATIONS.CAR_CUS_ID,CUS_ACC_RELATIONS.CAR_AAD_ID,CUSTOMERS.CUS_ID",
"DB_CONNECTION_STRING": "oracle+oracledb://USERNAME:PASSWORD@IP:PORT/?service_name=SERVICENAME",
"COMMENT_DB_CONNECTION_STRING": "oracle+oracledb://USERNAME:PASSWORD@IP:PORT/?service_name=SERVICENAME"
}
}
}
}You can use the OracleDB MCP Server to expose Oracle Database tables and columns as context for language models. This enables LLMs to generate SQL, query Oracle data, and return results based on your configured access controls.
How to use
Start by running the local MCP server and connecting it to your MCP client. You can configure a white list of tables and columns to control what your LLMs can access. Use the MCP client to issue prompts that request data context or SQL actions, and you’ll receive structured results that reflect your Oracle schema and the allowed scope.
How to install
Prerequisites: you need Python and pip installed on your system. You may also want a terminal or command prompt with access to uv (the Universal Viewer) if you plan to run the server in a development environment.
Install the MCP server package with Python’s package manager.
pip install oracledb_mcp_server
Create a project folder and add a .env file containing your Oracle DB connection details and access controls. At minimum you should provide a connection string that the server can use to execute queries, along with white lists for tables and columns.
Test running the server locally using the following command from the project folder.
uv run oracledb_mcp_server
Additional configuration and usage notes
Configuration details shown below specify how to run the MCP server locally and what environment variables you can set to control behavior and access.
Configuration
{
"mcpServers": {
"oracledb_mcp_server":{
"command": "uv",
"args": ["run","oracledb_mcp_server"],
"env": {
"DEBUG":"True",
"COMMENT_DB_CONNECTION_STRING":"oracle+oracledb://USERNAME:PASSWORD@IP:PORT/?service_name=SERVICENAME",
"DB_CONNECTION_STRING":"oracle+oracledb://USERNAME:PASSWORD@IP:PORT/?service_name=SERVICENAME",
"TABLE_WHITE_LIST":"ACCOUNTS,CUS_ACC_RELATIONS,CUSTOMERS",
"COLUMN_WHITE_LIST":"ACCOUNTS.ACC_AAD_ID,CUS_ACC_RELATIONS.CAR_CUS_ID,CUS_ACC_RELATIONS.CAR_AAD_ID,CUSTOMERS.CUS_ID"
}
}
}
}
Interceptor
If you use the MCP inspection tool to monitor or configure the server, you can run the inspector with its own command line as shown.
npx @modelcontextprotocol/inspector uv --directory "D:\\MyDev\\mcp\\oracledb_mcp_server" run -m oracledb_mcp_server
Security and best practices
Limit the TABLE_WHITE_LIST and COLUMN_WHITE_LIST to only the tables and columns your LLM needs. Keep sensitive data out of scope unless explicitly required. Use separate environments for development and production and store credentials securely in your environment management system.
Troubleshooting
If the server does not start, verify that your Oracle DB connection strings are correct and that the required environment variables are set. Check that the port used by uv is not blocked and that the MCP client can reach the local server. Review the DEBUG log flag to surface additional information for diagnosis.
Notes
The server is designed to provide configured Oracle database context to language models, enabling dynamic SQL generation and result retrieval based on your defined white lists.
Available tools
QueryContext
Expose configured tables/columns as context for the MCP client to generate and execute SQL against Oracle DB