Preferences

MCP Server

TablePlus has a built-in MCP (Model Context Protocol) server. With it, AI tools such as Claude Code, Codex, or any other MCP client can list your saved connections, open them, and run queries through TablePlus. Custom agents in the LLM Plugin use the same server to reach your database.

The server runs inside TablePlus on your Mac. Clients connect with an access token, and you decide what each token is allowed to do and which connections it can see.

Turn on the server

  1. Open Preferences > MCP.
  2. Check Enable MCP Server.

The status line shows MCP Server is Running on port: 51003 (or the port you chose) and the number of connected clients. Once enabled, the server starts every time TablePlus opens.

You can also open this tab from Open Anything: press ⌘ + P and choose MCP Server.

The MCP tab of Preferences with the server running, the Claude Code client setup and an access token
Preferences > MCP

Server options

Option Description
Preferred Port The port the server listens on. The default is 51003. Use a port between 32000 and 61000.
Allow remote access (TLS) Lets other machines connect over HTTPS. By default the server only accepts connections from your own Mac.
Export Certificate… Saves the server's self-signed TLS certificate (tableplus-mcp.pem). Install it on the remote machine so it trusts the server. Available when remote access is on.
Approval needed for unsafe query Asks you to allow or deny queries that change data or structure before they run. On by default. See Query approval.
Auto-generate Access Token for tableplus-mcp Lets the tableplus-mcp command connect without a token you create yourself. On by default.

Changing the port, remote access, or the auto-generate option restarts the server.

Set up a client

Under Client Setup, pick your client to see the command or configuration to copy:

  • Codex: a JSON configuration for the tableplus MCP server.
  • Claude Code: a claude mcp add tableplus ... command to run in Terminal.
  • Manual: the path to the tableplus-mcp command, for any client that starts a local (stdio) MCP server.
  • HTTP Server: the endpoint (for example http://127.0.0.1:51003/mcp) for clients that connect over Streamable HTTP. These clients send an access token in the Authorization: Bearer <token> header.

tableplus-mcp is a small command inside the TablePlus app bundle (TablePlus.app/Contents/MacOS/tableplus-mcp). It forwards the client's requests to the running server. If TablePlus isn't running, it opens TablePlus in the background first. The MCP server must be enabled.

If you turn off Auto-generate Access Token for tableplus-mcp, the setup snippets include a TABLEPLUS_MCP_ACCESS_TOKEN variable. Replace YOUR_ACCESS_TOKEN with a token you created.

Access tokens

Every client needs an access token. The token decides what the client can do:

Permission What the client can do
Read Only List and open connections, and run read-only queries such as SELECT. Other queries are rejected.
Read & Write Everything in Read Only, plus run any query, including queries that change data or structure.
Full Access All permissions.

Create a token

  1. In Preferences > MCP, click Add below the token list.
  2. Enter a Token Name, for example the name of the client or machine.
  3. Choose the Permissions.
  4. Under Connection Access, choose Allow All to give access to every saved connection, or Limited and check the connections (or connection groups) the token can use.
  5. Click Generate Token.

Copy the token right away. TablePlus shows its value only once.

The Create MCP Token window with Read Only permission and limited access to Acme Store
Create an access token

Manage tokens

The token list shows each token's name, prefix (the first characters of the token), permissions, status, and when it was created and last used.

  • Double-click a token to see its details.
  • Revoke disables a token. Clients that use it are disconnected, but the token stays in the list as Revoked.
  • Delete removes the token from the list. Clients that use it are disconnected.

Tokens are stored in your macOS Keychain. The token that TablePlus generates automatically for tableplus-mcp doesn't appear in the list.

What clients can do

Clients get these tools:

Tool Description
list_connections List the saved connections the token can access.
list_open_connections List the connections that are open in TablePlus.
open_connection Open a saved connection, in a tab or in a new window.
disconnect Close a connection, or one of its databases.
execute_read_query Run a read-only statement or script.
execute_query Run any statement or script. Needs Read & Write or Full Access.

A query can run for up to 300 seconds. Queries run in the connection's workspace, so they appear in its console log.

Clients can also read your saved queries, the query history of each connection, and your metrics boards.

Query approval

When Approval needed for unsafe query is on and a client sends a query that isn't read-only, TablePlus shows an MCP Safe Mode alert with the query. Click Allow to run it or Deny to reject it. If you don't answer within 30 seconds, the request fails.

After you allow it, the connection's safe mode still applies, so you may need to confirm again or enter the database password.

The approval alert appears for connections that have a safe mode level other than Silent Mode. On a connection in Silent Mode, a token with Read & Write permission can run any query without asking. Use Read Only tokens, or limit tokens to the connections they need, to keep a client from changing data.

Activity

Click Activity in Preferences > MCP, or choose MCP Activity in Open Anything, to open the Integrations Activity window.

The Integrations Activity window listing requests from an MCP client
MCP activity log

Use the View control in the toolbar to switch between:

  • Activity: a log of every request, with its status, time, category, token, client address, connection, action, and query. Select a row to see its details. Filter the log with the search field, the time range (Last 24 hours, Last 7 days, Last 30 days, All time), and the token menu. Click Export CSV to save the log, or Clear Activity to delete entries older than 30 or 7 days, or all of them.
  • Client: the clients that are connected now, with their name, version, token, address, and when they connected and were last active. Select clients and click Disconnect to end their sessions and cancel their running requests.

Remote access

To let an MCP client on another machine connect:

  1. Check Allow remote access (TLS). The server now uses HTTPS.
  2. Click Export Certificate… and install tableplus-mcp.pem as a trusted certificate on the remote machine.
  3. Create an access token for the remote client.
  4. Choose HTTP Server under Client Setup to see the endpoint, for example https://your-mac.local:51003/mcp, and use it with the token in the client.

A remote client can reach every connection its token allows. Give remote clients tokens with the lowest permission they need and limit them to specific connections.