Skip to main content
Glama
Jojeda96

MCP Analytics Server

by Jojeda96

MCP Analytics Server

Python SDK Database Validation Code Style Type Checked Spec-Driven License: MIT

Python으로 구축된 프로덕션 등급의 Model Context Protocol (MCP) 서버로, DuckDB에 저장된 비즈니스 데이터셋에 대해 타입이 지정되고 결정적이며 보안이 강화된 분석 도구를 제공합니다.

외부 AI 에이전트(예: OpenAI Agents SDK를 통한 GPT, Claude Desktop, Cursor)는 직접 데이터베이스에 접근하거나 제약 없는 SQL을 실행하지 않고도 분석 쿼리를 동적으로 발견하고 실행할 수 있습니다.


✨ 핵심 기능

  • Python 우선 MCP 서버: stdio를 통한 공식 Model Context Protocol 표준을 완전히 준수합니다.

  • 모델 비종속 아키텍처: 서버 내부에는 LLM이 포함되어 있지 않습니다. MCP 호환 에이전트가 호출할 수 있는 깔끔하고 결정적인 도구 계약을 제공합니다.

  • 임베디드 컬럼 분석: 정규화된 엔터프라이즈 데이터에 대한 빠르고 효율적인 컬럼 집계를 위해 DuckDB를 사용합니다.

  • AST 기반 SQL 가드: sqlglot을 사용하여 임시 쿼리를 파싱하고 검증하며, 읽기 전용 SELECT 문만 엄격히 허용하여 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 실행 및 보안 경계

AI 에이전트로부터 받은 모든 SQL 입력은 신뢰할 수 없는 입력으로 취급됩니다. 서버는 쿼리 실행 전에 sqlglot을 통해 엄격한 AST 검증을 수행합니다:

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)
  • 행 제한 가드: 임시 쿼리는 에이전트의 컨텍스트 창을 보호하기 위해 MAX_RESULT_ROWS = 100으로 제한됩니다.

  • 테이블 허용 목록: 승인된 분석 테이블(customers)만 쿼리할 수 있습니다.


🧰 MCP 도구 카탈로그

도구 이름

목적

주요 매개변수

반환 유형

get_dataset_info

데이터셋 메타데이터, 행 및 열 수, 기본 테이블 이름, 대상 변수에 대한 개요.

없음

DatasetInfo

list_columns

사용 가능한 모든 열과 해당 데이터베이스 데이터 유형을 반환하는 스키마 검사.

없음

list[ColumnInfo]

describe_column

숫자 열에 대한 통계 지표(min, max, mean, median) 또는 범주형 열에 대한 범주 분포.

column: str

NumericColumnDescription / CategoricalColumnDescription

get_churn_summary

전체 고객 수, 이탈 수, 유지 수, 그리고 [0.0, 1.0] 범위의 이탈률.

없음

ChurnSummary

get_churn_by_dimension

승인된 차원(contract, internet_service, payment_method 등)으로 그룹화된 세그먼트별 이탈 지표.

dimension: str

DimensionChurnResult

run_readonly_sql

표준 도구로 처리되지 않는 복잡한 사용자 정의 계산을 위한 보호된 분석 SQL 실행.

query: str

SQLResult


🚀 빠른 시작 가이드

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.py

4. MCP 서버 실행

# Run server standalone over stdio
mcp-analytics
# or
python -m mcp_analytics.server

5. 대화형 GPT 데모 클라이언트 실행

.env 파일에 OpenAI API 키를 구성하세요:

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 또는 Cursor MCP 설정에 다음 구성을 추가하세요:

{
  "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)

이 프로젝트는 OpenSpec을 사용한 Spec-Driven Development (SDD) 방식으로 개발되었습니다. 모든 기능은 명시적인 제안, 델타 스펙, 설계 문서, 검증 가능한 작업을 통해 추적됩니다:

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 tools
describe_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.

NameRequiredDescriptionDefault
columnYes

Output Schema

NameRequiredDescription

No output parameters

TDQS

B3.2/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters2/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

NameRequiredDescriptionDefault
dimensionYes

Output Schema

NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

NameRequiredDescriptionDefault

No parameters

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.3/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

NameRequiredDescriptionDefault

No parameters

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.3/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

NameRequiredDescriptionDefault

No parameters

Output Schema

NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

NameRequiredDescriptionDefault
queryYes

Output Schema

NameRequiredDescription

No output parameters

TDQS

A4.9/5.0
Behavior5/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines5/5

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.

  1. 6 tool updatesv1.0.0
    • First observeddescribe_column
    • First observedget_churn_by_dimension
    • First observedget_churn_summary
    • First observedget_dataset_info
    • First observedlist_columns
    • First observedrun_readonly_sql

TDQS

A4.1/5.0

Scored across 6 tools

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness5/5

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

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    Enables 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.
    12
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables running read-only SQL queries and exploring DuckDB databases through MCP tools like listing tables, describing schemas, and fetching paginated data.
    -
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables 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
    -