Aifordatabase MCP logo

Aifordatabase MCP

Read-only database queries, natural-language SQL, workflows, dashboards, and usage through scoped API keys.

Install Aifordatabase MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "aifordatabase-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "aifordatabase-mcp"
      ],
      "env": {
        "AFD_API_KEY": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 9 tools correctly (5d ago).

Overview

The aifordatabase-mcp MCP server connects AI agents to AI for Database through scoped API keys rather than raw database credentials. It supports read-only access to Postgres, MySQL, MariaDB, MongoDB, SQL Server, and SQLite, with tools for schema inspection, SQL execution, natural-language questions, workflows, dashboards, and usage checks. Use it when an agent needs audited database access, scheduled alerts, or conversational querying while avoiding direct connection strings. The server runs through an MCP client using npx and requires an AFD_API_KEY.

Use cases

  • Query connected databases in plain English
  • Inspect schemas before writing SQL
  • Run audited read-only SQL queries
  • Schedule email or webhook database alerts
  • Check AI-credit usage before asking questions

Key features

  • Read-only access through scoped API keys
  • Natural-language SQL generation with conversational follow-ups
  • Direct audited SQL execution without AI credits
  • Schema and relationship inspection
  • Scheduled email or webhook workflows
  • Dashboard and usage visibility

Tools9

What Aifordatabase MCP lets your agent do. Expand a tool for its parameters.

Verified live~1.2k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

Not checked yetLast checked Today

We have not completed a health check for this listing yet.

4/33 checks healthy over the last 41d

What it can do

From the 9 tools this server returned when we ran it.

Handles credentials · 1Makes network requests · 1Read-only tools · 9
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceNot published
Package age103 days
Maintainers1

Observed 2026-10-18 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 16d ago via OSV.dev · aifordatabase-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads146Package downloads in the last 30 days.
Last commit3mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed9Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Aifordatabase MCP works

What aifordatabase-mcp MCP server does

The aifordatabase-mcp MCP server connects an MCP-compatible AI agent to AI for Database. Through that service, an agent can inspect configured database connections, retrieve table metadata, execute SQL, ask questions in plain English, manage scheduled workflows, view dashboards, and check its remaining AI-credit budget.

Supported database types listed by the project are Postgres, MySQL, MariaDB, MongoDB, SQL Server, and SQLite. Access is mediated by scoped afd_ API keys. The service is designed around read-only database access, query auditing, and a semantic layer for canonical metric definitions rather than giving an agent a raw connection string.

How it works

The agent calls list_connections to identify available connections, then can call get_schema to retrieve tables, columns, and relationships in one request. run_query sends SQL directly and is deterministic and audited without consuming AI credits. For natural-language requests, ask generates and executes SQL, returning the answer and results; a conversationId supports follow-up questions.

Workflow tools cover scheduled alerts and reports. A workflow can combine SQL condition steps with email or webhook actions on a cron schedule, and stopIfEmpty can make an empty query result the condition for an alert. run_workflow triggers one immediately. list_dashboards retrieves auto-refreshing dashboards, while get_usage reports the remaining AI-credit budget.

Setup and configuration

To run the aifordatabase-mcp MCP server, create an account at AI for Database, add a database connection, and create an API key with the scopes needed by the tools. The documented scopes are query, chat, connections, dashboards, workflows, and usage; * can request all scopes.

Install and launch it with npx aifordatabase-mcp. In Claude Code, pass AFD_API_KEY with the claude mcp add command. Other MCP clients can use a configuration with command: "npx", args: ["aifordatabase-mcp"], and the key in the env object. AFD_API_BASE optionally overrides the default API endpoint, https://app.aifordatabase.com/api/v1.

Tools and capabilities

Available tools include:

  • list_connections for connection metadata
  • get_schema for tables, columns, and relationships
  • run_query for direct SQL
  • ask for conversational natural-language querying
  • list_workflows, create_workflow, and run_workflow
  • list_dashboards for dashboard listings
  • get_usage for AI-credit status

Limitations and notes

The aifordatabase-mcp MCP server caps responses at 500 rows, so large datasets should be aggregated in SQL. Natural-language requests can consume AI credits; direct run_query calls do not. A 402 response indicates exhausted AI credits, while 403 indicates a missing scope or plan limit. Invalid SQL produces a 422 response containing the database error, and rate limits are documented as 60 requests per minute on the free plan and 300 on Pro. Missing or invalid keys produce 401 errors, and 429 responses require backing off.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Aifordatabase MCP

aifordatabase-mcp is an MCP server that connects AI agents to AI for Database and its configured Postgres, MySQL, MariaDB, MongoDB, SQL Server, or SQLite sources. Its main tools list connections, inspect schemas, run read-only SQL, answer plain-English questions, manage workflows, list dashboards, and report AI-credit usage.

Install it by configuring your MCP client to run `npx aifordatabase-mcp` and provide the `AFD_API_KEY` environment variable. Claude Code uses `claude mcp add`; Claude Desktop, Cursor, and other MCP clients can use the documented JSON configuration.

It requires `AFD_API_KEY`, which must be an `afd_` Bearer key created in AI for Database. `AFD_API_BASE` is optional and overrides the default API base URL.

Yes. Use `run_query` for direct, deterministic SQL execution without consuming AI credits. The `ask` tool generates SQL from plain-English input and can consume credits, so the server recommends falling back to `run_query` after a 402 credit-exhaustion response.

Yes. Cursor can run it through the standard MCP JSON configuration with `npx aifordatabase-mcp` and `AFD_API_KEY` in the environment.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewAifordatabase MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/aifordatabase-mcp?style=directory)](https://allmcps.com/mcp/aifordatabase-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/aifordatabase-mcp"><img src="https://allmcps.com/api/badge/aifordatabase-mcp?style=directory" alt="Aifordatabase MCP on AllMCPs" /></a>