# Migrating from other TiDB MCP servers

This server builds on and credits prior TiDB MCP work (see [NOTICE](NOTICE)). If you are
coming from one of the others, here is what changes.

## From `pingcap/pytidb` (`tidb-mcp-server`, the official one)

pytidb's MCP is Python, local-only, and data-plane only (roughly 7 tools) using env-var DB
credentials. Moving here you gain:

- **Management tools** (clusters, branches, regions) in addition to data tools.
- **Ephemeral, least-privilege SQL users** minted from your management API key, instead of
  configuring a database user by hand.
- A **remote endpoint** with auth (API key / OAuth 2.1), read-only defaults, and preflight
  confirmation on destructive/billable actions.

You supply a TiDB Cloud **management API key** (public/private pair) instead of a database
username/password. A bring-your-own SQL user is still supported via `TIDB_SQL_USER` /
`TIDB_SQL_PASSWORD`.

## From `likidu/mcp-server-tidbcloud`

Same problem space (Serverless management + SQL), rewritten for safety and coverage:

- SQL user tools use the **IAM REST API**, not SQL string interpolation (removes an
  injection class).
- Identifier escaping is centralized and property-tested; read-only is enforced by SQL
  **grant**, not regex.
- Adds preflight/confirm, redaction, observability, OAuth, tests, and CI.
- Published to npm under `@tidbcloud-mcp/*` (pending) with an Apache-2.0 license.

Tool names use the `tidb_*` prefix (e.g. `tidb_list_clusters`, `tidb_query`).

## From `c4pt0r/mcp-server-tidb`

That server is an abandoned Python stdio PoC with no management plane. This server is a
maintained, tested replacement with both transports and the full tool set.

## Config quick reference

| You had                        | Now use                                                                        |
| ------------------------------ | ------------------------------------------------------------------------------ |
| DB host/user/password env vars | `TIDB_CLOUD_PUBLIC_KEY` / `TIDB_CLOUD_PRIVATE_KEY` (management key)            |
| a fixed database user          | ephemeral users (automatic), or `TIDB_SQL_USER` / `TIDB_SQL_PASSWORD`          |
| local only                     | `stdio` locally, or the remote endpoint (see [docs/DEPLOY.md](docs/DEPLOY.md)) |
