Skip to main content

MCP Integration for Claude Desktop

Connect Nexatron to Claude Desktop (or any MCP-compatible AI assistant) so you can query your databases directly from a conversation.

What is MCP?

The Model Context Protocol (MCP) is an open standard that lets AI assistants call external tools. When you configure Nexatron as an MCP server, Claude can execute natural language queries against your databases, list connections, browse metrics, and more -- all within a chat session.

Two ways to connect

Nexatron offers two MCP surfaces:

  1. Hosted MCP (recommended) — connect any MCP client straight to https://api.nexatron.io/api/v1/mcp with OAuth 2.1. Zero install. The hosted surface is led by ask and is tiered: seven always-on analytics tools (ask, list_sources, list_metrics, explain_metric, query_metric, compare_metric_across_sources, audit) plus an optional action platform (list_actions, dry_run, execute_action, compose_workflow) that an admin enables per workspace (off by default). The tools listed above are the full tiered catalog. For the click-by-click Claude setup, see Connect Nexatron to Claude.
  2. Local stdio package — run nexatron-mcp from PyPI on your machine and point it at your API. The rest of this page covers this option.

Configure Claude Desktop

Add the Nexatron MCP server to your Claude Desktop configuration file.

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

{
"mcpServers": {
"nexatron": {
"command": "uvx",
"args": ["nexatron-mcp"],
"env": {
"NEXATRON_API_KEY": "nxa_your_api_key_here",
"NEXATRON_URL": "https://api.nexatron.io/api/v1"
}
}
}
}

Restart Claude Desktop after saving the file. You should see a hammer icon indicating the Nexatron tools are available.

Self-Hosted Alternative

If you run a self-hosted Nexatron instance, point the server at your API:

{
"mcpServers": {
"nexatron": {
"command": "uvx",
"args": ["nexatron-mcp"],
"env": {
"NEXATRON_API_KEY": "nxa_your_api_key_here",
"NEXATRON_URL": "http://localhost:8000/api/v1"
}
}
}
}

Available Tools

Once connected, Claude has access to these tools:

The server exposes ten data-access tools:

ToolDescription
askAsk a question in plain English -- routes through the governed NL-to-SQL pipeline with full RLS, certified-metric, and semantic-layer enforcement
query_metricRun a certified metric with optional filters, group-by, and time range
compare_metric_across_sourcesCompute a metric across multiple connections (federated comparison)
explain_metricThe certified definition, SQL expression, type, and lineage of a metric
list_metricsList semantic-layer metrics with expression, type, and certification status
list_sourcesList connected data sources (names + ids) and their health
list_connectionsList configured connections and health (kept for back-compat; superseded by list_sources)
get_schemaInspect tables and columns for a given connection
get_data_qualityData-quality summary (null rates, freshness) for a connection
search_knowledge_baseSearch uploaded docs and notes using natural language

Alongside the ten data-access tools, three read-only governance-contract tools -- get_metric_contract, explain_provenance, and export_semantic_contract -- let a downstream system see exactly how a governed number is defined and proven. They are a distinct introspection category, not part of the ten.

Example Queries Through Claude

Once configured, ask Claude questions naturally. It will use the Nexatron tools automatically:

Basic Query

"What were our total sales last quarter?"

Claude calls ask with your question, receives the answer, SQL, results, and a summary, then presents them in the conversation.

Explore Your Data Model

"What database connections do I have set up in Nexatron?"

Claude calls list_connections and shows you a table of your PostgreSQL, Snowflake, or other connections with their status.

Browse Metrics

"What metrics are defined in the semantic layer?"

Claude calls list_metrics and returns a list of business metrics like monthly_recurring_revenue, customer_churn_rate, and average_order_value with their descriptions.

Multi-Step Analysis

"Show me revenue by region, then drill into the fastest growing one and explain the trend."

Claude chains multiple ask calls, maintaining conversation context across each step. It can also call explain_metric to show how a metric is defined and calculated.

Schema Exploration

"What tables are available in the production database? Show me the orders table schema."

Claude calls get_schema to inspect table structures, column types, and relationships.

Troubleshooting

Tools not appearing: Ensure Claude Desktop is fully restarted (not just the window). Check that the config JSON is valid.

Authentication errors: Verify your API key is correct and has not expired. Generate a new key from Settings > API Keys in the Nexatron dashboard.

Connection timeouts: If using a self-hosted instance, confirm the NEXATRON_URL is reachable from your machine.

Permission errors: Your API key inherits the permissions of the user who created it. Ensure that user has access to the database connections you want to query.

Next Steps