You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/oracle-db-mcp-toolkit/README.md
+96-52Lines changed: 96 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# Oracle DB Toolbox MCP Server
1
+
# Oracle Database MCP Toolkit
2
2
3
3
## Overview
4
4
5
-
`oracle-db-toolbox-mcp-server` is a Model Context Protocol (MCP) server that lets you:
5
+
Oracle Database MCP Toolkit is a Model Context Protocol (MCP) server that lets you:
6
6
* Use 8 built-in tools to analyze Oracle JDBC thin client logs and RDBMS/SQLNet trace files.
7
7
* Optionally use **database-powered tools**, including **vector similarity search** and **SQL execution plan analysis**, when JDBC configuration is provided.
8
8
* Define your own custom tools via a simple YAML configuration file.
@@ -71,6 +71,56 @@ These tools operate on RDBMS/SQLNet trace files:
71
71
*`llmPrompt`: A structured prompt for an LLM to explain + tune the plan.
72
72
73
73
---
74
+
75
+
## Custom Tool Framework — Extending the MCP Server
76
+
The MCP server can load both database connection definitions and custom tool definitions from a YAML configuration file.
77
+
This provides a flexible and declarative way to extend the server without modifying or rebuilding the codebase.
78
+
79
+
A YAML file may define:
80
+
81
+
* One or more **sources:** — named database configurations (URL, user, password, etc.)
82
+
83
+
* One or more **tools** — each with parameters, SQL statements, and optional metadata
84
+
85
+
### Source Resolution Logic
86
+
87
+
When executing a tool, the MCP server determines which source to use based on the following rules:
88
+
89
+
1. If the tool specifies a source, that source is used.
90
+
91
+
2. If the tool does not specify a source, the server looks for a default source:
92
+
93
+
* First, it checks whether a source was provided via system properties (db.url, db.user, db.password) (Higher priority).
94
+
95
+
* If no system property source is available, it falls back to the first source defined in the YAML file, if present.
96
+
97
+
3. If no source can be resolved and the tool requires one (e.g., SQL-based tools), the server reports a configuration error.
98
+
99
+
This design ensures that tools always have a predictable source while giving you flexibility to choose how connections are provided—either inline in YAML or externally via system properties and environment variables.
100
+
101
+
**Example `config.yaml`:**
102
+
```yaml
103
+
sources:
104
+
prod-db:
105
+
url: jdbc:oracle:thin:@prod-host:1521/ORCLPDB1
106
+
user: ADMIN
107
+
password: ${password}
108
+
109
+
tools:
110
+
hotels-by-name:
111
+
source: prod-db
112
+
parameters:
113
+
- name: name
114
+
type: string
115
+
description: Hotel name to search for.
116
+
required: false
117
+
statement: SELECT * FROM hotels WHERE name LIKE '%' || :name || '%'
118
+
```
119
+
To enable YAML configuration, launch the server with:
This exposes the MCP endpoint at: `http://localhost:45450/mcp`.
138
188
139
-
###Note
140
-
You can enable HTTPS (SSL/TLS) by specifying the path to your certificate keystore and its password using the -DcertificatePath and -DcertificatePassword options.
141
-
Only PKCS12 (.p12 or .pfx) keystore format is supported.
142
-
You can also change the HTTPS port with the -DhttpsPort option (default is 45451).
189
+
#### Enabling HTTPS (SSL/TLS)
190
+
To enable HTTPS (SSL/TLS), specify your certificate keystore path and password using the `-DcertificatePath` and `-DcertificatePassword` options.
191
+
Only PKCS12 (`.p12` or `.pfx`) keystore files are supported.
192
+
You can set the HTTPS port with the `-Dhttps.port` option.
In the above example, we configured OAuth2 with a local KeyCloak server with a realm named `mcp`, and we only allowed a local [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector)
After starting the server, a UUID token will be generated and logged at <code>INFO</code> level:
240
290
@@ -246,7 +296,7 @@ WARNING: OAuth2 is not configured
246
296
Nov 25, 2025 3:30:46 PM com.oracle.database.jdbc.oauth.TokenGenerator <init>
247
297
INFO: Authorization token generated (for testing and development use only): 0dd11948-37a3-470f-911e-4cd8b3d6f69c
248
298
Nov 25, 2025 3:30:46 PM com.oracle.database.jdbc.OracleDBToolboxMCPServer startHttpServer
249
-
INFO: [oracle-db-toolbox-mcp-server] HTTP transport started on http://localhost:45450 (endpoint: http://localhost:45450/mcp)
299
+
INFO: [oracle-db-mcp-toolkit] HTTP transport started on http://localhost:45450 (endpoint: http://localhost:45450/mcp)
250
300
```
251
301
252
302
If `ORACLE_DB_TOOLBOX_AUTH_TOKEN` environment variable is set:
@@ -268,35 +318,6 @@ INFO: Authorization token generated (for testing and development use only): Secr
268
318
269
319
Ultimately, the token must be included in the http request header (e.g. `Authorization: Bearer 0dd11948-37a3-470f-911e-4cd8b3d6f69c` or `Authorization: Bearer Secret_DeV_T0ken`).
270
320
271
-
## YAML Configuration Support
272
-
273
-
The MCP server supports loading database connection and tool definitions from a YAML configuration file.
274
-
For sources, if a tool has a specific source it will use it. Otherwise, it will look for the default source which is either the source we got from system properties, otherwise, the first source defined in the file (if any).
275
-
This file can contain environment variables as well.
276
-
277
-
**Example `config.yaml`:**
278
-
```yaml
279
-
sources:
280
-
prod-db:
281
-
url: jdbc:oracle:thin:@prod-host:1521/ORCLPDB1
282
-
user: ADMIN
283
-
password: ${password}
284
-
285
-
tools:
286
-
hotels-by-name:
287
-
source: prod-db
288
-
parameters:
289
-
- name: name
290
-
type: string
291
-
description: Hotel name to search for.
292
-
required: false
293
-
statement: SELECT * FROM hotels WHERE name LIKE '%' || :name || '%'
294
-
```
295
-
To enable YAML configuration, launch the server with:
<description>The Oracle Database MCP Toolkit is a Model Context Protocol (MCP) server that enables users to analyze Oracle JDBC thin client logs and RDBMS/SQLNet trace files using built-in tools.
13
+
It also offers database-powered tools, such as vector similarity search and SQL execution plan analysis. Additionally, users can define custom tools through a YAML configuration file.</description>
0 commit comments