# gateway

> MCP Server

CentralMind Gateway simplifies exposing databases to AI agents via MCP or OpenAPI. It generates AI-optimized APIs, filters sensitive data for compliance, and provides fast, secure data access for LLM-powered applications.

## Overview

- **Category:** Communication
- **Language:** Go
- **Stars:** 544
- **Forks:** 12
- **Owner:** centralmind
- **GitHub:** https://github.com/centralmind/gateway
- **Homepage:** https://centralmind.ai
- **Created:** 2025-02-10T19:34:14+00:00
- **Updated:** 2025-03-28T19:02:39+00:00
- **Source:** https://model-context-protocol.com/servers/ai-agent-database-gateway-llm-api

## Setup

## Setup

1.  Clone the repository: `git clone https://github.com/centralmind/gateway.git`
2.  Navigate to project directory: `cd gateway`
3.  Install dependencies: `go mod download`
4.  Build the project: `go build .`

**API Generation:**

1.  Choose a supported AI provider (OpenAI, Anthropic, Amazon Bedrock, Google Vertex AI, Google Gemini).
2.  Configure AI provider authorization (e.g., set `GEMINI_API_KEY='yourkey'` for Google Gemini).
3.  Run the discovery command: `./gateway discover --ai-provider gemini --connection-string "postgresql://neondb_owner:MY_PASSWORD@MY_HOST.neon.tech/neondb?sslmode=require" --prompt "Generate for me awesome readonly API"`
4.  Review the generated configuration in `gateway.yaml`.

**Running the API:**

1.  Run locally: `./gateway start --config gateway.yaml rest`
2.  Docker Compose: `docker compose -f ./example/simple/docker-compose.yml up`

**MCP Protocol Integration:**

1.  Build the gateway binary: `go build .`
2.  Configure Claude Desktop tool configuration with the path to the gateway binary and YAML config.

## Tools

## Available Tools

1.  **Automatic API Generation** (Creates APIs automatically using LLM based on table schema and sampled data)
2.  **Structured Database Support** (Supports PostgreSQL, MySQL, ClickHouse, Snowflake, MSSQL, BigQuery, Oracle Database, SQLite, ElasticSearch)
3.  **Multiple Protocol Support** (Provides APIs as REST or MCP Server including SSE mode)
4.  **API Documentation** (Auto-generated Swagger documentation and OpenAPI 3.1.0 specification)
5.  **PII Protection** (Implements regex plugin or Microsoft Presidio plugin for PII and sensitive data redaction)
6.  **Flexible Configuration** (Easily extensible via YAML configuration and plugin system)
7.  **Deployment Options** (Run as a binary or Docker container with ready-to-use Helm chart)
8.  **Multiple AI Providers Support** (Support for OpenAI, Anthropic, Amazon Bedrock, Google Gemini & Google VertexAI)
9.  **Local & On-Premises** (Support for self-hosted LLMs through configurable AI endpoints and models)
10. **Row-Level Security (RLS)** (Fine-grained data access control using Lua scripts)
11. **Authentication Options** (Built-in support for API keys and OAuth)
12. **Comprehensive Monitoring** (Integration with OpenTelemetry (OTel) for request tracking and audit trails)
13. **Performance Optimization** (Implements time-based and LRU caching strategies)
