Skip to main content
Glama
MCP Database Agent

MCP Database Agent

by iarsingh

MCP Database Agent

Overview

A tool-using agent lab built around MCP-style database tools. GET /tools lists three read-only tools, explain, sample_rows and list_indexes, and POST /call runs one of them. Calls that would apply changes or delete data are refused. A /v1 ops API adds workspaces, tenant isolation, job approval and audit records.

  • Built with: Python, pytest, GitHub Actions

  • Scope: Local laptop proof with read-only tools; it calls no hosted model and applies no production changes.

Related MCP server: @cano721/mysql-mcp-server

Project guide

Project architecture · Interview questions and answers

Use the architecture document for the component diagram, implementation boundaries, and verification entry points. The interview guide includes source-backed answers and project walkthroughs.

Implementation map

Component

Responsibility

src/mcpdb/main.py

HTTP handlers: GET /healthz, GET /tools, POST /call

src/mcpdb/mcp.py

Functions: list_tools, call

requirements.txt

Implementation or supporting configuration

src/mcpdb/__init__.py

Implementation or supporting configuration

tests/test_mcp.py

Executable checks and regression examples

.github/workflows/ci.yml

GitHub Actions job definitions

README.md

Project explanations or operating notes

Local setup and verification

From the repository root (the commands follow the checked-in manifests):

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python -m pytest -q

To serve the FastAPI application locally, install the server separately if it is not already available:

python -m pip install uvicorn
PYTHONPATH=src python -m uvicorn mcpdb.main:app --reload

Level: 10 — MCP & Tool-Using Agents

Skills: Python, read-only DB tools

Tools: explain, sample_rows, list_indexes. Apply/delete refused.

pip install -r requirements.txt
pytest -q

This is a local laptop proof. It does not call a hosted model and it does not apply production changes.

Ops plane

Workspaces, tenant isolation, job approval, and audit live under /v1. Production apply is refused. See docs/ARCHITECTURE.md.

Documentation checks

Project architecture, interview guides, and local source links are checked automatically on pushes and pull requests. Run the same check locally:

python3 .github/scripts/validate_project_docs.py

See service improvements and local run instructions.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides secure, read-only access to PostgreSQL databases for schema inspection and data querying. It enables users to list tables, describe structures, and execute SELECT statements while strictly blocking destructive operations.
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables read-only MySQL database access, allowing listing databases, tables, describing schemas, and executing SELECT/SHOW/DESCRIBE/EXPLAIN queries.
      7
      48 npm
      4
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables read-only PostgreSQL interaction through safe query execution, query planning, table and column inspection, and privilege checks, with multi-layer defenses against write operations and transaction-control exploits.
      5
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables read-only MySQL/MariaDB schema exploration and safe query cost estimation across multiple instances, with server-enforced write refusal and execution limits.
      Apache 2.0