MCP Db Context MCP Server

MCP Server for working with large Oracle databases

Local serverstdioPython

What is the MCP Db Context MCP Server?

MCP Server for working with large Oracle databases

The short version

A powerful Model Context Protocol (MCP) server that provides contextual database schema information for large Oracle databases, enabling AI assistants to understand and work with databases containing thousands of tables.

The MCP Oracle DB Context server solves a critical challenge when working with very large Oracle databases: how to provide AI models with accurate, relevant database schema information without overwhelming them with tens of thousands of tables and relationships.

  • Smart Schema Caching — Builds and maintains a local cache of your database schema to minimize database queries
  • Targeted Schema Lookup — Retrieve schema for specific tables without loading the entire database structure
  • Table Search — Find tables by name pattern matching
  • Relationship Mapping — Understand foreign key relationships between tables
  • Oracle Database Support — Built specifically for Oracle databases
  • MCP Integration — Works seamlessly with GitHub Copilot in VSCode, Claude, ChatGPT, and other AI assistants that support MCP

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
get_table_schemaGet detailed schema information for a specific table including columns, data types, nullability, and relationships. Example: Can you show me the schema for the EMPLOYEES table?
get_tables_schemaGet schema information for multiple tables at once. More efficient than calling get_table_schema multiple times. Example: Please provide the schemas for both EMPLOYEES and DEPARTMENTS tables.
search_tables_schemaSearch for tables by name pattern and retrieve their schemas. Example: Find all tables that might be related to customers and show their schemas.
rebuild_schema_cacheForce a rebuild of the schema cache. Use sparingly as this is resource-intensive. Example: The database structure has changed. Could you rebuild the schema cache?
get_database_vendor_infoGet information about the connected Oracle database version and schema. Example: What Oracle database version are we running?
search_columnsSearch for tables containing columns that match a specific term. Useful when you know what data you need but aren't sure which tables contain it. Example: Which tables have columns related to customer_id?
get_pl_sql_objectsGet information about PL/SQL objects like procedures, functions, packages, triggers, etc. Example: Show me all stored procedures that start with 'CUSTOMER_'
get_object_sourceRetrieve the source code for a PL/SQL object. Useful for debugging and understanding database logic. Example: Can you show me the source code for the CUSTOMER_UPDATE_PROC procedure?
get_table_constraintsGet all constraints (primary keys, foreign keys, unique constraints, check constraints) for a table. Example: What constraints are defined on the ORDERS table?
get_table_indexesGet all indexes defined on a table, helpful for query optimization. Example: Show me all indexes on the CUSTOMERS table.
get_dependent_objectsFind all objects that depend on a specified database object. Example: What objects depend on the CUSTOMER_VIEW view?
get_user_defined_typesGet information about user-defined types in the database. Example: Show me all custom types defined in the schema.
get_related_tablesGet all tables that are related to a specified table through foreign keys, showing both incoming and outgoing relationships. Example: What tables are related to the ORDERS table?
run_sql_queryExecute a SQL query and return the results in a formatted table. Example: Can you run this query for me? SELECT * FROM EMPLOYEES WHERE DEPARTMENT_ID = 10

How to install the MCP Db Context MCP Server

{
  "mcpServers": {
    "db-context": {
      "command": "uvx",
      "args": ["mcp-cli"],
      "env": {
        "ORACLE_CONNECTION_STRING": "your-value",
        "TARGET_SCHEMA": "your-value",
        "CACHE_DIR": "your-value",
        "THICK_MODE": "your-value",
        "ORACLE_CLIENT_LIB_DIR": "your-value",
        "READ_ONLY_MODE": "your-value",
        "DEPARTMENT_ID": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
ORACLE_CONNECTION_STRINGConfiguration value read at startup.Optional
TARGET_SCHEMAConfiguration value read at startup.Optional
CACHE_DIRFilesystem location the server is allowed to use.Optional
THICK_MODEConfiguration value read at startup.Optional
ORACLE_CLIENT_LIB_DIRFilesystem location the server is allowed to use.Optional
READ_ONLY_MODEConfiguration value read at startup.Optional
DEPARTMENT_IDConfiguration value read at startup.Optional

Example prompts to try

  • “Use MCP Db Context to get table schema.”
  • “Use MCP Db Context to get tables schema.”
  • “Use MCP Db Context to search tables schema.”

Frequently asked questions

The server runs in read‑only mode by default (`READ_ONLY_MODE=1`), allowing only SELECT statements. Write operations (INSERT, UPDATE, DELETE) are blocked unless explicitly disabled by setting `READ_ONLY_MODE="0"`.