MCP Db Context MCP Server

MCP Server for working with large Oracle databases

Local serverstdioPython

What is the MCP Db Context MCP server?

Most database access work still happens through a UI a human drives. MCP Db Context MCP server moves it into the conversation instead. 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

The tools it exposes

The server publishes 14 tools. What each one is for:

  • get_table_schema — Get detailed schema information for a specific table including columns, data types, nullability, and relationships. Example: Can you show me the
  • get_tables_schema — Get schema information for multiple tables at once. More efficient than calling get_table_schema multiple times. Example: Please provide the schemas
  • search_tables_schema — Search 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_cache — Force a rebuild of the schema cache. Use sparingly as this is resource-intensive. Example: The database structure has changed. Could you rebuild the
  • get_database_vendor_info — Get information about the connected Oracle database version and schema. Example: What Oracle database version are we running?
  • search_columns — Search 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
  • get_pl_sql_objects — Get information about PL/SQL objects like procedures, functions, packages, triggers, etc. Example: Show me all stored procedures that start with
  • get_object_source — Retrieve 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
  • get_table_constraints — Get all constraints (primary keys, foreign keys, unique constraints, check constraints) for a table. Example: What constraints are defined on the
  • get_table_indexes — Get all indexes defined on a table, helpful for query optimization. Example: Show me all indexes on the CUSTOMERS table
  • get_dependent_objects — Find all objects that depend on a specified database object. Example: What objects depend on the CUSTOMER_VIEW view?
  • get_user_defined_types — Get information about user-defined types in the database. Example: Show me all custom types defined in the schema

Getting it running

The server ships on PyPI as mcp-cli, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

What it needs from you

Configuration is passed through the environment: ORACLE_CONNECTION_STRING, TARGET_SCHEMA, CACHE_DIR, THICK_MODE, ORACLE_CLIENT_LIB_DIR, READ_ONLY_MODE, DEPARTMENT_ID. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

How it compares

This sits in the database access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. MCP Db Context's toolset — get_table_schema, get_tables_schema, search_tables_schema and 11 more — is a fair guide to whether it matches your workflow. It is maintained by danielmeppiel; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch MCP Db Context.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

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