Skip to main content
Glama
ThinAir Data

ThinAir Data

Official

ThinAir Data MCP Server

The only MCP database server for PostgreSQL, MySQL, and SQL Server in one session — 26 tools across 4 tiers — schema introspection, cross-database compare, query firewall, PII scanning, N+1 detection, and runtime connection management. Read-only data access by design.

26 tools · PostgreSQL · MySQL · SQL Server · Read-only data access, schema discovery, profiling, SQL safety, anomaly detection

npm version License: MIT

> describe_schema("fleet")
✓ 42 tables discovered · 6 high-value entities
✓ no write permissions enabled
> ask("Which vehicles had the most idle time last week?")
✓ generated safe read-only SQL · returned 10 rows · flagged 3 exceptions

Part of ThinAir

ThinAir Data is part of the ThinAir platform for fleet visibility, analytics, operational search, reporting, and AI-assisted decision support.

Related MCP server: ThinAir Geo

Hosted product vs this repository

  • data.thinair.co is the hosted ThinAir product.

  • This repository is the thin public MCP package/pointer for developers and AI-agent clients.

  • Production use may require a ThinAir account, API key, OAuth connection, or hosted workspace.

What It Does

ThinAir Data is a Model Context Protocol (MCP) server that gives AI agents secure, read-only access to your databases — no custom backend required. Designed for read-only production access when configured correctly. ThinAir Data enforces read-only behavior through SQL guards, database-session read-only mode where supported, and optional per-connection firewall rules. You should still use least-privilege database credentials and avoid exposing sensitive tables unless required.

  • Multi-database — PostgreSQL, MySQL, SQL Server in a single session. Cross-database compare with one tool call.

  • Read-only by design — SQL guards, database-session read-only mode where supported, and optional per-connection firewall rules.

  • Dialect-aware — every tool understands SELECT TOP 10 (mssql) vs LIMIT (others) and routes syntax correctly per connection.

  • Tiered capability — 26 tools across 4 tiers: schema introspection, query execution + history, EXPLAIN/optimization, anomaly detection, PII scanning, N+1 detection, query firewall, cross-DB compare, and runtime connection management (add/remove).

  • Connections are managed at runtime — added per-tenant via the add_connection tool after sign-in. Never an env var or install-time config.

Agent Discovery

Autonomous agents and directory crawlers can discover this server's capabilities without parsing this README. All three surfaces are live and served by the hosted product:

Surface

URL

Carries

Agent card (A2A)

https://data.thinair.co/.well-known/agent-card.json

Protocol version, endpoint, transport, auth schemes, and all 26 skills

Skills index

https://data.thinair.co/.well-known/skills.json

Machine-readable catalog of the 26 tools

LLM guide

https://data.thinair.co/llms.txt

Plain-text orientation for language models

The MCP endpoint itself is https://data.thinair.co/mcp (streamable-http; OAuth 2.1 keyless, or Authorization: Bearer).

Tools (selected — full list of 26 in docs)

Tool

Tier

Description

list_connections

discover

List connected databases with names + dialects

describe_schema

discover

Introspect tables, columns, types, primary keys, and indexes for a connection (foreign keys are not reported; MySQL indexes not yet)

query_sql

discover

Execute a parameterized read-only SQL query

query_history

build

Recent queries with timing, row counts, status

data_profile

build

Distributions, null rates, cardinality on a table

cross_db_query

architect

Run the same query across 2–4 connections (regional/dialect compare)

detect_anomalies

discover

Statistical outliers in row growth, latency, value distributions

pii_scan

build

Scan a table for PII patterns (SSN, email, phone, credit card)

find_n_plus_one

architect

Identify N+1 query patterns in query_history

query_firewall

architect

Per-connection custom-block rules (deny specific tables/queries)

add_connection, remove_connection, optimize_query, explain_query, suggest_queries, generate_migration, generate_seed_data, watch_table, saved_queries, impact_analysis, configure_allowlist, and others round out the 26-tool surface.

Quick Start

Add to your client's MCP config (e.g. ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "thinair-data": {
      "url": "https://data.thinair.co/mcp"
    }
  }
}

The OAuth flow completes at first use — no manual token setup required. After sign-in, your agent calls add_connection to register a database with its DSN — connections are tenant-scoped and reusable across sessions.

API key (for non-OAuth clients)

{
  "mcpServers": {
    "thinair-data": {
      "url": "https://data.thinair.co/mcp",
      "headers": {
        "Authorization": "Bearer ta_live_..."
      }
    }
  }
}

Get a key at https://data.thinair.co/connect.

npx (CLI / scripts)

npx -y @thinairtelematics/data

Prints a config block to stdout. OAuth-keyless by default.

Supported Databases

Database connections are added at runtime via the add_connection MCP tool — pass the DSN once, the connection becomes a named resource the agent can reuse across sessions. Three dialects supported:

Database

Connection string format

PostgreSQL

postgresql://user:pass@host:5432/db

MySQL

mysql://user:pass@host:3306/db

SQL Server

sqlserver://user:pass@host:1433/db

You do not put a DSN in your client's config. The add_connection tool is how connections enter the session.

Example Usage

Once connected, ask your AI:

  • "Show me all rows that haven’t updated in the last 24 hours across staging and prod"

  • "What are the top 10 slowest queries this week?"

  • "Scan the customers table for PII patterns"

  • "Which tables have the most N+1 query exposure?"

Not for secrets

Do not commit DSNs, passwords, tokens, private keys, or production credentials. Use OAuth, the hosted connection flow, or your MCP client's secret storage.

npm Package

npmjs.com/package/@thinairtelematics/data

Previously published as thinair-data (now deprecated in favor of the scoped package).

License

MIT © ThinAir Telematics

Available Tools

23 tools
analyze_tableA

QUICK statistical snapshot for ONE table — row count, null rates, cardinality, numeric min/max/avg, date ranges. Optionally drill into a specific column. Use data_profile when the user wants a FULL quality report including PII detection.

NameRequiredDescriptionDefault

No parameters

cross_db_queryA

Run a federated query across multiple connections (different dialects). Returns a unified result set with per-source provenance. [ARCHITECT tier]

NameRequiredDescriptionDefault

No parameters

data_profileA

FULL data quality + compliance report for a table: per-column stats PLUS a 0-100 health score, type-gated PII detection (email / phone / SSN / etc.), and insight warnings. Use this when the user says 'profile' or 'quality report' or mentions PII/compliance. [BUILD tier]

NameRequiredDescriptionDefault

No parameters

describe_schemaB

Discover the full database schema: tables, columns, types, primary keys, foreign keys, and indexes. Results cached 1 hour. Call with refresh=true after schema changes.

NameRequiredDescriptionDefault

No parameters

detect_anomaliesA

Scan a table for unusual patterns: volume drops/spikes, data gaps, value concentration, high null rates, stale data. Severity-ranked alerts. Tables > 100k rows use a sampled path (~5%). Dialect-aware sampling.

NameRequiredDescriptionDefault

No parameters

explain_queryA

Analyze a SQL query's execution plan and return plain-English performance recommendations. Runs EXPLAIN ANALYZE (Postgres) or EXPLAIN FORMAT=JSON (MySQL). [BUILD tier]

NameRequiredDescriptionDefault

No parameters

find_n_plus_oneB

Detect N+1 query patterns from recent query history. Fingerprints queries and flags repeated patterns. [ARCHITECT tier]

NameRequiredDescriptionDefault

No parameters

generate_migrationA

Generate dialect-correct ALTER TABLE migration SQL + rollback from a plain-English intent. Output uses the connection's exact dialect. Never executes. [BUILD tier]

NameRequiredDescriptionDefault

No parameters

generate_seed_dataA

Generate realistic, schema-aware INSERT statements for development and testing. Respects types, constraints, and FK relationships. Never executes. [BUILD tier]

NameRequiredDescriptionDefault

No parameters

impact_analysisA

Analyze the blast radius of a proposed schema change: FK dependencies, affected views, row count, risk score. [ARCHITECT tier]

NameRequiredDescriptionDefault

No parameters

issue_api_keyA

Issue a fresh ta_data_* API key for your current tenant. Useful for pasting into /add-database or configuring a separate integration. Rate-limited to 5 issuances per tenant per day.

NameRequiredDescriptionDefault

No parameters

list_connectionsA

List every database connection registered for your tenant: name, id, dbType (postgres / mysql / mssql), createdAt. Flags duplicate names. Returns nothing sensitive (no DSN, no credentials).

NameRequiredDescriptionDefault

No parameters

optimize_queryA

Suggest a rewritten, optimized version of a SQL query with explanations. Identifies sequential scans, missing indexes, sort spills, join inefficiencies, and suggests index DDL. [BUILD tier]

NameRequiredDescriptionDefault

No parameters

pii_scanA

Sweep string columns across tables for common PII patterns (email, SSN, credit card, phone, JWT, bearer tokens). Heuristic-only — not a compliance guarantee. [BUILD tier]

NameRequiredDescriptionDefault

No parameters

query_firewallB

Manage per-connection SQL rules: block dangerous patterns, require WHERE on large tables, log PII access. [ARCHITECT tier]

NameRequiredDescriptionDefault

No parameters

query_historyB

Return recent queries executed through ThinAir with timing, row counts, and status. [BUILD tier]

NameRequiredDescriptionDefault

No parameters

query_sqlA

Execute a read-only SQL query against the target connection. ONLY SELECT / WITH / EXPLAIN permitted. Write dialect-appropriate SQL for the connection's engine — PostgreSQL syntax for postgres, T-SQL for mssql, MySQL for mysql. Response meta includes connection + dialect so you know which syntax worked. Default LIMIT 100 unless the user asks for all rows.

NameRequiredDescriptionDefault

No parameters

quotaA

Check current API usage, daily limit, plan name, and upgrade options.

NameRequiredDescriptionDefault

No parameters

saved_queriesB

Manage your personal library of reusable SELECT queries. action=save stores a query by name; action=run executes a saved query; action=list returns all your saved queries; action=delete removes one. [BUILD tier]

NameRequiredDescriptionDefault

No parameters

show_locksA

List active sessions + blocking locks. Uses the dialect's own system view: pg_stat_activity on postgres, information_schema.processlist on mysql, sys.dm_exec_requests joined with sys.dm_tran_locks on mssql. [BUILD tier]

NameRequiredDescriptionDefault

No parameters

suggest_queriesA

Generate schema-aware query suggestions with ready-to-run SQL. Great for exploring unfamiliar databases or finding useful queries.

NameRequiredDescriptionDefault

No parameters

test_connectionA

Ping a connection (SELECT 1) and return server version + latency. Fast way to confirm credentials and network path without running describe_schema.

NameRequiredDescriptionDefault

No parameters

watch_tableA

Monitor a table's row count and latest record. Compares to previous snapshot to show changes. Built-in scheduler. [ARCHITECT tier]

NameRequiredDescriptionDefault

No parameters

Tool Schema Changelog

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

  1. 23 tool updatesv0.1.0
    • First observedanalyze_table
    • First observedcross_db_query
    • First observeddata_profile
    • First observeddescribe_schema
    • First observeddetect_anomalies
    • First observedexplain_query
    • First observedfind_n_plus_one
    • First observedgenerate_migration
    • First observedgenerate_seed_data
    • First observedimpact_analysis
    • First observedissue_api_key
    • First observedlist_connections
    • First observedoptimize_query
    • First observedpii_scan
    • First observedquery_firewall
    • First observedquery_history
    • First observedquery_sql
    • First observedquota
    • First observedsaved_queries
    • First observedshow_locks
    • First observedsuggest_queries
    • First observedtest_connection
    • First observedwatch_table

TDQS

A3.7/5.0

Scored across 23 tools

Disambiguation4/5

Most tools have clearly distinct purposes (schema, querying, profiling, etc.), though analyze_table and data_profile overlap in table statistics, and explain_query with optimize_query both address performance. Descriptions effectively differentiate them, but ambiguity exists for a couple of pairs.

Naming Consistency4/5

The majority of tool names follow a verb_noun pattern (analyze_table, describe_schema, etc.), but there are minor deviations like cross_db_query (adjective_noun) and quota (single noun). Overall pattern is consistent and readable.

Tool Count3/5

At 23 tools, the set is on the heavier side for a data management server. While each tool serves a distinct purpose (schema, querying, profiling, security, migrations), the number is borderline and could feel bloated for simpler use cases.

Completeness5/5

The tool surface is highly comprehensive for a data observability/management server, covering schema discovery, query execution/optimization, profiling, PII scanning, anomaly detection, migrations, security, and admin tasks. No obvious gaps within the intended scope.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to manage, monitor, and optimize PostgreSQL databases with over 200 specialized tools for operations, security, performance tuning, and diagnostics.
    29 npm
    12
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI assistants to connect to and interact with PostgreSQL, MySQL, SQLite, and MongoDB databases through natural language, supporting schema exploration, query execution, data export, and more.
    13
    MIT