kingbase-mcp-server: Instructions file for Claude Code

CLAUDE.md

kingbase-mcp-server CLAUDE.md is an instructions file for Claude Code from NekoTarou/kingbase-mcp-server. It costs 1,253 tokens per session, scanned B, original, MIT.

Project instructions for a Model Context Protocol server that connects coding agents to KingBase, a PostgreSQL-compatible database. They describe the project, its database tools, commands, architecture, and development limits.

In plain words
What is it for?
Use them when changing the KingBase database server, installing dependencies, building or running it, or inspecting its TypeScript structure and database operations.
Why use it?
They give an agent the repository context it needs to build, run, and understand the server without guessing how the project is organized.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is NekoTarou/kingbase-mcp-server's own configuration. It tells Claude Code how to work on kingbase-mcp-server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything kingbase-mcp-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to NekoTarou/kingbase-mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/NekoTarou/kingbase-mcp-server/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/NekoTarou/kingbase-mcp-server

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kingbase-mcp-server CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nekotarou/kingbase-mcp-server/claude-md.svg)](https://agentmods.dev/instructions/nekotarou/kingbase-mcp-server/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/nekotarou/kingbase-mcp-server/claude-md"><img src="https://agentmods.dev/badge/instructions/nekotarou/kingbase-mcp-server/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,253 This file is loaded in full into every session.
When invoked 1,253 The same file — it is already loaded in full.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01253 $0.01253
Opus 5 $0.00626 $0.00626
Sonnet 5 $0.00251 $0.00251
Haiku 4.5 $0.00125 $0.00125

Measured 8d ago against content hash dc87dfb259f8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade B, and why

kingbase-mcp-server CLAUDE.md scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Configure in `~/.claude/settings.json` as an MCP server:
CLAUDE.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

MCP (Model Context Protocol) server for KingBase, a PostgreSQL-compatible database. Exposes 11 database tools (query, DML, DDL, schema inspection, stats) over stdio and Streamable HTTP transports. Written in TypeScript as a single-file application (src/index.ts).

Build & Run

npm install          # install dependencies
npm run build        # compile TypeScript (tsc → dist/)
npm run dev          # development with watch mode (tsx watch)
npm start            # run compiled server via stdio (node dist/index.js)
npm run start:http   # run compiled server via HTTP (TRANSPORT=http)
npm run clean        # remove dist/

No test framework or linter is configured.

Architecture

The entire server lives in src/index.ts (~1085 lines), organized top-to-bottom:

  1. ConstantsCHARACTER_LIMIT (50k), DEFAULT_ROW_LIMIT (100), MAX_ROW_LIMIT (1000)
  2. Database layercreatePool() returns a pg.Pool (max 5 connections, 30s idle, 10s connect timeout). executeQuery() acquires a client, runs the query, and releases.
  3. HelpersformatRows() renders ASCII tables with truncation; handleDbError() extracts pg error details; isReadOnly() / isDangerousDDL() classify SQL statements.
  4. createServer() / registerTools() — Factory function that creates an McpServer instance and registers all tools. Called once for stdio, once per session for HTTP.
  5. Tool registrations — Each tool has a Zod input schema, MCP annotations (readOnlyHint, destructiveHint, etc.), and an async handler. Tools:
    • Read-only: kb_query, kb_list_schemas, kb_list_tables, kb_describe_table, kb_list_indexes, kb_list_constraints, kb_explain, kb_table_data, kb_table_stats
    • Write: kb_execute (DML), kb_execute_ddl (DDL)
  6. Main — Validates env, verifies DB connection, branches by TRANSPORT env var
  7. startHttpServer() — Express app with /mcp endpoint, stateful sessions via StreamableHTTPServerTransport

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 104 lines · 1,253 tokens per session scan B dc87dfb259f8

Subscribe to this mod's changes

kingbase-mcp-server CLAUDE.md is an instructions file published in the GitHub repository NekoTarou/kingbase-mcp-server (5 stars, last pushed 6mo ago), licensed MIT. It adds 1,253 tokens to every session, about $0.0063 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories