Oracle11g MCP Server
Model Context Protocol (MCP) server for Oracle databases, supporting Oracle 11g and above. This server enables AI models to interact with Oracle databases through a standardized protocol.
Features
- Database Operations: List tables, describe table structures, execute SQL queries
- DDL Support: Execute Data Definition Language statements (CREATE, ALTER, DROP, etc.)
- DML Support: Execute Data Manipulation Language statements (INSERT, UPDATE, DELETE, MERGE, etc.)
- Security: Built-in protections against dangerous operations
- Connection Pooling: Efficient database connection management
- Async Support: Full asynchronous operation support
Installation
Using uvx (Recommended)
uvx oracle11g-mcp-server
Using pip
pip install oracle11g-mcp-server
Prerequisites
- Python 3.12 or higher
- Oracle Instant Client
- Oracle database (11g or higher)
Configuration
Environment Variables
Create a .env file or set the following environment variables:
ORACLE_CONNECTION_STRING: Your Oracle database connection string- Format:
username/password@hostname:port/service_name
- Format:
LIB_DIR: Path to your Oracle Instant Client directoryDQL_LIMITS_ROWS: Maximum rows returned by SELECT queries (default: 10)DDL_ENABLE: Enable DDL operations (Y/N, default: N)DML_ENABLE: Enable DML operations (Y/N, default: N)
MCP Configuration
Add this to your MCP client configuration (e.g., Cursor's mcp.json):
{
"mcpServers": {
"oracle11g-mcp-server": {
"command": "uvx",
"args": ["oracle11g-mcp-server"],
"env": {
"ORACLE_CONNECTION_STRING": "username/password@hostname:port/service_name",
"LIB_DIR": "/path/to/instantclient",
"DQL_LIMITS_ROWS": "1000",
"DDL_ENABLE": "Y",
"DML_ENABLE": "Y"
}
}
}
}
Available Tools
- list_tables: Get a list of all tables in the database
- describe_table: Get detailed information about a table's structure
- execute_DQL: Execute SELECT queries to read data
- execute_DDL: Execute DDL statements (CREATE, ALTER, DROP, etc.) - requires DDL_ENABLE=Y
- execute_DML: Execute DML statements (INSERT, UPDATE, DELETE, MERGE, etc.) - requires DML_ENABLE=Y
Security Features
- DDL Protection: DDL operations are disabled by default. Set
DDL_ENABLE=Yto enable them. - DML Protection: DML operations are disabled by default. Set
DML_ENABLE=Yto enable them. - Dangerous Operation Prevention: Blocks potentially harmful operations like
DROP DATABASE,DROP TABLESPACE,DROP USER. - Query Validation: Validates SQL syntax and prevents non-DDL queries from being executed via DDL endpoint.
- Connection Pooling: Uses secure connection pooling to manage database connections efficiently.
Development
Setup
# Clone the repository
git clone https://github.com/yourusername/oracle11g-mcp-server.git
cd oracle11g-mcp-server
# Install dependencies
uv pip install -e .
# Install Node.js dependencies for inspector
pnpm install
Running
# Development mode with hot reload
uv run dev
# Production mode
uv run main
Testing
# Run MCP inspector
pnpm run inspector
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Metadata
Release files for oracle11g-mcp-server 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oracle11g_mcp_server-1.1.0.tar.gz | 32.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oracle11g_mcp_server-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.8 kB
Release files / oracle11g_mcp_server-1.1.0.tar.gz
| Download URL | oracle11g_mcp_server-1.1.0.tar.gz |
|---|---|
| Size | 32.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0aaa1c5bfbb090009c19269b0a803c9925f7626ab70ca9251b69020f7ead202e
|
|
BLAKE2b-256 checksum How to use checksums |
7a41a048751bd43462424c639e7c2f88490c5e3162a6f6b1bbd5355c309f105f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Release files / oracle11g_mcp_server-1.1.0-py3-none-any.whl
| Download URL | oracle11g_mcp_server-1.1.0-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3841637ccaca845db661d708d3d2e82cea6dae76d37c5050c1799ffbc869a820
|
|
BLAKE2b-256 checksum How to use checksums |
3cb40d568d2a53ac2035a439666665e0b392d9ca01c4add967cb0bbbc55dcc71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|