Prerequisites
- JDK 17+
- Maven 3.9+ (for building from source)
- Database access (for database tools)
- MCP client (Claude Desktop, Cline, etc.)
Building from Source
Build the JAR file:target/oracle-db-mcp-toolkit-1.0.0.jar
Transport Modes
The toolkit supports two transport modes:- stdio (default): Client spawns JVM process, communicates via stdin/stdout
- http: Server runs as HTTP service, clients connect via URL
stdio Mode (Default)
Best for local development and single-user scenarios.Basic Configuration
With Tool Selection
Enable specific tools only:With YAML Configuration
With Extra JDBC JARs
For wallets, token auth, or centralized config:Log Analysis Only (No Database)
Run without database connection:HTTP Mode
Best for remote access, multi-user environments, and production deployments.Basic HTTP Server
Start the server:http://localhost:8080/mcp (default)
HTTPS with TLS
Generate or obtain a PKCS12 certificate:https://localhost:45450/mcp
Supported Certificate Formats:
- PKCS12 (
.p12,.pfx) only
Client Configuration for HTTP
Cline (Streamable HTTP)
Claude Desktop (via mcp-remote)
Authentication
HTTP mode supports multiple authentication methods.Development Token (Testing Only)
Enable authentication without OAuth2:-
From environment variable (if set):
The token will be:
Secret_DeV_T0ken -
Auto-generated UUID (if env var not set):
Authorization header:
OAuth2 Configuration
For production deployments with OAuth2 introspection.Prerequisites
- OAuth2 server (e.g., Keycloak, Auth0, Okta)
- OAuth2 server must provide
/.well-known/oauth-authorization-server - Introspection endpoint that returns
{"active": true/false}
System Properties
| Property | Description | Required |
|---|---|---|
enableAuthentication | Enable authentication | Yes |
authServer | OAuth2 server URL | Yes |
introspectionEndpoint | Token introspection endpoint | Yes |
clientId | OAuth2 client ID | Yes |
clientSecret | OAuth2 client secret | Yes |
allowedHosts | CORS allowed origins (default: *) | No |
redirectOAuthToOpenID | Redirect to OpenID config (default: false) | No |
Example: Keycloak OAuth2
authServer: Your Keycloak realm URLintrospectionEndpoint: Token introspection endpointclientId: Registered client IDclientSecret: Client secret from KeycloakallowedHosts: Allowed CORS origins (e.g., MCP Inspector)
OpenID Configuration Redirect
Some OAuth2 servers only provide/.well-known/openid-configuration instead of /.well-known/oauth-authorization-server. Use the redirect workaround:
/.well-known/oauth-authorization-server that redirects to the OAuth server’s /.well-known/openid-configuration.
OAuth2 Flow
- Client requests
/.well-known/oauth-protected-resourcefrom MCP server - MCP server returns OAuth2 configuration
- Client obtains access token from OAuth2 server
- Client sends requests with
Authorization: Bearer <token> - MCP server validates token via introspection endpoint
- If
{"active": true}, request is processed
Testing with MCP Inspector
Use MCP Inspector to test OAuth2:Docker Deployment
Containerized deployment using Podman or Docker.Build Docker Image
Using the provided Dockerfile:Run HTTP Server in Container
https://<host-ip>:45451/mcp
With Extra JDBC JARs
Mount external JARs for wallets or token auth:stdio Mode in Container
Run with stdio transport (spawned by client):System Properties Reference
| Property | Required | Description | Example |
|---|---|---|---|
db.url | No* | JDBC URL | jdbc:oracle:thin:@host:1521/service |
db.user | No* | Database username | ADMIN |
db.password | No* | Database password | pass |
tools | No | Comma-separated tool list (default: all) | get-jdbc-stats,similarity_search |
configFile | No | Path to YAML config | /opt/mcp/config.yaml |
transport | No | Transport mode (default: stdio) | http |
https.port | No | HTTPS port | 45450 |
certificatePath | No | Path to PKCS12 certificate | /path/to/cert.p12 |
certificatePassword | No | Certificate password | changeit |
ojdbc.ext.dir | No | Directory for extra JARs | /opt/oracle/ext-jars |
enableAuthentication | No | Enable HTTP auth (default: false) | true |
authServer | No | OAuth2 server URL | http://localhost:8080/realms/mcp |
introspectionEndpoint | No | OAuth2 introspection endpoint | http://... |
clientId | No | OAuth2 client ID | oracle-db-toolkit |
clientSecret | No | OAuth2 client secret | secret |
allowedHosts | No | CORS allowed origins (default: *) | http://localhost:6274 |
redirectOAuthToOpenID | No | Redirect to OpenID config (default: false) | true |
db.url,db.user,db.passwordrequired only if database tools are enabled- Not required for log analysis tools only
- Not required if using token-based auth via
ojdbc.ext.dir
Security Best Practices
Database Credentials
- Use environment variables instead of hardcoding in config
- Rotate credentials regularly
- Use read-only accounts when possible
- Enable token-based auth for production (via
ojdbc.ext.dir)
Network Security
- Always use HTTPS in production (not HTTP)
- Use valid certificates (not self-signed) in production
- Configure firewalls to restrict access
- Use OAuth2 for authentication
- Set
allowedHoststo restrict CORS
Tool Security
- Limit enabled tools using
-Dtools - Review custom YAML tools for SQL injection risks
- Use parameterized queries only (YAML tools do this automatically)
- Audit logs regularly
Container Security
- Run as non-root user (Dockerfile should handle this)
- Use read-only mounts for certificates and JARs (
:roflag) - Don’t expose unnecessary ports
- Scan images for vulnerabilities
- Use secrets management for passwords (e.g., Kubernetes secrets)
Troubleshooting
Connection Refused
Symptom: Cannot connect to database Solutions:- Verify JDBC URL format
- Check database hostname, port, service name
- Ensure network connectivity
- Check firewall rules
- Verify credentials
Certificate Errors
Symptom: SSL/TLS handshake failures Solutions:- Ensure certificate is PKCS12 format (
.p12or.pfx) - Verify certificate password
- Check certificate validity dates
- For development, trust self-signed cert in client
Authentication Failed
Symptom: 401 Unauthorized Solutions:- Verify
enableAuthentication=true - Check token in
Authorization: Bearer <token>header - For OAuth2, verify introspection endpoint is reachable
- Check client ID and secret
- Verify token is active (not expired)
Port Already in Use
Symptom: “Address already in use” error Solutions:- Change port with
-Dhttps.port=<different-port> - Stop other services using the port
- Check for zombie processes
Tool Not Found
Symptom: “Tool X is not available” Solutions:- Check
-Dtoolslist includes the tool - Verify tool name spelling
- For custom YAML tools, check
configFilepath - Ensure YAML syntax is valid
Next Steps
Custom Tools
Define YAML-based SQL tools
Built-in Tools
Explore available tools
