CentralMind Gateway Documentation

repository·main·Indexed 19 days ago

https://github.com/centralmind/gateway

A tool that exposes structured databases to AI agents via the Model Context Protocol (MCP) or OpenAPI 3.1. It features an AI-driven discovery phase to automatically generate optimized, secure, and schema-aware API configurations (gateway.yaml) from database schemas. Supported connectors include Postgres, MySQL, BigQuery, ClickHouse, and DuckDB. The gateway can be deployed as a REST API server, an MCP SSE server, or via stdio for direct AI agent integration.

Tokens
51.7K
Snippets
191
Records
256
Agent score
68%

What's inside CentralMind Gateway

  1. Overview of the Presidio Anonymizer Plugin

    main

    The Presidio Anonymizer Plugin integrates with Microsoft's Presidio to detect and anonymize sensitive PII (Personally Identifiable Information) within your data fields.

    It operates in two stages:

    1. Detection: Uses the Presidio Analyzer API to identify PII entities.
    2. Anonymization: Uses the Presidio Anonymizer API to apply transformations to the detected entities based on your configured rules.

    If no PII is detected, the original data is returned unchanged.

  2. Planned Roadmap for Centralmind/Gateway

    main

    The following features are planned for future releases and are subject to change based on user feedback:

    Database and Connectivity

    • Extended Database Integrations: Support for Databricks, Redshift, S3 (Iceberg and Parquet), Oracle DB, Microsoft SQL Server, and Elasticsearch.
    • SSH tunneling: Ability to use a jumphost or SSH bastion to tunnel connections.

    Enhanced Functionality

    • Advanced Query Capabilities: Complex filtering syntax and aggregation functions passed as parameters.
    • Enhanced MCP Security: Implementation of API key and OAuth authentication.

    Platform Improvements

    • Schema Management: Automated schema evolution and API versioning.
    • Advanced Traffic Management: Intelligent rate limiting and request throttling.
    • Write Operations Support: Support for Insert and Update operations.
  3. Understand the Starlight Starter Kit project structure

    main

    The project follows a standard Astro + Starlight structure. Key directories and files include:

    • src/content/docs/: This is where you create your documentation. Starlight exposes every .md or .mdx file in this directory as a route based on its filename.
    • src/assets/: Place images here to embed them in your Markdown using relative links.
    • public/: Place static assets that do not need processing (like favicons) here.
    • astro.config.mjs: The main configuration file for the Astro project.
    • package.json: Defines dependencies and scripts.
    .
    ├── public/
    ├── src/
    │   ├── assets/
    │   ├── content/
    │   │   ├── docs/
    │   │   └── config.ts
    │   └── env.d.ts
    ├── astro.config.mjs
    ├── package.json
    └── tsconfig.json
  4. Features of the SQLite connector

    main

    The SQLite connector provides the following capabilities:

    • Database Types: Supports both file-based and in-memory SQLite databases.
    • Access Control: Supports read-only mode.
    • Querying: Supports named parameter syntax in queries (e.g., using :param).
    • Introspection: Provides automatic table discovery and column type inference.
    • Integrity: Supports transactions.
  5. Supported AI Providers and Recommended Models

    main

    CentralMind Gateway supports several AI providers. For optimal performance, the following models are recommended:

    • OpenAI: o3-mini (Supports all OpenAI-compatible providers via custom endpoints)
    • Anthropic: Claude 3.7
    • Amazon Bedrock
    • Google Vertex AI (Anthropic)
    • Google Gemini: Gemini 2.0 Flash Thinking (Note: Gemini provides a generous free tier).

    Detailed documentation for specific providers can be found in their respective sub-guides.

  6. BigQuery connector features and limitations

    main

    Features

    • Table discovery: Automatically find tables within the dataset.
    • Query execution: Run queries using parameters.
    • Schema inference: Automatically determine the schema of the data.
    • Row sampling: Retrieve samples of rows from tables.

    Limitations

    • No Primary Keys: BigQuery does not support traditional primary keys.
    • Credential Format: Credentials must be provided specifically as a JSON string.
    • Feature Support: BigQuery-specific features like clustering and partitioning are not exposed through this connector.
  7. Core Features of CentralMind Gateway

    main

    CentralMind Gateway is an AI-first data gateway designed to bridge structured databases and LLM applications. Key capabilities include:

    • Automatic API Generation: Uses LLMs to create APIs from table schemas.
    • Multi-Protocol Support: Exposes data via REST or MCP (Model Context Protocol).
    • Security & Compliance: Automatic PII cleanup using regex and Row-Level Security (RLS) via Lua scripts.
    • AI Optimization: Supports OpenAPI 3.1.0 and provides extra metadata via MCP to help agents understand the API.
    • Observability: Built-in OpenTelemetry (OTel) support for auditing and tracking.
    • Performance: Supports time-based and LRU caching.
  8. What is the PII Remover Plugin

    main
    The PII Remover is an Interceptor plugin designed to scan query results and automatically remove or mask Personally Identifiable Information (PII). It works by matching data against specified field patterns and custom regex-based detection rules to ensure sensitive information is not exposed in query outputs.
  9. Authentication methods for Elasticsearch

    main

    The Elasticsearch connector supports three authentication patterns:

    1. Basic Authentication: Provide user and password.
    2. API Key Authentication: Provide api_key. When using this method, you must omit both user and password.
    3. No Authentication: Used primarily for local development.

    For Elastic Cloud deployments, use the cloud_id parameter instead of the hosts list.

    connection:
        type: elasticsearch
        cloud_id: deployment:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyQ0ZmE...
        api_key: your_api_key
  10. Use in-memory DuckDB databases

    main

    You can run DuckDB in-memory mode, which is useful for transient data or testing. There are three ways to configure this:

    1. Using the memory flag (Recommended):
      connection:
        type: duckdb
        memory: true
    2. Using a direct connection string:
      connection:
        type: duckdb
        conn_string: ":memory:"
    3. Empty connection section: An empty connection: block defaults to in-memory mode.

    Note: In-memory databases do not have the READ_ONLY restriction, but allow_community_extensions is still set to false for security.

    connection:
      type: duckdb
      memory: true