Metadata-Version: 2.4
Name: oracle11g-mcp-server
Version: 1.0.7
Summary: Model Context Protocol server to access Oracle databases, supporting Oracle 11g and above.
Project-URL: Homepage, https://github.com/yourusername/oracle11g-mcp-server
Project-URL: Repository, https://github.com/yourusername/oracle11g-mcp-server
Project-URL: Issues, https://github.com/yourusername/oracle11g-mcp-server/issues
Author-email: MCP Oracle11g Server Team <mcp-oracle11g@example.com>
License: MIT License
        
        Copyright (c) 2025 OldFangDong
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: ai,database,mcp,model-context-protocol,oracle
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Requires-Dist: mcp[cli]>=1.5.0
Requires-Dist: oracledb>=3.0.0
Requires-Dist: python-dotenv>=1.0.1
Description-Content-Type: text/markdown

# Oracle11g MCP Server

[![PyPI version](https://badge.fury.io/py/oracle11g-mcp-server.svg)](https://badge.fury.io/py/oracle11g-mcp-server)
[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)

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.)
- **Security**: Built-in protections against dangerous operations
- **Connection Pooling**: Efficient database connection management
- **Async Support**: Full asynchronous operation support

## Installation

### Using uvx (Recommended)

```bash
uvx oracle11g-mcp-server
```

### Using pip

```bash
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`
- `LIB_DIR`: Path to your Oracle Instant Client directory
- `DQL_LIMITS_ROWS`: Maximum rows returned by SELECT queries (default: 10)

### MCP Configuration

Add this to your MCP client configuration (e.g., Cursor's `mcp.json`):

```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"
      }
    }
  }
}
```

## 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.)

## Development

### Setup

```bash
# 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

```bash
# Development mode with hot reload
uv run dev

# Production mode
uv run main
```

### Testing

```bash
# Run MCP inspector
pnpm run inspector
```

## License

MIT License - see [LICENSE](LICENSE) file for details.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

