MCP cover image
See in Github
2025-03-19

1

Github Watches

0

Github Forks

0

Github Stars

Database Analyzer MCP Server

A powerful database analysis tool that provides an MCP (Model Context Protocol) server interface for PostgreSQL database introspection and analysis. This tool allows you to explore database schemas, relationships, and execute safe queries through a standardized interface.

Features

  • Database Schema Analysis

    • List all tables in a specified schema
    • Get detailed schema information for specific tables
    • View column definitions, data types, and constraints
  • Safe Query Execution

    • Execute SELECT queries with parameterized inputs
    • Built-in security measures to prevent unauthorized modifications

Prerequisites

  • Python 3.x
  • PostgreSQL database
  • Required Python packages:
    • mcp (Model Context Protocol)
    • psycopg2 (PostgreSQL adapter)
    • python-dotenv (Environment variable management)

Installation

  1. Clone the repository:
git clone <repository-url>
cd MCP-server-demo
  1. Install the required packages:
pip install -r requirements.txt
  1. Create a .env file in the project root with your database credentials:
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=your_database_name
POSTGRES_USER=your_username
POSTGRES_PASSWORD=your_password

Usage

  1. Start the MCP server:
python server.py
  1. The server provides the following tools:

Security Features

  • Only SELECT queries are allowed for security reasons
  • Parameterized queries to prevent SQL injection
  • Environment variable-based configuration for sensitive data
  • Automatic connection cleanup and resource management

Error Handling

The server includes comprehensive error handling for:

  • Database connection issues
  • Invalid queries
  • Schema access problems
  • Resource cleanup

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • modelcontextprotocol
  • 模型上下文协议服务器

  • OffchainLabs
  • 进行以太坊的实施

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

    Reviews

    5 (1)
    Avatar
    user_bbFosYQ7
    2025-04-15

    GitHubTestRepo is a fantastic tool for managing repositories efficiently. The interface is user-friendly and intuitive, making it accessible for both beginners and experienced users. The seamless integration with other development tools is also a big plus. Kudos to biswapm for an exceptional product! Highly recommended for anyone looking to streamline their GitHub workflow.