feat: add Oracle MCP server with Docker support and configuration

This commit is contained in:
Marcelo Ochoa
2025-03-13 16:51:37 +00:00
parent 941266c05a
commit 9846ccc695
9 changed files with 691 additions and 6 deletions

81
src/oracle/README.md Normal file
View File

@@ -0,0 +1,81 @@
# Oracle
A Model Context Protocol server that provides read-only access to Oracle databases. This server enables LLMs to inspect database schemas and execute read-only queries.
## Components
### Tools
- **query**
- Execute read-only SQL queries against the connected database
- Input: `sql` (string): The SQL query to execute
- All queries are executed within a READ ONLY transaction
### Resources
The server provides schema information for each table in the database:
- **Table Schemas** (`oracle://<host>/<table>/schema`)
- JSON schema information for each table
- Includes column names and data types
- Automatically discovered from database metadata
## Usage with Claude Desktop
To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your `claude_desktop_config.json`:
### Docker
* when running docker on macos, use host.docker.internal if the server is running on the host network (eg localhost)
* username/password can be added to the oracle url with `oracle://host.docker.internal:1521/freepdb1`
```json
{
"mcpServers": {
"oracle": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"ORACLE_USER=hr",
"-e",
"ORACLE_PASSWORD=hr_2025",
"mcp/oracle",
"host.docker.internal:1521/freepdb1"]
}
}
}
```
### NPX
```json
{
"mcpServers": {
"oracle": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-oracle",
"host.docker.internal:1521/freepdb1"
]
}
}
}
```
Replace `/freepdb1` with your database name.
## Building
Docker:
```sh
docker build -t mcp/oracle -f src/oracle/Dockerfile .
```
## License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.