MCP Analytics Server
MCP Analytics Server
Производственный MCP-сервер (Model Context Protocol), написанный на Python, который предоставляет типизированные, детерминированные и защищённые аналитические инструменты для работы с бизнес-данными, хранящимися в DuckDB.
Внешний ИИ-агент (например, GPT через OpenAI Agents SDK, Claude Desktop или Cursor) может динамически обнаруживать и выполнять аналитические запросы без необходимости прямого доступа к базе данных или выполнения неограниченных SQL-запросов.
✨ Ключевые особенности
Сервер MCP на Python: Полностью соответствует официальному стандарту Model Context Protocol через
stdio.Агностическая архитектура модели: Сервер не содержит LLM внутри. Он предоставляет чистые, детерминированные контракты инструментов, которые может вызывать любой MCP-совместимый агент.
Встроенная колоночная аналитика: На базе DuckDB для быстрых и эффективных колоночных агрегаций по нормализованным корпоративным данным.
SQL-защита на основе AST: Использует
sqlglotдля разбора и проверки ad-hoc запросов, строго разрешая только read-onlySELECTоператоры и устраняя риски SQL-инъекций или мутаций.Строгие типизированные контракты: Все ответы проверяются через модели Pydantic v2 перед отправкой клиенту.
Интерактивный демо-клиент GPT: Готовый демонстрационный агент, использующий OpenAI Agents SDK и подсказки на основе доказательств.
Разработка на основе спецификаций: Создан инкрементально с использованием OpenSpec для полной прослеживаемости требований.
Related MCP server: databricks-mcp
🏛️ Архитектура системы
flowchart TD
User([User]) <--> Agent[GPT Agent / OpenAI Agents SDK]
Agent <-->|MCP Protocol / stdio| Server[MCP Analytics Server]
subgraph Server_Internal [MCP Analytics Server Boundary]
Server --> Tools[Tool Layer]
Tools --> DataTools[Dataset Tools]
Tools --> ChurnTools[Churn Analytics Tools]
Tools --> SQLTool[Read-Only SQL Tool]
SQLTool --> SQLGuard[SQL Guard Security Layer]
DataTools --> AnalyticsSvc[AnalyticsService]
ChurnTools --> AnalyticsSvc
SQLGuard --> DBSvc[DatabaseService]
AnalyticsSvc --> DBSvc
DBSvc --> DuckDB[(DuckDB)]
end
DuckDB --> Table[(customers Table - Telco Dataset)]🛡️ Безопасное выполнение SQL и границы безопасности
Любой SQL-ввод, полученный от ИИ-агента, рассматривается как недоверенный ввод. Сервер выполняет строгую проверку AST с помощью sqlglot перед выполнением запроса:
Allowed Operations:
✅ SELECT contract, AVG(monthly_charges) FROM customers GROUP BY contract
✅ WITH cohorts AS (SELECT * FROM customers WHERE tenure > 24) SELECT COUNT(*) FROM cohorts
Blocked Operations:
❌ DELETE FROM customers WHERE churn = true (Mutation Rejected)
❌ DROP TABLE customers (DDL Rejected)
❌ SELECT * FROM customers; DROP TABLE customers (Multi-statement Rejected)
❌ ATTACH 'external.db' (Engine I/O Rejected)Ограничение количества строк: Ad-hoc запросы ограничены
MAX_RESULT_ROWS = 100для защиты контекстного окна агента.Белые списки таблиц: Разрешено запрашивать только авторизованные аналитические таблицы (
customers).
🧰 Каталог инструментов MCP
Имя инструмента | Назначение | Ключевые параметры | Тип возврата |
| Метаданные набора данных высокого уровня, количество строк и столбцов, имя основной таблицы, целевая переменная. | Нет |
|
| Проверка схемы, возвращающая все доступные столбцы и их типы данных в базе данных. | Нет |
|
| Статистические метрики ( |
|
|
| Общее количество клиентов, количество ушедших, количество оставшихся и исторический уровень оттока в | Нет |
|
| Сегментированные метрики оттока, сгруппированные по одобренному измерению ( |
|
|
| Защищённое выполнение аналитических SQL-запросов для сложных пользовательских вычислений, не покрытых стандартными инструментами. |
|
|
🚀 Краткое руководство по началу работы
1. Предварительные требования
Python 3.11+
Git
2. Установка
# Clone repository
git clone https://github.com/Jojeda96/mcp-analytics-server.git
cd mcp-analytics-server
# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .\.venv\Scripts\Activate.ps1
# Install in editable mode with development tools
pip install -e ".[dev]"3. Создание аналитической базы данных
# Ingest raw Telco CSV, validate schema, normalize, and build DuckDB
python scripts/build_database.py4. Запуск MCP-сервера
# Run server standalone over stdio
mcp-analytics
# or
python -m mcp_analytics.server5. Запуск интерактивного демо-клиента GPT
Настройте ваш OpenAI API ключ в файле .env:
cp .env.example .env
# Edit .env and set OPENAI_API_KEY=sk-...Запустите интерактивное демо:
# Interactive REPL mode
python client/gpt_demo.py
# Or evaluate all 10 standard demonstration questions in batch
python client/gpt_demo.py --all-examples🔌 Подключение к MCP-клиентам
Claude Desktop / Cursor
Добавьте следующую конфигурацию в ваш claude_desktop_config.json или настройки MCP в Cursor:
{
"mcpServers": {
"telco-analytics": {
"command": "python",
"args": ["-m", "mcp_analytics.server"],
"cwd": "/absolute/path/to/mcp-analytics-server",
"env": {
"DUCKDB_PATH": "data/processed/telco.duckdb",
"LOG_LEVEL": "INFO",
"MAX_RESULT_ROWS": "100"
}
}
}
}🧪 Тестирование и обеспечение качества
# Run complete test suite (Unit & Integration) with coverage
pytest --cov=src --cov-report=term-missing
# Run Ruff linter and formatter checks
ruff check .
ruff format --check .
# Run static type checking
mypy src client scripts tests📐 Процесс разработки (OpenSpec)
Этот проект разработан в соответствии с разработкой на основе спецификаций (SDD) с использованием OpenSpec. Каждая возможность отслеживается через явные предложения, дельта-спецификации, проектные документы и проверяемые задачи:
openspec/
├── specs/ # Consolidated capabilities
│ ├── project-foundation/
│ ├── telco-data-foundation/
│ ├── core-analytics-service/
│ ├── core-mcp-tools/
│ ├── safe-readonly-sql-tool/
│ ├── openai-gpt-demo-client/
│ └── portfolio-hardening/
└── changes/archive/ # Historical change audit trail📂 Структура проекта
mcp-analytics-server/
├── .github/workflows/ci.yml # GitHub Actions CI matrix pipeline
├── assets/ # Diagrams and visual assets
├── client/
│ └── gpt_demo.py # Interactive OpenAI Agents SDK demo client
├── data/
│ ├── raw/ # Source CSV files
│ └── processed/ # Generated DuckDB database
├── docs/
│ ├── architecture.md # Deep-dive architecture and layers
│ ├── security.md # Threat model and AST SQL Guard details
│ └── decisions.md # Architecture Decision Records (ADRs)
├── examples/
│ ├── questions.md # 10 evaluated demo business questions
│ └── mcp-config.example.json # Standard client configuration
├── scripts/
│ ├── download_dataset.py # Dataset provenance & download instructions
│ ├── validate_dataset.py # Strict raw data schema & domain validator
│ └── build_database.py # Data cleaner and DuckDB table builder
├── src/mcp_analytics/
│ ├── config.py # Pydantic Settings and environment config
│ ├── errors.py # Domain exception hierarchy
│ ├── server.py # MCP server lifecycle and CLI entrypoint
│ ├── schemas/ # Pydantic response models
│ ├── security/ # AST SQLGuard parser
│ ├── services/ # DatabaseService & AnalyticsService
│ └── tools/ # Dataset, Analytics & SQL MCP tools
├── tests/
│ ├── fixtures/ # Curated sample CSV test fixtures
│ ├── unit/ # Fast unit tests for logic and security
│ └── integration/ # Database and MCP tool integration tests
├── Dockerfile # Containerization recipe
├── pyproject.toml # Package definition & tool configs
├── CHANGELOG.md # Version release notes
├── LICENSE # MIT License
└── README.md📄 Лицензия
Этот проект лицензирован под лицензией MIT — см. файл LICENSE для подробностей.
Available Tools
6 toolsdescribe_columnB
Provides statistical summaries for a specified column in the customers table. For numeric columns, returns min, max, mean, median, and null count. For categorical columns, returns unique category count and top frequent categories.
| Name | Required | Description | Default |
|---|---|---|---|
| column | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It does disclose the primary behavior: numeric columns yield min, max, mean, median, null count; categorical columns yield unique count and top categories. This is helpful and beyond what a schema typically states. However, it does not mention edge cases (e.g., missing column, mixed types), error behavior, or limits on 'top frequent categories', leaving some uncertainty.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, both front-loaded with the core purpose. The numeric vs categorical distinction is presented efficiently without filler. Every word adds value, and the structure is ideal for quick agent scanning.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has an output schema (not shown here), which reduces the need to describe return formats. The description covers the main cases and tells the agent what to expect. Minor gaps remain: no mention of read-only nature, error handling, or behavior on non-existent columns. For a simple one-parameter tool, this is nearly complete, hence a 4.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage for the 'column' parameter (no description, no enum), so the description must compensate. It only states 'a specified column in the customers table', which adds minimal meaning beyond the parameter name itself. It does not explain that the column must exist, expected data types, or how invalid columns are handled. Given the low schema coverage, this is inadequate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states that it 'Provides statistical summaries for a specified column in the customers table,' clearly identifying the resource (customers table column) and the deliverable (statistical summaries). It distinguishes itself from siblings like list_columns (which lists columns) and run_readonly_sql (which runs arbitrary queries) by its focus on computed summaries, and the numeric/categorical breakdown adds specificity. However, the verb 'provides' is generic; 'computes' or 'returns' would be stronger.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance is given on when to use this tool versus alternatives. It implies usage by describing what it returns, but does not mention siblings like run_readonly_sql or get_dataset_info as alternatives, nor suggest trade-offs. An agent must infer that this is the right choice for column-level statistics, which is not guaranteed given the sibling list includes a generic SQL tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_churn_by_dimensionA
Calculates customer count, churned customer count, and historical churn rate grouped by one approved categorical dimension such as contract, internet_service, payment_method, paperless_billing, tech_support, online_security, etc.
| Name | Required | Description | Default |
|---|---|---|---|
| dimension | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full responsibility for behavioral disclosure. It states the calculation output but does not mention whether the operation is read-only, how it handles invalid dimensions, whether results are sorted, or any pagination/limits. The phrase 'approved categorical dimension' hints at a validate set but does not specify behavior on unapproved input. This is insufficient for a tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that front-loads the core action ('Calculates customer count, churned customer count, and historical churn rate') and then immediately provides examples. There is no filler or redundant wording; every clause adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has only one simple parameter and an output schema exists (as indicated by context), the description covers the essential elements: what metrics are returned and what type of input is expected. The only notable gap is the lack of a complete list of approved dimensions, which the output schema may not address. Overall, it is sufficient for a straightforward analytical tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides only a bare string parameter with no description (0% coverage). The description adds significant meaning by listing valid example values (contract, internet_service, payment_method, etc.) and clarifying that grouping is by a single approved categorical dimension. This helps the agent choose appropriate values, though it does not enumerate the full allowed set or specify where to find it, so it falls short of a 5.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the verb 'calculates' and the resource 'churn metrics' grouped by a categorical dimension. It lists specific output metrics (customer count, churned customer count, historical churn rate) and provides multiple concrete dimension examples, making the tool's purpose unambiguous and distinct from a general summary tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool (when you need churn metrics grouped by a categorical dimension) by listing example dimensions, but it does not explicitly mention alternatives such as get_churn_summary for overall churn or describe_column for column analysis. It lacks an explicit when-not-to-use or comparison to siblings, leaving some routing to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_churn_summaryA
Calculates overall customer count, churned customer count, retained customer count, and historical churn rate across the entire Telco dataset. Churn rate is returned as a ratio between 0.0 and 1.0.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states what is computed and that churn rate is returned as a ratio between 0.0 and 1.0, but does not explicitly confirm read-only behavior or any potential performance implications. The nature of a summary tool makes this minor, but a 3 is appropriate given the lack of explicit safety disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, front-loaded sentence that immediately states purpose and output format. No redundant words or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple, parameter-less tool with an output schema, the description covers the key return values (counts, rate) and their format (ratio 0-1). Agents have everything needed to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With zero parameters, the schema is trivially fully covered. The description adds no parameter-specific details because none are needed, meeting the baseline of 4 for parameter-less tools.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the verb 'calculates' and enumerates specific outputs (customer count, churned count, retained count, historical churn rate) across the entire dataset, distinguishing it from sibling get_churn_by_dimension which presumably breaks down churn by dimensions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Makes the scope explicit ('across the entire Telco dataset'), implying it is the tool for overall metrics. However, it does not explicitly contrast with alternatives like get_churn_by_dimension or mention when not to use it, so it stops short of a full 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_dataset_infoA
Returns high-level metadata for the Telco Customer Churn dataset, including the available analytics table, row count, column count and target variable. Use this tool before deeper analysis when dataset context is unknown.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It discloses the output content (metadata) but does not mention whether the operation is read-only (implied by 'get'), or any side effects or error conditions. For a simple metadata retrieval tool, this is acceptable but not enriched beyond the obvious.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence that front-loads the core function ('Returns high-level metadata'), then lists specific items, and ends with a usage recommendation. No redundant words or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the zero-parameter signature and the presence of an output schema (which covers return format), the description provides all necessary context: what the tool does, what it returns, and when to use it. Nothing an agent needs to invoke it correctly is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are zero parameters, and the schema has no properties, so schema coverage is trivially 100%. Per the rubric, the baseline for 0 parameters is 4. The description adds value by explicitly enumerating what the returned metadata includes, which is not captured by the empty schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states what the tool does: returns high-level metadata for the Telco Customer Churn dataset, specifying the exact items included (available analytics table, row count, column count, target variable). It is distinct from sibling tools like list_columns and describe_column, which operate at a different granularity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description includes an explicit usage directive: 'Use this tool before deeper analysis when dataset context is unknown.' This provides clear context on when to invoke it, though it does not explicitly mention alternatives or when not to use it. Still, the guidance is actionable and sufficient for an agent to decide.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_columnsA
Lists all available columns in the customers dataset along with their data types. Use this tool to discover available fields before running specific column queries.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It states the tool lists columns and data types, which implies a read-only operation, but does not explicitly declare side effects, authentication needs, or any limitations. For a simple listing tool this is acceptable, but more transparency (e.g., confirming no side effects) would be better.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, both concise and purposeful. The main functionality is front-loaded, and the usage tip adds value without repetition. No filler or ambiguity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given there is an output schema (not shown but indicated), the description need not explain return values. It covers what the tool does and when to use it. Minor absence of any note about performance or dataset-specific nuance, but overall adequate for a no-parameter, discovery-focused tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the baseline is 4. The schema is trivially complete, and there is no parameter semantics to add. The description correctly focuses on the tool's purpose rather than parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (list), resource (all columns in the customers dataset), and includes the data type output. It also implies a discovery role before column-specific queries. However, it does not explicitly differentiate from sibling tools like get_dataset_info, which might also return column list, so it lacks direct sibling distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides a clear when-to-use hint: 'before running specific column queries.' But it does not mention when not to use it or explicitly reference alternative tools (e.g., describe_column or get_dataset_info). The guidance is sufficient for a simple tool but lacks exclusionary guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
run_readonly_sqlA
Executes one read-only analytical SQL query against the customers dataset. Use this tool only when the predefined analytics tools cannot answer the requested question. Mutation, DDL and multi-statement queries are strictly rejected by security boundaries. Results are capped at a maximum of 100 rows.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that the tool is read-only, rejects mutation/DDL/multi-statement queries, and caps results at 100 rows. These are critical behavioral traits that an agent needs to know before invoking the tool, and they are all explicitly stated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, each carrying necessary information. The primary purpose is stated first, followed by usage guidance and security/result constraints. There is no redundancy or fluff; every sentence earns its place in the description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's role as a fallback SQL execution tool, the description covers all essential aspects: orientation to the dataset, usage restrictions, security boundaries, and result cap. An output schema exists (though not shown here), so the description needn't detail return formats. The description is complete for an agent to correctly decide when to use and how to invoke this tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has one parameter 'query' with zero description coverage. The description adds meaning by clarifying it is a SQL query, which matches the tool's purpose. Since there is only one parameter and it's inherently obvious from the tool name and description, the added context is sufficient, though it doesn't provide syntax examples or formatting details that could further enhance value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('executes'), a clear resource ('customers dataset'), and the read-only analytical nature of the query. It also explicitly positions it relative to sibling tools by stating it is only for when predefined analytics tools cannot answer, which clearly differentiates it from the listed siblings like get_churn_summary and describe_column.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states 'Use this tool only when the predefined analytics tools cannot answer the requested question', giving a precise when-to-use condition. It also implies when not to use (when predefined tools suffice) and lists security restrictions (mutation, DDL, multi-statement queries are rejected), providing clear operational boundaries.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v1.0.0- First observed
describe_column - First observed
get_churn_by_dimension - First observed
get_churn_summary - First observed
get_dataset_info - First observed
list_columns - First observed
run_readonly_sql
TDQS
Scored across 6 tools
Each tool serves a distinct purpose: dataset overview, column discovery, column statistics, overall churn summary, grouped churn analysis, and custom SQL fallback. The overlap between churn summary and churn by dimension is clearly differentiated by the latter's grouping parameter, and SQL is explicitly a last resort. No ambiguity remains for the agent.
All tools follow a consistent verb_noun snake_case pattern: get_dataset_info, list_columns, describe_column, get_churn_summary, get_churn_by_dimension, run_readonly_sql. The verbs (get, list, describe, run) and noun phrases (dataset_info, columns, column, churn_summary, etc.) are uniform, creating a predictable and readable API surface.
With 6 tools, the server is well-scoped for its purpose of analyzing a single churn dataset. Each tool addresses a distinct analytical need, and none feel redundant or extraneous. The count sits comfortably within the ideal 3-15 range.
The tool set covers the full analytics lifecycle: discovery (dataset info, columns), exploration (describe column), summary statistics (churn summary), dimension breakdowns (churn by dimension), and arbitrary ad-hoc queries (SQL fallback). The inclusion of read-only SQL ensures no analytical question remains unanswered, making the surface effectively complete for a read-only analytics server.
Maintenance
Related MCP Connectors
Query, join, profile, clean and convert CSV/JSON/Parquet with server-side DuckDB over MCP.
- dataOAuthco.thinair
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables LLMs to interact with DuckDB databases through MCP tools for SQL queries, table management, data import/export, and schema inspection, with optional read-only mode for safety.1233 PyPIMIT
- AlicenseAqualityDmaintenanceSafe, read-only SQL analytics for AI agents over MCP, enabling exploration, profiling, and querying of data without mutation risk.5MIT
- FlicenseNot gradedqualityCmaintenanceEnables running read-only SQL queries and exploring DuckDB databases through MCP tools like listing tables, describing schemas, and fetching paginated data.-
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants and MCP clients to ask natural-language questions about DuckDB or CSV data and receive safe, read-only SQL-generated tabular insights with automatic schema discovery and multi-table joins.1-