# Terno

> Terno is an open-source MCP server for databases. Read-only SQL access to databases and business tools, with row-level access rules. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** Self-hosted, API, CLI
- **Repository:** https://github.com/terno-ai/ternodbi
- **MCP Registry name:** io.github.terno-ai/terno
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-11-23

## About

Terno is the hosted face of TernoDBI, an Apache-2.0 data layer that gives agents one controlled route to databases (Postgres, MySQL, Snowflake, BigQuery, Databricks, Oracle, SQLite) and 17 business-tool connectors such as Google Ads, GA4, HubSpot, Salesforce and Shopify.

Safety is built into the query path. SQLShield parses and rewrites each query, accepting only SELECT and blocking writes and stacked statements, while row-level filters are injected per role and private tables and columns stay out of the model's context. Admins can give tables semantic names and descriptions, and the server stores memory and an organisation prompt that agents read before answering.

You can self-host with pip install terno-dbi, using separate read-only query and admin servers over stdio, or use the hosted server with OAuth 2.1. A preview channel carries all tools and a stable channel only released ones. Results cap at 10,000 rows by default.

## Features

- **SELECT-only queries:** SQLShield rewrites queries and rejects writes and stacked statements.
- **Row-level security:** Per-role SQL filters are applied to every query.
- **Semantic schema:** Friendly table and column names with descriptions and statistics.
- **Shared memory:** Durable facts and an organisation prompt agents read first.
- **Business connectors:** 17 sources including ads, analytics, CRM and commerce.

## Good for

- Chat with a Postgres or Snowflake warehouse safely
- Limit a sales agent to its own department's rows
- Query HubSpot or GA4 data through the same tools
- Document tables so models write correct filters

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add --transport http terno https://mcp.terno.ai/mcp/preview
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "terno": {
      "type": "http",
      "url": "https://mcp.terno.ai/mcp/preview"
    }
  }
}
```

### Claude Desktop (Customize → Connectors → Add → Add custom connector)

```text
https://mcp.terno.ai/mcp/preview
```

Paste this URL, choose how to sign in, then click Add and Connect. On Team and Enterprise an Owner adds it in Organization settings → Connectors.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "terno": {
      "url": "https://mcp.terno.ai/mcp/preview"
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "terno": {
      "type": "http",
      "url": "https://mcp.terno.ai/mcp/preview"
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### ChatGPT (chatgpt.com → Plugins → + → Add custom MCP server)

```text
https://mcp.terno.ai/mcp/preview
```

Paste this URL, set up sign-in, accept the warning and install the plugin. Then type @ in a chat to use it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add terno --url https://mcp.terno.ai/mcp/preview
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.terno]
url = "https://mcp.terno.ai/mcp/preview"
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "terno": {
      "httpUrl": "https://mcp.terno.ai/mcp/preview"
    }
  }
}
```

Or run: gemini mcp add -s user --transport http terno https://mcp.terno.ai/mcp/preview

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "terno": {
      "serverUrl": "https://mcp.terno.ai/mcp/preview"
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "terno": {
      "url": "https://mcp.terno.ai/mcp/preview",
      "transport": "http"
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "terno": {
      "type": "streamableHttp",
      "url": "https://mcp.terno.ai/mcp/preview"
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "terno": {
      "url": "https://mcp.terno.ai/mcp/preview"
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "terno": {
      "url": "https://mcp.terno.ai/mcp/preview"
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "terno": {
      "url": "https://mcp.terno.ai/mcp/preview"
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "terno": {
      "url": "https://mcp.terno.ai/mcp/preview"
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Grok Bot (Grok Bot desktop app → Connect apps → Add a custom connector)

```sh
https://mcp.terno.ai/mcp/preview
```

Enter a Name (for example "Terno"), choose Type: Remote HTTPS, paste this as the Server URL and choose Add plugin. When we checked, this server asked for OAuth sign-in. If its docs give you an OAuth client ID and secret, enter them in the form's OAuth Client ID and Client Secret fields.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "terno": {
      "type": "http",
      "url": "https://mcp.terno.ai/mcp/preview"
    }
  }
}
```

## Tools

Going by the tool names, 1 of 6 tools changes data; 1 name doesn't say. From the server's own tool labels and tool names; not verified by us.

- `list_datasources` (name suggests: reads): Lists the datasources the connection can reach.
- `list_tables` (name suggests: reads): Lists tables by public name.
- `list_table_columns` (name suggests: reads): Lists columns and types for a table.
- `get_sample_data` (name suggests: reads): Returns sample rows from a table.
- `execute_query` (name suggests: changes): Runs SQL through SQLShield.
- `terno_guide`: Gives a tour of the server or what is new.

## FAQ

### Can an agent change my data?

No. Only SELECT is accepted.

### How do I connect?

Use the hosted server at mcp.terno.ai with OAuth, or self-host with pip install terno-dbi.

### Which databases are supported?

Postgres, MySQL, Snowflake, BigQuery, Databricks, Oracle and SQLite.

### Are there result limits?

Results cap at 10,000 rows with a 300-second timeout by default.

### Is Terno free?

Yes. Terno is open source, so you can use and self-host it for free.

### How do I add Terno to Claude Code?

Run this command in your terminal: claude mcp add --transport http terno https://mcp.terno.ai/mcp/preview

### What are the best alternatives to Terno?

The closest alternatives to Terno are Midplane, Datatomcp, Gulliver, GaussDB Read-Only MCP and Zektor.

## Where this comes from

- Description: written from the project's README.
- Status: checked automatically by AIPoweredBot on 24 November 2026.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.
- [Datatomcp](https://ai-powered.com/mcp/datatomcp-2): Datatomcp is a freemium MCP server for analytics and data.
- [Gulliver](https://ai-powered.com/mcp/gulliver): Gulliver is an open-source MCP server for databases.
- [GaussDB Read-Only MCP](https://ai-powered.com/mcp/gaussdb-read-only-mcp): GaussDB Read-Only MCP is an open-source MCP server for databases.
- [Zektor](https://ai-powered.com/mcp/zektor): Zektor is a freemium MCP server for databases.
- [Sqlite Graph MCP](https://ai-powered.com/mcp/sqlite-graph-mcp): Sqlite Graph MCP is an MCP server for databases.
- [Trino](https://ai-powered.com/mcp/trino-2): Trino is an open-source MCP server for databases.
- [APoint MS SQL](https://ai-powered.com/mcp/apoint-ms-sql): APoint MS SQL is a free MCP server for databases.

---
Source: https://ai-powered.com/mcp/terno
