Oracle Kerberos MCP
Lightweight Oracle Database MCP server with native Kerberos SSO (thick mode) and read-only support.
GitHubTry this MCPSponsored
Documentation
oracle-kerberos-mcp
English | Português (Brasil)
Lightweight, zero-bloat Model Context Protocol (MCP) server for Oracle Database with native Kerberos SSO support (python-oracledb thick mode + externalauth=True), as well as standard username/password authentication.
Exposes the 7 standard Oracle inspection and query tools:
execute_sqllist_tableslist_active_sessionsget_query_planlist_top_sql_by_resourcelist_tablespace_usagelist_invalid_objects
Requirements
- Python 3.10+
oracledb(pip install oracledb)- For Kerberos SSO:
- Oracle Instant Client (e.g.
~/.local/oracle/instantclient_23_26) - Valid Kerberos ticket (
kinit) network/admin/sqlnet.oraconfigured withSQLNET.AUTHENTICATION_SERVICES=(KERBEROS5)
- Oracle Instant Client (e.g.
Installation
pip install -e .
Or run directly with PYTHONPATH=src python3 -m oracle_kerberos_mcp.server.
Configuration (mcp_config.json)
Kerberos SSO Mode
{
"mcpServers": {
"oracle-sso": {
"command": "python3",
"args": ["-m", "oracle_kerberos_mcp.server"],
"env": {
"PYTHONPATH": "/path/to/oracle-kerberos-mcp/src",
"ORACLE_CONNECTION_STRING": "dbhost.example.com:1521/service_name",
"ORACLE_SSO": "true",
"ORACLE_INSTANT_CLIENT_DIR": "/home/user/.local/oracle/instantclient_23_26"
}
}
}
}
Environment Variables
| Variable | Description |
|---|---|
ORACLE_CONNECTION_STRING | host:port/service_name (or ORACLE_DATABASE_HOST, ORACLE_DATABASE_PORT, ORACLE_DATABASE_SERVICE_NAME) |
ORACLE_SSO | Set to true to use Kerberos SSO (externalauth=True). Auto-enabled if ORACLE_USERNAME and ORACLE_PASSWORD are empty. |
ORACLE_USERNAME / ORACLE_PASSWORD | Standard credentials (used when ORACLE_SSO is not true). |
ORACLE_INSTANT_CLIENT_DIR | Path to Oracle Instant Client (defaults to ~/.local/oracle/instantclient_*). |
ORACLE_TNS_ADMIN | Path to network/admin containing sqlnet.ora (defaults to <instant_client>/network/admin). |
ORACLE_READ_ONLY | Set to true to block DML/DDL statements in execute_sql. |
Running Tests
PYTHONPATH=src python3 -m unittest discover -s tests -v