Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

io.github.terno-ai/terno

Latest version: v1.0.39

Overview

Last scanned
27 Nov 2026
Published
27 Nov 2026
MCP server Transport: Streamable HTTP Publisher: terno-ai
8 Stars
0 Forks
3 Versions
Python Repo language

Scan summary

io.github.terno-ai/terno was last scanned on 27 Nov 2026 at version 1.0.39. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 3 versions; the latest was published on 27 Nov 2026.
  • Findings: No rules fired in version 1.0.39.
  • MCP server: Runs over Streamable HTTP. The probe saw no tools; the server requires authentication. The probe did not observe a protocol version.

Versions

3 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.0.39 LATEST 27 Nov 2026 No rules fired
1.0.2 11 Nov 2026 No rules fired
1.0.1 11 Nov 2026 No rules fired

No rules fired in 1.0.39

Findings

Findings for v1.0.39. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 1.0.39; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

TernoDBI: Database Intelligence Layer

License Python Django

TernoDBI is a data layer for AI agents, built for security and accuracy. It gives agents one controlled way to read your databases (Postgres, MySQL, Snowflake, BigQuery, Databricks, Oracle, SQLite) and your business tools (Google Ads, GA4, HubSpot, Salesforce, Shopify and more), with access rules enforced on every query.

Run it as a standalone Model Context Protocol (MCP) server — locally over stdio, or hosted over HTTP with OAuth — or embed it in an existing Django project.

Quick Start: Chat with your DB in 5 Minutes

  1. Install TernoDBI

    pip install terno-dbi
  2. Start the server

    ternodbi start [port]

    By default this starts on 127.0.0.1:8376. On first boot it runs migrations, creates an admin / admin user and a default organisation. It runs in development mode, which is fine on your own machine — see Configuration before exposing it anywhere.

  3. Add your database Open the admin panel at http://127.0.0.1:8376/admin and add a datasource. Credentials are encrypted at rest.

  4. Generate an access token, bound to your organisation and a user (--org / --user) — an unbound token can't use organisation features such as memory:

    # Query token (read-only, for AI agents)
    ternodbi manage issue_token --name "My Agent" --type query --org default --user admin
    
    # Admin token (schema metadata, memory, organisation prompt)
    ternodbi manage issue_token --name "System Admin" --type admin --org default --user admin
  5. Connect your MCP client — see TernoDBI as an MCP Server. To skip self-hosting, use the hosted server instead: Connect to mcp.terno.ai.

  6. Start chatting with your data.

Key Features

  • Databases: Postgres, MySQL, Snowflake, BigQuery, Databricks, Oracle and SQLite through one API.
  • Business tools (API connectors): 17 sources — ads, analytics, CRM, commerce and documents — queried through the same agent tools. See API Connectors.
  • Security by default:
    • SQLShield: every query is parsed and rewritten before it runs. Only SELECT is accepted; writes and stacked statements never reach your database.
    • Row-level security: SQL filters (e.g. department_id = 5) are injected into every query, per role.
    • Private tables and columns: hidden from the model's context unless a role is allowed to see them.
    • Scoped tokens: per organisation, per datasource, with expiry; OAuth scopes and an Org Admin check for anything that writes.
  • LLM-ready schema:
    • Semantic names: expose Customers instead of t_users_v2_fnl; descriptions for tables and columns.
    • Column statistics: row and null counts, cardinality and common values, to help models write correct filters.
  • Memory and organisation prompt: durable facts and instructions that agents read before answering, per organisation and per user.
  • MCP, two ways:
    • stdio: separate query (read-only) and admin servers, each with its own token.
    • Hosted HTTP: one server with OAuth 2.1 (dynamic client registration, PKCE, consent screen), plus a preview channel for unreleased tools.
  • Large results: server-side cursors stream rows as NDJSON or download them as CSV.

Usage & Core APIs

Running the server
ternodbi start          # default port 8376
ternodbi start 9000     # custom port

ternodbi start runs the REST API and admin panel. To also serve MCP over HTTP (/mcp), run the ASGI app — see Hosted over HTTP.

Sharing the database with an existing Django project

If your Django project embeds terno_dbi.core and uses SQLite, the standalone server can read and write the same database file:

DJANGO_PROJECT_PATH=/path/to/your/django/project ternodbi start

This uses /path/to/your/django/project/db.sqlite3.

Management commands

Always pass --org / --user so the token has an identity:

# Query token that expires in 30 days
ternodbi manage issue_token --name "Claude Agent" --type query --expires 30 --org acme --user alice

# Admin token
ternodbi manage issue_token --name "System Admin" --type admin --org acme --user alice

# Token restricted to one datasource
ternodbi manage issue_token --name "Finance Data Only" --type query --datasource 1 --org acme --user alice

ternodbi manage runs any Django management command (migrate, createsuperuser, …).

Query API

Every request carries Authorization: Bearer <token>. Datasources can be addressed by ID or display name.

Endpoint Purpose
GET /api/query/datasources/ Datasources this token can reach
GET /api/query/datasources/{ds}/tables/ Tables, by public name
GET /api/query/datasources/{ds}/tables/{table}/columns/ Columns and types
GET /api/query/tables/{table_id}/sample/?rows=10 Sample rows (max 100)
POST /api/query/datasources/{ds}/query/ Run a query, results as JSON
POST /api/query/datasources/{ds}/stream/ Run a query, results streamed as NDJSON
POST /api/query/datasources/{ds}/export/ Run a query, results as a CSV download
POST /api/query/datasources/1/query/
{
    "sql": "SELECT name, email FROM Customers WHERE country = 'DE'",
    "max_rows": 500
}

Queries use public (semantic) names and are rewritten by SQLShield for the caller's role. Results are capped at MAX_QUERY_ROWS (10,000 by default) with a 300-second timeout; both are configurable in DBI_LAYER.

TernoDBI as an MCP Server

Query tools (read-only)

Tool What it does
list_datasources Datasources this connection can reach
list_tables, list_table_columns Schema, by public name
get_sample_data Sample rows from a table
execute_query Run SQL through SQLShield
list_memories, get_memory, grep_memory Read stored memory
get_org_prompt, grep_org_prompt Read the organisation prompt
terno_guide A tour of the server, or what's new

Admin tools

Tool What it does
connect_datasource Returns a link where the user adds a datasource — credentials never pass through the chat
add_datasource, validate_connection Add or test a connection string (stdio only; never offered over OAuth)
delete_datasource Remove a database connection; an API connector is disconnected instead, keeping its settings
sync_metadata Refresh the schema from the database
rename_table, rename_column Set public names
update_table_description, update_column_description, get_table_info Write descriptions, with column statistics to inform them
save_memory, edit_memory, delete_memory Manage memory
update_org_prompt, edit_org_prompt Manage the organisation prompt

The server also provides prompts (explore-datasources, build-a-query, schema-health) and resources (ternodbi://docs, ternodbi://changelog). The API-connector tools are listed under API Connectors.

Connect to the hosted server (mcp.terno.ai)

No install needed: point any MCP client that supports Streamable HTTP at the hosted server. The first time you connect, your client opens a browser to sign in with your Terno account and choose an organisation (OAuth 2.1); no API key is pasted anywhere.

Channel URL
Preview (all tools, including API connectors) https://mcp.terno.ai/mcp/preview
Stable (released tools only) https://mcp.terno.ai/mcp

It is also listed in the official MCP Registry as io.github.terno-ai/terno.

Claude Code

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

Claude (Desktop or claude.ai): Settings → Connectors → Add custom connector, and paste https://mcp.terno.ai/mcp/preview.

VS Code (GitHub Copilot): add to .vscode/mcp.json:

{
  "servers": {
    "terno": {
      "type": "http",
      "url": "https://mcp.terno.ai/mcp/preview"
    }
  }
}

Cursor: add to ~/.cursor/mcp.json:

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

Then ask: "Show me the available datasources."

Local (stdio): connecting Claude Desktop
  1. Install Claude Desktop and open Settings → Developer → Edit Config.
  2. Mint a query and an admin token (see Management commands) and add:
{
  "mcpServers": {
    "ternodbi-query": {
      "command": "uvx",
      "args": ["--from", "terno-dbi", "dbi-mcp", "query"],
      "env": {
        "TERNODBI_API_URL": "http://127.0.0.1:8376",
        "TERNODBI_API_KEY": "dbi_query_YOUR_TOKEN_HERE"
      }
    },
    "ternodbi-admin": {
      "command": "uvx",
      "args": ["--from", "terno-dbi", "dbi-mcp", "admin"],
      "env": {
        "TERNODBI_API_URL": "http://127.0.0.1:8376",
        "TERNODBI_API_KEY": "dbi_admin_YOUR_TOKEN_HERE"
      }
    }
  }
}
  1. Restart Claude Desktop and ask: "Show me the available datasources."

If you started TernoDBI on another port, update TERNODBI_API_URL.

Hosted over HTTP with OAuth

Hosted, both tool sets are one server over Streamable HTTP. Users sign in with OAuth 2.1 — dynamic client registration, PKCE, and a consent screen where they pick the organisation — so no API key is pasted into the client. Write access needs both a write scope and the Org Admin role, re-checked on every request.

pip install 'terno-dbi[http]'
uvicorn terno_dbi.server.asgi:application --port 8376

This serves two release channels: /mcp (stable: released tools, changes only on purpose) and /mcp/preview (everything, including tools not yet released on stable). See the MCP guide for OAuth discovery, scopes and releasing tools.

API Connectors

Besides databases, TernoDBI connects to business tools and queries them through the same agent workflow:

Category Sources
Advertising Google Ads, Meta Ads, LinkedIn Ads, Microsoft Ads, Amazon Ads, TikTok Ads, X Ads
Analytics Google Analytics 4, Google Search Console, YouTube
Social Instagram Insights, Instagram Public Data, X Analytics
CRM HubSpot, Salesforce, Pipedrive, Zoho CRM
Commerce Shopify
Payments Stripe
Documents Google Sheets, Google Drive

Connecting a source. An organisation admin opens /connect?connector=<key> (for example google_ads), signs in with the provider, and chooses which of their accounts TernoDBI may query. Tokens are stored encrypted and refreshed automatically. The server needs an OAuth app for each provider you enable:

Provider Environment variables
Google (Ads, GA4, Search Console, YouTube, Sheets, Drive) TERNO_GOOGLE_OAUTH_CLIENT_ID, TERNO_GOOGLE_OAUTH_CLIENT_SECRET
Meta (Meta Ads, Instagram via Facebook Login) TERNO_META_APP_ID, TERNO_META_APP_SECRET
Instagram (Instagram Login) TERNO_INSTAGRAM_APP_ID, TERNO_INSTAGRAM_APP_SECRET
LinkedIn TERNO_LINKEDIN_CLIENT_ID, TERNO_LINKEDIN_CLIENT_SECRET
Microsoft Advertising TERNO_MICROSOFT_ADS_CLIENT_ID, TERNO_MICROSOFT_ADS_CLIENT_SECRET
Amazon Ads TERNO_AMAZON_ADS_CLIENT_ID, TERNO_AMAZON_ADS_CLIENT_SECRET
TikTok Ads TERNO_TIKTOK_APP_ID, TERNO_TIKTOK_APP_SECRET
X Analytics (OAuth 2.0 client) TERNO_X_CLIENT_ID, TERNO_X_CLIENT_SECRET
X Ads (OAuth 1.0a consumer keys) TERNO_X_CONSUMER_KEY, TERNO_X_CONSUMER_SECRET
HubSpot TERNO_HUBSPOT_CLIENT_ID, TERNO_HUBSPOT_CLIENT_SECRET
Salesforce TERNO_SALESFORCE_CLIENT_ID, TERNO_SALESFORCE_CLIENT_SECRET
Pipedrive TERNO_PIPEDRIVE_CLIENT_ID, TERNO_PIPEDRIVE_CLIENT_SECRET
Zoho TERNO_ZOHO_CLIENT_ID, TERNO_ZOHO_CLIENT_SECRET
Shopify TERNO_SHOPIFY_CLIENT_ID, TERNO_SHOPIFY_CLIENT_SECRET
Stripe (Connect platform ca_… id and secret key) TERNO_STRIPE_CLIENT_ID, TERNO_STRIPE_SECRET_KEY

Register <your server>/connectors/oauth/callback/ as the redirect URI with each provider.

Amazon Ads builds reports asynchronously, which can take from minutes to over half an hour. A query waits up to TERNO_AMAZON_ADS_REPORT_WAIT_SECONDS (default 180) and then returns a retriable TIMEOUT; running the same query again picks up that report instead of requesting a new one. Report ids are kept in the Django cache, so use a shared cache (such as Redis) when running more than one process. Keep the value below your client's request timeout.

Live check

What the probe observed on connect. Fields the probe did not learn are not shown — never guessed.

Reachable
YES
Transport
HTTP
Authentication
REQUIRED
Tools advertised
0

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Capabilities

The probe saw no tools; the server requires authentication.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • MCP Registry io.github.terno-ai/terno

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Frame 2085668439 (1)
Group 1261154229