Registry / database / ai-data-analyzer-mcp

ai-data-analyzer-mcp

JSON →
library0.2.0jsnpmunverified

AI-powered database analysis tool (v0.2.0) that launches with a single npx command, supporting PostgreSQL and SQLite. It provides both a web UI for interactive natural-language querying and an MCP server for integration with AI assistants like Claude Code and Cursor. Key differentiators: no configuration files needed (guided first-run setup), multiple AI providers (OpenAI, DeepSeek, Ollama), read-only safety, automatic health checks, anomaly detection, and trend discovery. Node >=20 required. Ships TypeScript types.

npm install ai-data-analyzer-mcp
INSTALL
IMPORT
SIG · AI-DATA-ANALYZER-M
A
ai-data-analyzer-mcp
databasejavascriptv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import aiDataAnalyzer from 'ai-data-analyzer-mcp'
const aiDataAnalyzer = require('ai-data-analyzer-mcp')
Package is ESM-only. CommonJS require will fail. No default export is actually documented; this package is primarily used as a CLI tool, not a library.
connectDatabase
import { connectDatabase } from 'ai-data-analyzer-mcp'
import connectDatabase from 'ai-data-analyzer-mcp'
Named export, not default. Available from package exports. Only works in ESM.
analyzeSchema
import { analyzeSchema } from 'ai-data-analyzer-mcp'
const { analyzeSchema } = require('ai-data-analyzer-mcp')
ESM-only; CommonJS require not supported.

Shows how to set environment variables for database connection and use the main analysis functions (connectDatabase, analyzeSchema, dataHealthCheck, discoverInsights, askQuestion) from the package.

// Run the MCP server (used by Claude Code, Cursor, etc.) // First set environment variables process.env.AI_DATA_DB_TYPE = 'sqlite'; process.env.AI_DATA_DB_FILE = './data.db'; process.env.OPENAI_API_KEY = process.env.OPENAI_API_KEY ?? ''; // Or for PostgreSQL: // process.env.AI_DATA_DB_TYPE = 'postgresql'; // process.env.AI_DATA_DB_CONNECTION_STRING = 'postgres://user:pass@host:5432/db'; // Then start the server (CLI mode, no code import needed) // $ npx ai-data-analyzer // Programmatic usage (ESM only): import { connectDatabase, analyzeSchema, dataHealthCheck, discoverInsights, askQuestion } from 'ai-data-analyzer-mcp'; async function analyze() { // First connect to database const db = await connectDatabase(); // Then analyze schema const schema = await analyzeSchema(); console.log('Schema:', schema); // Run health check const health = await dataHealthCheck(); console.log('Health:', health); // Discover insights const insights = await discoverInsights(); console.log('Insights:', insights); // Ask a question const answer = await askQuestion('What are the top selling products?'); console.log('Answer:', answer); } analyze().catch(console.error);
Debug
Known issues
breakingRequires Node.js >=20.0.0. Older Node versions will throw an error.
fix
Upgrade Node.js to version 20 or higher.
affects: <20.0.0
breakingPackage is ESM-only (type: module). CommonJS require() will fail with ERR_REQUIRE_ESM.
fix
Use import syntax instead of require(). If you must use CommonJS, use dynamic import: const pkg = await import('ai-data-analyzer-mcp').
affects: >=0.1.0
gotchaThe package is primarily designed as a CLI tool (npx ai-data-analyzer) or MCP server, not as a library. Programmatic API exports may change without notice.
fix
Prefer using the CLI or MCP server mode. If you import programmatically, pin the version.
affects: >=0.1.0
deprecatedEnvironment variables have changed between versions. For MCP mode, AI_DATA_DB_TYPE, AI_DATA_DB_FILE, and AI_DATA_DB_CONNECTION_STRING are used.
fix
Use the documented environment variables. Old variables (like DB_TYPE, DB_FILE) are no longer supported.
affects: >=0.1.0
gotchaAPI keys for AI providers (OpenAI, DeepSeek, etc.) must be set via environment variables or interactive configuration. Missing keys may cause silent failures or unhelpful error messages.
fix
Ensure the necessary API key (OPENAI_API_KEY, DEEPSEEK_API_KEY, etc.) is set before starting the server.
affects: >=0.1.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module /path/to/ai-data-analyzer-mcp not supported
Trying to import the package with CommonJS require() while the package is ESM-only.
fix
Change to import syntax: import { ... } from 'ai-data-analyzer-mcp' or use dynamic import with await import('...')
Error: Unsupported database type. Supported types: 'postgresql', 'sqlite'
The environment variable AI_DATA_DB_TYPE is missing or set to an unsupported value.
fix
Set AI_DATA_DB_TYPE to 'postgresql' or 'sqlite' before starting the server.
Error: OPENAI_API_KEY is not configured. Please set the OPENAI_API_KEY environment variable.
Missing API key for OpenAI (the default AI provider).
fix
Set the OPENAI_API_KEY environment variable to a valid OpenAI API key.
Error: Cannot find module 'ai-data-analyzer-mcp'
The package is not installed, or running in an environment without npx access.
fix
Run using npx ai-data-analyzer (no install needed) or install globally with npm install -g ai-data-analyzer-mcp
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
59 hits · last 30 days
node
48
Resources
ai-data-analyzer-mcp — npm install ai-data-analyzer-mcp · libregistry