semvec/pypi-packages huggingface dataset:
iflow-mcp_rahgadda-oracledb_mcp_server 0.1.0
MCP Server For Oracle Database
Requires Python: >=3.11


# OracleDB MCP Server

[![smithery badge](https://smithery.ai/badge/@rahgadda/oracledb_mcp_server)](https://smithery.ai/server/@rahgadda/oracledb_mcp_server) [![MseeP.ai Security Assessment Badge](https://mseep.net/mseep-audited.png)](https://mseep.ai/app/rahgadda-oracledb-mcp-server)

## Overview
- This project will install `MCP - Model Context Protocol Server`, that provides configured Oracle Database Table/Columns as context to LLM's.
- Using this we can enable LLMs to interact with Oracle Database, Generate SQL Statements and Return Results using LLM prompts.

## Installation
- Install package
  ```bash
  pip install oracledb_mcp_server
  ```
- Create .env in a folder with minimum value of `Oracle DB Connection String`. Sample file available [here](https://raw.githubusercontent.com/rahgadda/oracledb_mcp_server/refs/heads/main/.env)
- Test `oracledb_mcp_server` server using `uv run oracledb_mcp_server` from the above folder.

## Claud Desktop
- Configuration details for Claud Desktop
  ```json
  {
    "mcpServers": {
      "oracledb_mcp_server":{
        "command": "uv",
        "args": ["run","oracledb_mcp_server"],
        "env": {
            "DEBUG":"True",
            "COMMENT_DB_CONNECTION_STRING":"oracle+oracledb://USERNAME:PASSWORD@IP:PORT/?service_name=SERVICENAME",
            "DB_CONNECTION_STRING":"oracle+oracledb://USERNAME:PASSWORD@IP:PORT/?service_name=SERVICENAME",
            "TABLE_WHITE_LIST":"ACCOUNTS,CUS_ACC_RELATIONS,CUSTOMERS",
            "COLUMN_WHITE_LIST":"ACCOUNTS.ACC_AAD_ID,CUS_ACC_RELATIONS.CAR_CUS_ID,CUS_ACC_RELATIONS.CAR_AAD_ID,CUSTOMERS.CUS_ID"
        }
      }
    }
  }
  ```

### Configuration
- List of available environment variables
  - `DEBUG`: Enable debug logging (optional default is False)
  - `COMMENT_DB_CONNECTION_STRING`: Oracle DB connection String for comments. (required)
  - `DB_CONNECTION_STRING`: Oracle DB connection String for execution of queries. (required)
  - `TABLE_WHITE_LIST`: White Listed table names in list format ["table1", "table2"] (required)
  - `COLUMN_WHITE_LIST`: White Listed table-column names in list format ["table.column1", "table.column2"] (required)
  - `QUERY_LIMIT_SIZE`: Default value is 10 records if not provided(optional default is 10)

## Interceptor
```bash
npx @modelcontextprotocol/inspector uv --directory "D:\\MyDev\\mcp\\oracledb_mcp_server" run -m oracledb_mcp_server
```

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

## License
This project is licensed under the terms of the MIT license.

## Demo
![](./images/demo.png)

## Github Stars
[![Star History Chart](https://api.star-history.com/svg?repos=rahgadda/oracledb_mcp_server=Date)](https://star-history.com/#rahgadda/oracledb_mcp_server&Date)
django-admin-ext 3.0.2
Extensions to Django's admin site to add an ajax view.

Extensions to Django's admin site.

## Currently Includes:
 - `BaseCustomUrlAdmin`: hook to provide additional urls to your model admin.
 - `BaseAjaxModelAdmin`: hook to have a form that gets some of it's form fields dynamically depending on a certain field choice.
 - `BaseAjaxModelForm`: form to help setup and save dynamic fields based on other fields chosen.

## USAGE
Take a look at the example project for a more detailed example.

### BaseCustomUrlAdmin
  - in your `ModelAdmin`, subclass `BaseCustomUrlAdmin` and implement the `'get_custom_urls'` function

### BaseAjaxModelAdmin
  - in your `ModelAdmin`, subclass `BaseAjaxModelAdmin` and make sure your form is pointing to your dynamic form.
  - there will be a new url that ends with `/ajax/` that handles the ajax request.
  - Django's `ModelAdmin` will only display fields declared in a `fieldset` so we make sure the Ajax fields don't display when they don't have enough data to be present, and that they do display when they do. Because of this, we currently are not respecting any `fieldsets` you might have declared in your `ModelAdmin`. If you know of a good way to lift this restriction, please submit a patch.


### BaseAjaxModelForm
  - set the `ajax_change_field` to be the name of the form field whose change triggers the ajax call OR set the `ajax_change_fields` to a list of field names whose change triggers the ajax call
  - in your form, set the `dynamic_fields` property to return a dictionary whose keys are the field names and values are the instantiated fields.
    ```python
    @property
    def dynamic_fields(self):
        return {
            'my_field': CharField(initial="hello world!", label="Greeting"),
        }
    ```
  - when the change field is present either in a forms initial data or submitted data, the form will add all your dynamic fields to it, and when saving, the form will make sure all your dynamic field values are saved to the instance.
  - make sure the file in `djadmin_ext/static/djadmin_ext/admin_ajax.js` is available in your static content.
  - The ajax call gets the new form and replaces all the elements with the class of `.module` with the updated form.
  - **NOTE**: this will blow out any inline forms you have declared, so if you need inline forms, we'd be happy to accept a patch making it possible.

## Testing
To test the admin, we wrote playwright tests. The tests will try to start django's test server, open a browser, execute the tests and verify the actions on the page behave as expected.

```bash
python setup.py test
```