Skip to main content
Glama

askDB MCP

자연어 데이터 질문을 LLM이 SQL을 작성하는 데 필요한 스키마 컨텍스트로 변환하는 MCP 서버입니다. 데이터베이스에 연결하지 않으며 SQL을 직접 생성하지도 않습니다. Pinecone 인덱스에서 올바른 테이블 정의를 검색하여 질문하는 모델(Claude Code, Claude Desktop, ChatGPT, Cursor)에게 전달합니다.

user question
   │
   ▼
Claude Code / ChatGPT ──calls──► askDB MCP ──semantic search──► Pinecone (ask-db)
   │                                  │
   │      relevant DDL + guardrails ◄─┘
   ▼
generated SQL

도구

도구

모델이 사용하는 경우

입력

search_schema

모든 텍스트-to-SQL 요청에 대한 첫 호출

question, top_k?, tables?, database?

get_table_schema

알려진 테이블의 모든 열이 필요할 때

tables[], database?

list_tables

방향 파악, 또는 검색 결과가 없을 때

database?

모든 응답에는 모델이 반환된 테이블과 열만 사용하도록 하는 지침이 포함되어 있어, 임의의 이름을 만들지 않습니다.

Related MCP server: Vanna AI MCP Server

설정

npm install
npm run setup             # creates .env from the template
#                          → then put your PINECONE_API_KEY in .env
npm run doctor            # verify connection, field mapping and retrieval quality

다른 사람과 공유하려고 하나요? SETUP.md를 보내주세요. 로컬 실행과 호스팅 인스턴스 연결 방법을 모두 다룹니다.

npm run doctor가 중요한 단계입니다. 인덱스 구성, 레코드가 실제로 사용하는 메타데이터 필드, 샘플 검색을 출력하므로, 클라이언트에 연결하기 전에 서버가 올바른 필드를 읽고 있는지 확인할 수 있습니다.

npm run doctor       # connectivity + retrieval sanity check
npm run smoke        # drive the stdio server with a real MCP client
npm run smoke:http   # same over Streamable HTTP, with bearer auth

클라이언트 연결

Claude Code

CLI, 데스크톱 앱, IDE 확장 프로그램은 모두 하나의 설정을 공유하므로, 이 설정은 세 가지 모두에 서버를 등록합니다:

# from the repo root — records an absolute path, so it works in any folder
claude mcp add askdb --scope user -- node "$PWD\src\server.js"

claude mcp list(askdb: ... ✓ Connected)로 확인한 후 데스크톱 앱이나 IDE 창을 다시 시작하세요. MCP 서버는 시작 시 로드됩니다.

사용자 범위는 의도적입니다. 다른 저장소에서 작업하는 동안 데이터베이스 질문을 하는 것이 목적이기 때문입니다. 프로젝트 범위의 .mcp.json은 Claude Code가 이 저장소의 루트에서 시작될 때만 적용되며, 두 범위 모두에서 askdb를 정의하면 Claude Code가 중복에 대해 경고합니다.

Claude Desktop / Cursor

claude_desktop_config.json(또는 Cursor의 MCP 설정)에 추가하세요:

{
  "mcpServers": {
    "askdb": {
      "command": "node",
      "args": ["D:\\working-directory\\AI\\askDB-mcp\\src\\server.js"]
    }
  }
}

자격 증명은 서버 옆의 .env에서 가져오므로 클라이언트 구성에 키가 포함되지 않습니다.

ChatGPT

ChatGPT 커넥터는 로컬 프로세스를 생성할 수 없습니다. HTTP를 통한 원격 MCP만 지원합니다. HTTP 전송을 실행하고 노출하세요:

# set MCP_AUTH_TOKEN first: this endpoint serves your whole schema
MCP_AUTH_TOKEN=some-long-random-string npm run start:http

그런 다음 커넥터를 https://<your-host>/mcp로 지정하고 Authorization: Bearer <token> 헤더를 사용하세요. 빠른 테스트를 위해서는 터널링(cloudflared tunnel --url http://localhost:3000)하고, 오래 유지할 용도라면 제대로 호스팅하세요. DEPLOY.md가 Netlify를 처음부터 끝까지 다룹니다. GET /health는 로드 밸런서 확인을 위해 인증이 필요 없습니다. /mcp는 MCP_AUTH_TOKEN이 설정되어 있을 때마다 Bearer 토큰을 요구합니다.

HTTP 전송은 상태 비저장입니다. 요청당 서버 인스턴스 하나이므로 고정 세션 없이 로드 밸런서 뒤에서 확장할 수 있습니다.

호스팅

두 개의 Netlify Functions로 배포됩니다. netlify.toml에 빌드 설정이 포함되어 있으므로 리포지토리를 가져오고 PINECONE_API_KEY + MCP_AUTH_TOKEN을 설정하는 것이 전부입니다. 단계별 가이드: DEPLOY.md.

이 방식은 전송 계층 재작성 없이 작동합니다. MCP SDK의 WebStandardStreamableHTTPServerTransport가 Request를 받아 Response를 반환하는데, 이는 Netlify Functions v2 시그니처이기 때문입니다. 따라서 netlify/functions/mcp.mjs는 src/mcp.js를 변경 없이 가져옵니다. 동일한 파일은 Cloudflare Workers, Deno 또는 Bun에서도 바로 사용할 수 있습니다. src/http.js는 컨테이너와 VM을 다룹니다.

GET /health는 토큰이 필요 없으며 필요한 환경 변수가 설정되었는지 보고합니다(값이 아닌 존재 여부만). 시작 로그를 읽는 서버리스 대안입니다. /mcp는 기본적으로 차단됩니다: MCP_AUTH_TOKEN이 설정되지 않으면 스키마를 인터넷에 제공하는 대신 503을 반환합니다.

서버가 가동되면 팀원은 아무것도 설치할 필요가 없습니다. URL과 토큰만 있으면 됩니다 (SETUP.md, Route A).

구성

API 키를 제외한 모든 항목은 선택 사항입니다. .env.example을 참조하세요.

변수

기본값

참고

PINECONE_API_KEY

—

필수

PINECONE_INDEX

ask-db

PINECONE_NAMESPACE

(기본 네임스페이스)

TOP_K

8

검색당 스키마 청크 수

EMBED_MODEL

multilingual-e5-large

업서트할 때 사용한 모델과 일치해야 함

RERANK_MODEL

(꺼짐)

예: bge-reranker-v2-m3; 활성화 전에 측정하세요

DEFAULT_DATABASE

(전체)

모든 조회를 하나의 데이터베이스로 범위 지정

SQL_DIALECT

ANSI SQL

모델에 힌트로 전달됨

TEXT_FIELDS / TABLE_FIELDS / DB_FIELDS

.env.example 참조

후보 메타데이터 키, 순서대로 시도됨

LIST_SCAN_LIMIT

1000

list_tables 스캔 상한

서버는 레코드가 사용하는 메타데이터 필드와 인덱스에 통합 임베딩이 있는지 자동으로 감지하므로 기본값이 일반적으로 변경 없이 작동합니다.

알아두면 좋은 두 가지

임베딩 모델이 일치해야 합니다. EMBED_MODEL이 스키마를 업서트할 때 사용한 모델이 아니면 모든 점수가 거의 0으로 떨어지고 결과는 노이즈가 됩니다. 벡터가 서로에 대해 사실상 무작위이기 때문입니다. npm run doctor는 관련 없는 테이블이 0.8 대신 0.01 정도의 점수로 반환되는 것으로 이를 보여줍니다. 이 인덱스는 multilingual-e5-large로 구축되었습니다.

인덱스에 여러 환경이 있다면 DEFAULT_DATABASE를 설정하세요. 동일한 스키마가 *_live와 *_test로 존재할 때, 범위를 지정하지 않은 검색은 모든 테이블의 두 복사본을 반환하여 top_k 슬롯의 절반을 중복으로 소모하고 모델이 하나의 쿼리에서 환경을 혼합하게 만듭니다.

파일 구조

파일

역할

src/mcp.js

도구 정의 — MCP 표면

src/pinecone.js

조회: 검색, 정확한 가져오기, 필드 감지, 리랭크

src/format.js

히트를 모델이 읽는 스키마 블록으로 렌더링

src/server.js

stdio 진입점

src/http.js

Streamable HTTP 진입점

src/config.js

환경 변수 로딩 및 기본값

scripts/doctor.js

연결 및 검색 진단

netlify/functions/

서버리스 진입점 — /mcp 및 /health

netlify.toml

Netlify 빌드 및 라우팅 구성

DEPLOY.md

호스팅 가이드

Available Tools

3 tools
get_table_schemaGet schema for specific tablesA
Read-only

Fetch the full stored DDL for one or more tables by exact name. Use after search_schema when you need every column of a table, or when the user named the table.

ParametersJSON Schema
NameRequiredDescriptionDefault
tablesYesExact table names, e.g. ["tbl_account", "tbl_order"].
databaseNoRestrict to one database/schema — omit to search all of them.
namespaceNoPinecone namespace override.

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare the tool as read-only and open-world, so the behavioral burden is lower. The description clarifies that DDL is returned for exact table names, but does not add details like pagination limits, error handling for missing tables, or performance traits beyond what annotations signal.

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 extremely concise—two short sentences that immediately convey purpose and usage context. There is no wasted wording, and every sentence 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's simplicity, strong annotations, and complete schema, the description is largely complete. It could optionally mention that the output is raw DDL (though implicit), but lack of output schema does not diminish clarity given the straightforward fetch operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already thoroughly documents all three parameters. The description adds no extra semantics beyond what the schema provides, so a baseline score of 3 is appropriate.

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 the tool fetches 'full stored DDL for one or more tables by exact name', using specific verbs and resources. It also distinguishes itself from sibling tool 'search_schema' by indicating when to use this tool after that one.

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 provides explicit guidance on when to use this tool ('after search_schema when you need every column') and references the user naming a table. However, it does not explicitly state when not to use it or mention any alternatives like 'list_tables'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_tablesList available tablesA
Read-only

Inventory of every table in the schema index, grouped by database, plus the index configuration. Use it to orient yourself, or when search_schema comes back empty.

ParametersJSON Schema
NameRequiredDescriptionDefault
databaseNoRestrict to one database/schema — omit to search all of them.
namespaceNoPinecone namespace override.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and openWorldHint=true, covering safety and scope. The description adds beyond annotations by stating that results are grouped by database and include index configuration. No behavioral traits (like performance impact or pagination) are discussed, but for a read-only inventory tool this is adequate.

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 with zero wasted words. The first sentence defines the core functionality, and the second provides usage guidance. It is front-loaded and every part earns its place.

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?

For a simple list tool with no output schema, the description gives a sufficient mental model: inventory, grouping by database, and inclusion of index configuration. Could be slightly more explicit about the return structure (e.g., whether it's flat or nested), but fine given the tool's simplicity and the presence of sibling context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with clear descriptions for both optional parameters (database filter and namespace override). The description does not elaborate further on parameter semantics beyond what the schema provides, so it meets the baseline expected when schema does the heavy lifting.

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 the tool provides an 'Inventory of every table in the schema index, grouped by database, plus the index configuration.' It uses specific verbs and nouns, and distinguishes itself from sibling tools like search_schema by indicating when to use it (when search_schema returns empty).

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 explicitly says 'Use it to orient yourself, or when search_schema comes back empty,' providing clear usage context. It does not mention when to avoid this tool or use get_table_schema, but the positive guidance is strong and helps an agent decide between siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_schemaSearch database schemaA
Read-only

Semantic search over the database schema stored in Pinecone. Call this FIRST for any text-to-SQL request: pass the user question verbatim and you get back the relevant tables, columns, types and relationships to write the query against.

ParametersJSON Schema
NameRequiredDescriptionDefault
top_kNoHow many schema chunks to retrieve (default 8).
tablesNoRestrict the search to these table names, when you already know them.
databaseNoRestrict to one database/schema — omit to search all of them.
questionYesThe natural-language data question, e.g. "top 10 accounts by transaction volume last month".
namespaceNoPinecone namespace override.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint=true and openWorldHint=true, so the description's disclosure burden is lower. The description adds context about the Pinecone vector store and the first-step pipeline role, which is valuable beyond annotations.

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, no wasted words. The first sentence defines the tool, the second provides usage instruction. Front-loaded and efficient.

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?

No output schema, but the description indicates what is returned (relevant tables, columns, types, relationships). For a semantic search tool, this is sufficient. The tool is moderately complex (5 params, no nested objects) and the description covers its role adequately.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so all 5 parameters are documented in the schema. The description reinforces the 'question' parameter by saying 'pass the user question verbatim' but does not add new semantics beyond what the schema provides for other parameters. Baseline 3 is appropriate.

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 it performs semantic search over the database schema stored in Pinecone, explicitly for text-to-SQL requests. It distinguishes from siblings by positioning itself as the first step and mentioning retrieval of tables, columns, types, and relationships.

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 explicitly says 'Call this FIRST for any text-to-SQL request', providing clear context for when to use. It doesn't explicitly exclude alternatives like get_table_schema or list_tables, but the 'first step' instruction implies the workflow.

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. 3 tool updatesv1.0.0
    • First observedget_table_schema
    • First observedlist_tables
    • First observedsearch_schema

TDQS

A4.3/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: search_schema for semantic discovery, get_table_schema for exact DDL retrieval, and list_tables for inventory. There is no overlap or ambiguity between them.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (search_schema, get_table_schema, list_tables), making them predictable and easy to understand.

Tool Count4/5

Three tools is minimal but appropriate for the focused domain of database schema exploration. Each tool earns its place and covers the essential operations without being overly sparse.

Completeness5/5

The tool set fully covers schema discovery: semantic search, exact schema lookup, and table listing. For the stated purpose of enabling text-to-SQL by providing schema info, there are no obvious gaps.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP-Server from your Database optimized for LLMs and AI-Agents. Supports PostgreSQL, MySQL, ClickHouse, Snowflake, MSSQL, BigQuery, Oracle Database, SQLite, ElasticSearch, DuckDB
    547
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that allows AI assistants to query databases using natural language by leveraging Vanna AI. It supports secure SSH tunneling, model training on database schemas, and persistent storage of SQL patterns via ChromaDB.
    2
    -
  • F
    license
    A
    quality
    D
    maintenance
    An MCP server that connects LLMs to SQL databases for development assistance, enabling query execution, schema exploration, and data manipulation while providing safety controls against destructive operations.
    5
    -
  • F
    license
    Not graded
    quality
    A
    maintenance
    An MCP server that exposes relational databases (PostgreSQL/MySQL) to AI agents with natural language to SQL query support.
    19
    -