Connect MySQL to Claude Code

Inspect schema, tables, indexes and keys on a MySQL or MariaDB database. Add Toolspoke to Claude Code once and it can use 8 MySQL actions. Your MySQL credential stays in Toolspoke, and you choose which actions Claude Code may call.

Set it up in Claude Code

Three steps, the first one once for every toolkit you will ever add.

  1. Add Toolspoke to Claude Code

    Run it in your project, then /mcp to sign in

    claude mcp add --transport http toolspoke https://toolspoke.com/mcp

    The sign-in opens in your browser, and Toolspoke asks you to approve it.

  2. Install MySQL and connect it

    Add MySQL to a project in your Toolspoke workspace.

    Connection URL. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.

    Connection URL
    Use a read-only user where possible. The database in the path is the one every query runs against.
  3. Choose what Claude Code may do

    All 8 actions only read, and any of them can be switched off for a project.

What you can ask Claude Code for

A few of the MySQL actions that only read, so they are safe to try first.

  • Server version, current user and the database this install is pointed at
  • Tables and views in the connected database with their engine, estimated row count and size on disk
  • Every column of one table with its type, nullability, default and key role
  • Indexes on one table, in key order, with their uniqueness and cardinality

What Claude Code can do in MySQL

8 actions read.

Reads

  • Server info

    Server version, current user and the database this install is pointed at. The cheapest proof the credential works, and the health check.

  • List tables

    Tables and views in the connected database with their engine, estimated row count and size on disk. Row counts come from the information schema and are estimates for InnoDB, not exact counts. Call this before describe_table to learn a table name.

  • Describe table

    Every column of one table with its type, nullability, default and key role. Use list_tables first for the name.

  • List indexes

    Indexes on one table, in key order, with their uniqueness and cardinality. Read this before explaining why a query is slow.

  • List foreign keys

    Foreign keys declared in this database, both sides named, so a schema can be traversed without guessing at join columns.

  • List databases

    Databases this user can see. Informational only: every query runs against the database named in the connection URL, and this connector cannot switch.

  • Run query

    Run a SELECT and return its rows. The session is opened read-only, so an INSERT, UPDATE or DDL statement is refused by the server; the statement is also checked here for being a single read before it is sent. The query is wrapped in an outer LIMIT, so a missing WHERE clause does not return a whole table by accident.

  • Explain query

    The planner's chosen plan for a statement, without running it. Use it to explain a slow query before suggesting an index.

MySQL in Claude Code: questions

Does Claude Code see my MySQL credential?

No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.

Will 8 actions crowd Claude Code's context?

No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the MySQL action it needs when it needs it. Adding more toolkits does not add more tools to its list.

Can I add it once for every project?

Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.

What does it cost?

Tool calls are free on every plan. MySQL runs in a sandbox, so a call bills the sandbox time it uses.

Try MySQL in Claude Code

Free to start, and tool calls cost nothing on any plan.