The OracleDB MCP Server is a Model Context Protocol Server that provides Oracle Database tables and columns as context to Large Language Models (LLMs). This enables LLMs to interact with Oracle databases, generate SQL statements, and return results using natural language prompts.
pip install oracledb_mcp_server
.env
file in your desired folder with at least the Oracle DB connection string.env
file: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
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
Run the server using the following command from the folder containing your .env
file:
uv run oracledb_mcp_server
Configure the server using these environment variables:
DEBUG
: Enable debug logging (optional, default is False)COMMENT_DB_CONNECTION_STRING
: Oracle DB connection string for comments (required)DB_CONNECTION_STRING
: Oracle DB connection string for executing queries (required)TABLE_WHITE_LIST
: Comma-separated list of whitelisted table names (required)COLUMN_WHITE_LIST
: Comma-separated list of whitelisted table-column names (required)QUERY_LIMIT_SIZE
: Maximum number of records to return (optional, default is 10)To configure the OracleDB MCP Server with Claude Desktop, add the following to your Claude Desktop 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"
}
}
}
}
You can inspect the MCP server using the MCP inspector tool:
npx @modelcontextprotocol/inspector uv --directory "PATH_TO_SERVER_DIRECTORY" run -m oracledb_mcp_server
Replace PATH_TO_SERVER_DIRECTORY
with the path to your OracleDB MCP Server directory.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.