db-query-mcp
Provides tools for executing SQL queries (SELECT, SHOW, DESC, EXPLAIN, DML, DDL) on MariaDB databases, with security features like connection info hiding, read-only connections, and query logging.
Provides tools for executing SQL queries (SELECT, SHOW, DESC, EXPLAIN, DML, DDL) on MySQL databases, with security features like connection info hiding, read-only connections, and query logging.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@db-query-mcpList tables in the development database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
db-query-mcp
Claude Code(또는 다른 AI)에서 사용하는 자체 제작 DB 쿼리 실행 MCP 서버 (MySQL / MariaDB).
설계 원칙 (보안)
접속 정보는 AI에게 절대 노출되지 않는다.
db-connection-env(host/user/password)는 MCP 서버 프로세스 내부에서만 읽는다.AI가 볼 수 있는 것은
db-connection-list의 번호 + 별칭뿐이다.
설정 파일 생성에 AI가 개입하지 않는다.
npm run setup을 사용자가 터미널에서 직접 실행해 생성한다. MCP 도구로 노출되지 않는다.
DML/DDL은 사용자 승인 후에만 실행된다.
읽기 쿼리(
run_select_query)와 변경 쿼리(run_write_query)를 별도 도구로 분리.Claude Code 권한 설정에서
run_write_query를ask로 두면 실행 직전 화면에서 직접 승인.
다중 문장 실행 차단(
SELECT 1; DROP ...불가), 결과 최대 50행, SELECT 타임아웃 90/120/150초(최대 3회 재시도)·WRITE 150초(단일 시도).SELECT ... INTO OUTFILE/DUMPFILE은 첫 키워드가 SELECT여도 DB 서버에 파일을 쓰므로 읽기 쿼리에서 차단한다.readonly차단은 도구가 아니라 실행 계층에서 강제되어 어떤 경로로도 우회되지 않는다.
Related MCP server: DB Agent MCP Server
설정 파일 (~/.db-query-mcp/)
# db-connection-list (번호=별칭)
1=로컬 개발 DB
2=운영 DB
# db-connection-env (번호.key=value)
1.host=localhost
1.port=3306
1.user=devuser
1.password=****
1.database=mg_service
# 선택 옵션
2.host=10.0.0.5
2.user=readonly_user
2.password=****
2.ssl=true # true=인증서 검증, skip-verify=자체서명 허용, 생략=TLS 미사용
2.readonly=true # true면 변경 쿼리(run_write_query)를 서버가 강제 차단
ssl·readonly은npm run setup실행 시 질문으로 입력받아 자동 기록된다.
설치 (Windows / macOS 공통)
GitHub에서 설치 (가장 간단)
이 저장소가 곧 Claude Code 플러그인 마켓플레이스입니다. 실행에 필요한 번들(dist/*.mjs)이 저장소에 포함되어 있어 clone·npm install·빌드 없이 바로 설치됩니다.
1단계 — 마켓플레이스를 등록합니다. Claude Code 세션에서:
/plugin marketplace add mark3lim/db_query_mcp2단계 — 플러그인을 설치합니다.
/plugin install db-query@db-query-marketplace설치 범위(user / project / local)를 물어보면 선택합니다. 범위별 차이는 아래 방법 B의 표와 같습니다.
3단계 — 세션을 새로 시작합니다. stdio MCP 서버의 도구는 세션 시작 시 인식됩니다.
4단계 — 확인합니다.
/mcp # db-query 가 connected 인지, 도구가 보이는지 확인5단계 — DB 접속 정보를 등록합니다. 플러그인 설치는 MCP 도구 등록까지만 합니다. 접속 정보(ID/PW)는 보안상 AI가 만들지 않으므로 터미널에서 직접 한 번 실행해야 합니다.
# 저장소를 받아 setup 실행 (npm install 불필요 — 번들이 포함되어 있음)
git clone https://github.com/mark3lim/db_query_mcp.git
node db_query_mcp/dist/setup.mjs접속 정보는 ~/.db-query-mcp/(홈)에 저장되므로, setup을 실행한 폴더 위치는 상관없습니다. 등록만 끝나면 clone한 폴더는 지워도 플러그인은 정상 동작합니다. 별칭만 바꾸려면 같은 방식으로 node db_query_mcp/dist/rename.mjs 를 실행하세요.
업데이트 / 제거
/plugin update db-query@db-query-marketplace
/plugin uninstall db-query@db-query-marketplace/plugin으로 설치 — 로컬 파일만 사용 (클라우드/깃 불필요)
이 폴더 자체가 Claude Code 플러그인입니다. 의존성을 단일 파일(dist/bundle.mjs)로 번들해 두어 npm install/빌드 없이 바로 동작합니다. 아래 두 방법 모두 로컬 폴더만 쓰며, 외부에 올릴 필요가 없습니다.
방법 A — skills 폴더에 넣기 (설치 명령조차 없음, 가장 간단)
압축 푼 폴더를 통째로 아래 위치에 두기만 하면 됩니다. 마켓플레이스 등록도, 설치 명령도 필요 없고, 그 자리에서 그대로 로드됩니다(캐시 복사 안 함).
~/.claude/skills/db-query/이 폴더 안에 .claude-plugin/plugin.json 과 .mcp.json 이 있으면 됩니다(압축에 포함되어 있음). 폴더를 넣은 뒤:
Claude Code를 재시작(또는 새 세션 시작)합니다.
/mcp로db-query서버가 connected 인지, 도구(list_connections등)가 보이는지 확인합니다.DB 접속 정보를 한 번 등록합니다(아래 "접속 정보 등록" 참고).
이 방식은 항상
~/.claude/skills/에 둔 그 폴더를 직접 실행합니다. 폴더를 옮기거나 지우면 동작이 멈춥니다.
방법 B — /plugin install (로컬 마켓플레이스 등록)
/plugin install을 쓰고 싶다면, 깃 없이 로컬 폴더 경로로 마켓플레이스를 등록하면 됩니다.
1단계 — 폴더를 고정 위치에 둡니다. 예: ~/tools/db-query. (마켓플레이스 등록·업데이트의 출처가 되므로 옮기거나 지우지 마세요.)
2단계 — 로컬 경로로 마켓플레이스를 등록합니다. git URL이 아니라 폴더 절대경로를 줍니다.
/plugin marketplace add /절대경로/db-query대화형으로 하려면
/plugin→Marketplaces탭 →+ Add Marketplace에서 로컬 폴더 경로를 입력해도 됩니다.
3단계 — 플러그인을 설치합니다. (마켓플레이스 이름 db-query-marketplace, 플러그인 이름 db-query)
/plugin install db-query@db-query-marketplace4단계 — 설치 범위를 선택합니다. 설치 시 Claude Code가 범위를 물어봅니다.
범위 | 적용 대상 | 저장 위치 |
user | 내 모든 프로젝트 |
|
project | 이 프로젝트(레포로 공유) |
|
local | 이 프로젝트의 나만(gitignore) |
|
5단계 — 세션을 새로 시작합니다. stdio MCP 서버의 도구는 세션 시작 시 인식됩니다. 세션 도중 설치했다면 재시작(또는 /reload-plugins)하세요.
6단계 — 확인합니다.
/plugin # Installed 탭에서 db-query 가 enabled 인지 확인
/mcp # db-query 서버가 connected 인지, 도구가 보이는지 확인도구가 0개로 나오면 5단계(세션 재시작)를 다시 하세요.
참고:
/plugin install로 설치하면 플러그인이~/.claude/plugins/cache/로 복사되어 실행됩니다. 번들이 폴더 안에 self-contained 라 복사돼도 정상 동작합니다. 다만 업데이트(/plugin update)를 위해 원본 폴더는 그대로 두는 게 좋습니다. 복사가 싫고 "그 자리 실행"을 원하면 방법 A를 쓰세요.
관리 명령(참고)
/plugin list # 설치된 플러그인 목록
/plugin update db-query@db-query-marketplace # 업데이트
/plugin uninstall db-query@db-query-marketplace # 제거
/plugin marketplace remove db-query-marketplace # 마켓플레이스 제거접속 정보 등록 (두 방법 공통, 한 번만)
플러그인 설치는 MCP 도구 등록까지만 합니다. DB 접속 정보(ID/PW)는 보안상 AI가 만들지 않으므로, 터미널에서 한 번 직접 등록하세요. setup.js는 외부 라이브러리 없이 Node 기본 기능만 쓰므로 npm install 없이 바로 실행됩니다. 접속 정보는 ~/.db-query-mcp/ (홈)에 저장되어 폴더 위치와 무관합니다.
# 방법 A(skills 폴더)
node ~/.claude/skills/db-query/dist/setup.mjs
# 방법 B(고정 위치)
node /절대경로/db-query/dist/setup.mjs별칭만 바꾸려면 같은 폴더에서 node dist/rename.mjs 를 실행하세요.
setup.js는 외부 라이브러리 없이 Node 기본 기능만 쓰므로npm install없이 바로 실행됩니다. 연결 별칭만 바꾸려면 같은 폴더에서node dist/rename.js를 실행하세요.
압축을 푼 폴더에서 아래를 실행하면 라이브러리 설치 + 빌드가 자동으로 끝나고, 다음 단계 명령이 화면에 안내됩니다.
# macOS / Linux
bash install.sh
# Windows: 탐색기에서 install.bat 더블클릭, 또는
install.bat실행하면 등록 범위(user / project / local)를 물어보고, 선택한 범위로 claude mcp add까지 자동 실행합니다(claude CLI가 PATH에 있을 때). project/local은 실행한 폴더 기준으로 등록되니, 본인 프로젝트 폴더에서 실행하세요.
수동 설치 (단계별)
# 1. 의존성 설치 및 빌드
cd db-query-mcp
npm install
npm run build
# 2. DB 연결 등록 (대화형 — 반드시 사용자가 직접 실행)
npm run setup
# 3. Claude Code에 등록 (절대 경로 사용, --scope로 범위 선택)
# --scope user : 모든 프로젝트 (기본)
# --scope project : 이 프로젝트만 (.mcp.json, 팀 공유)
# --scope local : 이 프로젝트 개인용 (gitignore)
# macOS/Linux
claude mcp add --scope user --transport stdio db-query -- node /절대경로/db-query-mcp/dist/index.js
# Windows (PowerShell)
claude mcp add --scope user --transport stdio db-query -- node C:\절대경로\db-query-mcp\dist\index.js
# 4. 등록 확인
claude mcp list권한 설정 (DML/DDL 사용자 확인)
~/.claude/settings.json 또는 프로젝트의 .claude/settings.json:
{
"permissions": {
"allow": [
"mcp__db-query__list_connections",
"mcp__db-query__run_select_query"
],
"ask": [
"mcp__db-query__run_write_query"
]
}
}SELECT 계열은 자동 실행 → 생산성 확보
INSERT/UPDATE/DELETE/DDL은 매번 화면에서 사용자가 직접 승인 → 안전성 확보
제공 도구
도구 | 설명 |
| 번호+별칭 목록 조회 (접속 정보 비노출) |
| 읽기 쿼리(SELECT/SHOW/DESC/EXPLAIN, |
| DML/DDL 실행. read-only 연결은 서버가 차단, 그 외에도 권한 설정(ask)으로 화면 승인 권장 |
| 접속 가능 여부만 확인(SELECT 1). 데이터·접속정보 비노출 |
| 최근 실행 쿼리(select/write) 최대 10개를 최신순으로 반환 |
| AI가 직접 못 하는 관리 작업(연결 추가/수정/삭제·별칭 변경)의 실행 명령어를 정확한 경로와 함께 안내 |
get_management_commands는 사용자가 "DB 추가해줘", "별칭 바꿔줘"처럼 AI가 보안상 수행할 수 없는 작업을 요청할 때, AI가 호출해서 실제 프로젝트 경로가 들어간 명령어를 사용자에게 안내하는 용도입니다. 직접 작업을 수행하지는 않습니다.
보안·안정성 처리
에러 마스킹: DB 에러 메시지의 host/port/user는
***로 가려 응답에 노출되지 않는다.read-only 연결:
N.readonly=true인 연결은 권한 설정과 무관하게 서버가 변경 쿼리를 차단한다.대용량 SELECT: 스트리밍으로 최대 50행만 메모리에 적재해 OOM을 방지한다.
SELECT 타임아웃·재시도: 90초 → 120초 → 150초로 최대 3번 시도한다. 시간 초과일 때만 더 긴 타임아웃으로 재시도하며(SQL 에러는 즉시 반환), 3번 모두 초과하면 사용자에게 알린다.
WRITE 타임아웃: 단일 시도(150초). 타임아웃 후 자동 재시도는 중복 적용(이중 INSERT/UPDATE) 위험이 있어 하지 않는다.
타입 직렬화: BIGINT는 문자열로, BLOB/바이너리는
<BLOB n bytes>로 안전하게 표기한다.TLS:
N.ssl=true(검증) /skip-verify(자체서명 허용)로 원격 DB 암호화 연결을 지원한다.쿼리 로그: 최근 10개(시각·연결번호·종류·성공여부·쿼리문)를
~/.db-query-mcp/query-log.json(권한 600)에 보관한다. 쿼리 결과와 접속 정보는 저장하지 않는다.
사용자: notification 테이블 최근 10건 조회해줘
AI: list_connections 호출 → "1. 로컬 개발 DB / 2. 운영 DB 중 어디에 연결할까요?"
사용자: 1번
AI: run_select_query("1", "SELECT * FROM notification ORDER BY id DESC LIMIT 10")
→ 결과 표시연결 추가/수정
연결 추가 / 접속 정보 변경:
npm run setup을 다시 실행. 같은 번호를 입력하면 기존 정보를 덮어쓴다.별칭만 수정:
npm run rename실행. 등록된 목록에서 번호를 고르고 새 별칭을 입력하면 된다. 접속 정보(db-connection-env)는 건드리지 않고db-connection-list의 별칭만 바꾼다.삭제: 두 파일에서 해당 번호 줄을 직접 지우면 된다.
setup,rename모두 터미널에서 사용자가 직접 실행하며 MCP 도구로 노출되지 않는다. 따라서 별칭 수정 과정에도 AI/서버 통신이 개입하지 않는다.
Available Tools
6 toolsget_management_commandsA
사용자가 DB 연결을 추가/삭제하거나, 접속 정보(ID·PW·host 등)를 변경하거나, 별칭을 수정하려고 할 때 호출한다. 이런 작업은 보안상 AI(MCP)가 직접 수행할 수 없고 사용자가 터미널에서 직접 실행해야 한다. 이 도구가 반환한 명령어를 사용자에게 그대로 안내하라. 임의로 명령어를 지어내지 말 것.
| Name | Required | Description | Default |
|---|---|---|---|
| task | No | 안내할 작업: add(연결 추가) / edit_credentials(접속정보 변경) / rename_alias(별칭 수정) / delete(연결 삭제) / all(전체). 생략 시 all. |
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 does not perform the action itself but returns commands for the user to run, and it warns against fabricating commands. It could add more detail about the output format (e.g., whether it returns a list of commands or a single string), but the core behavioral trait is clearly disclosed.
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 concise and front-loaded: it states the trigger condition, the security rationale, and the required agent behavior in three sentences. Every sentence earns its place, and there is no redundant information.
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 tool with one optional parameter and no output schema, the description is quite complete. It explains the purpose, the security constraint, and the expected agent behavior. It could be slightly more explicit about what the return value looks like (e.g., a list of commands), but given the simplicity of the tool, this is a minor gap.
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?
Schema coverage is 100% and the single parameter has a clear enum with descriptions. The description adds context by explaining the overall purpose of the task parameter (which operation the user wants), but the schema already covers the parameter well. The description's mention of the five task types aligns with the enum, so it adds modest value beyond the 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 states a specific purpose: it returns terminal commands for DB connection management tasks (add/delete/edit credentials/rename alias) that the AI cannot perform directly. It clearly distinguishes itself from siblings like list_connections or run_select_query by focusing on generating user-facing commands rather than executing operations.
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 when to use it (when the user wants to add/delete/modify DB connections or aliases) and why (security: AI cannot perform these directly). It also instructs the agent to present the returned commands verbatim and not to invent commands, which is clear usage guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_recent_queriesA
최근 실행한 쿼리(select/write) 최대 10개를 최신순으로 반환한다. 사용자가 '방금/최근에 무슨 쿼리 실행했어?'처럼 물으면 호출한다. 쿼리 결과나 접속 정보는 보관/반환하지 않는다.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the behavioral disclosure burden. It discloses what is returned (up to 10 select/write queries in latest order) and what is deliberately not stored or returned (query results and connection info), providing useful expectations beyond the empty schema.
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 short sentences, each earning its place: core behavior, trigger condition, and limitation. It is front-loaded and contains no redundant phrasing.
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 zero-parameter, no-output-schema history-retrieval tool, the description covers the return cap, ordering, trigger context, and exclusions. An agent can confidently call it and interpret the outcome without additional metadata.
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 and schema coverage is 100%, so no parameter documentation is required; the baseline for zero-parameter tools is 4. The description adds return-semantics context rather than input details, which is appropriate here.
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 ('반환한다') and resource ('최근 실행한 쿼리(select/write)') with clear constraints: maximum 10, latest first. This unambiguously distinguishes it from siblings like run_select_query, run_write_query, and list_connections.
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 gives an explicit trigger condition: call when the user asks '방금/최근에 무슨 쿼리 실행했어?'. It does not explicitly state when not to use it or name alternatives, but the context is clear enough for an agent to select this tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_connectionsA
등록된 DB 연결 목록(번호와 별칭)을 조회한다. 어떤 DB를 쓸지 모호하면 이 목록을 사용자에게 보여주고 번호를 선택받는다.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the transparency burden. It conveys read-only intent ('조회') and the output content, but does not address prerequisites, error behavior, or whether the list is complete or ordered. For a simple non-mutating list this is adequate but not detailed.
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: the first states the result, the second gives the user-interaction usage rule. No filler, and the key information is front-loaded.
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 parameterless listing tool, the description covers what it returns and when to use it. It could add a note on output shape/ordering or side-effect safety, but no output schema exists, so the description is nearly complete.
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 and the schema documents this with 100% coverage, so there is no parameter meaning for the description to add. Baseline 4 applies.
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?
Description states a specific action ('retrieves list of registered DB connections') and the returned content ('numbers and aliases'). This clearly differentiates it from sibling query/write/test tools that operate on an already-chosen connection.
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 gives an explicit trigger: when the target DB is ambiguous, show the list to the user and ask them to pick a number. However, it does not name sibling tools or state when not to use it, so it is not a complete routing guide.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
run_select_queryA
읽기 전용 쿼리(SELECT, SHOW, DESC, EXPLAIN)를 실행하고 결과를 반환한다. 데이터를 변경하는 쿼리는 거부된다.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | 실행할 읽기 전용 SQL 한 문장 | |
| connection_no | Yes | list_connections에서 확인한 DB 연결 번호 (예: '1') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden of behavioral disclosure. It clearly states the tool is read-only and rejects data-modifying queries, which is the most important behavioral trait. It does not detail error handling or result formatting, but for a simple execution 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single succinct sentence that front-loads the core purpose and the critical restriction (rejecting write queries). Every word earns its place; no fluff or redundancy.
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 tool with only 2 parameters and full schema coverage, the description provides sufficient context: it tells the agent what the tool does, that it's read-only, and that connection_no comes from list_connections. The absence of an output schema means no return format is expected, so the description is complete enough for correct invocation.
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 already fully documents both parameters with clear descriptions (query as read-only SQL, connection_no from list_connections). The description adds no new semantic detail beyond reinforcing the read-only nature, so the baseline of 3 applies as the schema does the heavy lifting.
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 tool executes read-only queries (SELECT, SHOW, DESC, EXPLAIN) and returns results. It explicitly distinguishes itself from the sibling run_write_query by stating that data-modifying queries are rejected, making the purpose unambiguous.
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 indicates when to use this tool (for read-only operations) and sets the boundary against write queries. It also references list_connections for obtaining connection_no, implying a prerequisite step. However, it doesn't explicitly name the alternative tool for write operations, though it's implied by the tool naming and the rejection statement.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
run_write_queryA
데이터를 변경하는 쿼리(INSERT/UPDATE/DELETE/DDL 등)를 실행한다. 반드시 실행 전에 사용자에게 쿼리 내용을 보여주고 승인을 받아야 하며, Claude Code 권한 설정(ask)에 의해 실행 직전 화면에서 한 번 더 확인된다. 읽기 전용(read-only)으로 등록된 연결에서는 서버가 강제로 거부한다.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | 실행할 SQL 한 문장 (DML/DDL) | |
| connection_no | Yes | list_connections에서 확인한 DB 연결 번호 (예: '1') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses critical behavioral traits: it requires user approval before execution, Claude Code permission settings (ask) will double-check right before execution, and read-only connections will be forcibly rejected by the server. These are important behavioral details beyond what annotations would provide. Since no annotations are provided, the description carries the full burden and does it well, though it could mention what happens on failure or the return format.
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 concise and front-loaded with the core purpose, then adds essential behavioral warnings. It's three sentences with no wasted words. It could be slightly more structured, but it's efficient and informative.
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 mutation tool with no annotations and no output schema, the description covers the key operational context: what it does, the approval requirement, the double-check mechanism, and the read-only rejection behavior. It doesn't describe the return value or error handling, but for a write tool that's less critical. The sibling context (run_select_query exists) makes the read/write distinction clear.
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?
Schema description coverage is 100%, so the schema already documents both parameters (query and connection_no). The description adds context that the query is a single SQL statement (DML/DDL) and that connection_no comes from list_connections, which is helpful. However, it doesn't add much beyond the schema's own descriptions, so baseline 3 is appropriate.
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 tool executes data-modifying SQL queries (INSERT/UPDATE/DELETE/DDL), distinguishing it from read-only query tools. The verb '실행한다' (executes) with the specific resource (data-changing queries) makes the purpose unambiguous.
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 provides clear context on when to use this tool: for data-modifying queries, and it implicitly contrasts with read-only connections. It also mentions the approval requirement before execution. However, it doesn't explicitly name the sibling alternative (run_select_query) for read-only queries, so it's not a full 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
test_connectionA
지정한 번호의 DB에 실제로 접속되는지 확인한다(SELECT 1). 접속 정보나 데이터는 노출하지 않고 성공/실패만 반환한다.
| Name | Required | Description | Default |
|---|---|---|---|
| connection_no | Yes | list_connections에서 확인한 DB 연결 번호 (예: '1') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full transparency burden. It discloses that the tool performs a real SELECT 1 connection test, that it does not expose connection information or data, and that it only returns success/failure. This covers the key behavioral traits, though it omits potential timeout or error behavior.
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 short sentences, front-loaded with the core action and then the result behavior. Every word earns its place with no redundancy.
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 single-parameter tool with no output schema, the description sufficiently explains what it does and what it returns. It does not mention prerequisites or failure details, but the schema's parameter description already references list_connections, so the overall definition is fairly complete.
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?
Schema description coverage is 100% for the sole parameter connection_no, including an example from list_connections. The description's reference to '지정한 번호' adds little beyond the schema, so the baseline score of 3 is appropriate.
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 tool's purpose: to verify actual connectivity to the specified DB connection number via SELECT 1. It also distinguishes itself from data-returning queries by explicitly noting that it only returns success/failure and does not expose connection info or data.
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 use case is implied — use this tool to check connectivity — but the description does not explicitly contrast it with siblings like run_select_query or list_connections, nor does it state when not to use it. An agent can infer the purpose, but explicit routing guidance is absent.
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
get_management_commands - First observed
get_recent_queries - First observed
list_connections - First observed
run_select_query - First observed
run_write_query - First observed
test_connection
TDQS
Scored across 6 tools
Each tool has a distinctly different purpose: listing connections, testing connections, running read-only queries, running write queries, fetching management commands, and retrieving recent queries. There is no meaningful overlap that would confuse an agent's tool selection.
All tool names follow a consistent snake_case verb_noun pattern (list_connections, run_select_query, test_connection, run_write_query, get_management_commands, get_recent_queries). The naming clearly signals the action and target of each tool.
Six tools is well-scoped for a DB query MCP server. Each tool covers a necessary part of the workflow—connection discovery, connectivity checks, read/write query execution, management guidance, and query history—without unnecessary bloat.
The tool surface covers the core DB interaction lifecycle: list connections, test availability, run read queries, run write queries, and review recent queries. Connection management is intentionally delegated to terminal commands, and the provided tool properly guides users through that process, so there are no obvious dead ends.
Maintenance
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
- dataOAuthco.thinair
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Draxlr's remote MCP server connects AI assistants to your SQL databases and dashboards. Explore schemas, run read-only queries, manage saved queries and dashboards, and export results, all with row-level security so each user sees only their own data.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely query MySQL databases with read-only access by default, supporting table listing, structure inspection, and SQL queries with optional write operation control.6 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables secure interaction with MySQL databases through SQL queries, supporting read-only operations without approval and write operations with user confirmation.4 npmISC
- AlicenseAqualityDmaintenanceEnables AI assistants to safely query MySQL databases with read-only access, featuring SQL injection protection, connection pooling, and automatic query limits for secure database exploration.431 npmMIT
- AlicenseBqualityCmaintenanceEnables AI assistants to securely interact with MariaDB and MySQL databases using granular per-connection read/write permissions and transaction support. It allows users to manage multiple database connections, explore schemas, and execute controlled SQL queries through a standardized interface.611 npm5MIT