VAT
Your cart

Your cart is empty.

Database MCP setup

With the Database add-on you ask Claude questions about the data in your MySQL, MariaDB or PostgreSQL database. You need the connection details of the database and a user that may read. Your hosting company or developer can give you these.

What you need

  • A MySQL, MariaDB or PostgreSQL database.
  • A database that accepts connections from outside its own server. Your hosting company may need to allow this.
  • A database user, best one that can only read.
  • A seat on MCP Hosted, or MCP Self-hosted, with the Database add-on.

Where to find it

Your database details

You need four details: the type (MySQL or MariaDB, or PostgreSQL), the server name or IP address, the database name and, if it is not the standard one, the port. You find them in the control panel of your hosting company, for example under Databases. Or ask your developer.

A read-only user

Ask your hosting company or developer for a database user that can only read, with a password. AddoCore also blocks changes on its own, but a read-only user is the safest. Only use a user that can change data when a seat may make changes.

Paste it in AddoCore

  1. In My Account, open MCP Hosted and pick your seat. On MCP Self-hosted, open your license.
  2. Go to Tools and choose Set up on the Database card.
  3. Choose Save login details, then Test connection. A green result means it works.

Your host needs SSL? Turn on Use a secure connection (SSL) under Advanced. We store your login details encrypted.

About the Database add-on · Connect Claude to Database: how it works · All setup guides

Running it yourself

Only for MCP Self-hosted when you set things in the .env file instead of in My Account. With the steps above you do not need this.

Show the technical setup

A Database MCP setup connects mcp-core to one MySQL, MariaDB-compatible or PostgreSQL database, so Claude can list tables, describe columns and run SQL. You need the Database entitlement, a database user and five required env vars. Read-only is the default, and the safest setup uses a user that only has SELECT.

What do you need before a Database MCP setup?

You need a running mcp-core installation, the Database add-on on the same license and a database that the container can reach over the network. No mcp-core yet? Follow the mcp-core install guide first.

  • An active license with the tool:database entitlement, from the Database MCP server add-on.
  • Host, port, database name, user and password.
  • A seat in My Account → MCP Self-hosted with the Database tool ticked.

Inside the container, localhost is the container itself, not your server. Use a hostname or IP address that the container can reach. Bought the add-on later? Nothing to reinstall: the add-on joins your license, and an email lists the env vars to fill in.

How do you create a read-only user for the Database MCP setup?

Create a dedicated user with only SELECT, on only the tables Claude should see. The tool has its own guardrails, but the database grants are the real enforcement layer. MySQL or MariaDB:

CREATE USER 'claude_ro'@'%' IDENTIFIED BY 'a-long-random-password';
GRANT SELECT ON shopdb.* TO 'claude_ro'@'%';

PostgreSQL:

CREATE ROLE claude_ro LOGIN PASSWORD 'a-long-random-password';
GRANT CONNECT ON DATABASE shopdb TO claude_ro;
GRANT USAGE ON SCHEMA public TO claude_ro;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO claude_ro;

Narrow '%' to the address of your mcp-core server where you can. For write access later, grant INSERT, UPDATE and DELETE on specific tables to a separate user.

Which env vars does the Database MCP setup use?

There are five required variables and five optional ones. Your downloaded .env contains the required lines empty and the optional ones commented out.

VariableRequiredDefaultPurpose
DB_TYPEYesnonemysql (MySQL, MariaDB-compatible) or postgres
DB_HOSTYesnoneHostname or IP reachable from the container
DB_NAMEYesnoneDatabase name
DB_USERYesnoneDatabase user
DB_PASSWORDYesnonePassword for that user
DB_PORTNo3306 (mysql), 5432 (postgres)Port
DB_SSLNofalsetrue turns on TLS for the connection. PostgreSQL encrypts without checking the server certificate. MySQL checks it against the CAs Node.js trusts; there is no setting for your own CA.
DB_MODENoread-onlyFallback mode; the seat’s mode takes precedence
DB_QUERY_TIMEOUT_MSNo10000Maximum run time of one query, in milliseconds
DB_MAX_ROWSNo200Maximum rows returned to Claude per query

Example for a MariaDB database:

DB_TYPE=mysql
DB_HOST=db.internal.example.com
DB_NAME=shopdb
DB_USER=claude_ro
DB_PASSWORD=a-long-random-password

You can also keep these values in My Account → MCP Self-hosted → Tools. They are stored encrypted, a running mcp-core picks them up without a new download, and they override .env.

Which tools does Claude see after the Database MCP setup?

Claude gets three tools, in both modes. Unlike the other add-ons, the write check happens per query, because one SQL tool can read or write.

  • database_list_tables: the tables visible to the user. On MySQL and MariaDB this list includes views; on PostgreSQL it shows base tables only, from every schema except the system schemas.
  • database_describe_table: column name, data type, nullability and default
  • database_query: one SQL statement per call, results capped at DB_MAX_ROWS

How do read-only and read-write differ in a Database MCP setup?

In read-only mode, database_query rejects INSERT, UPDATE and DELETE before they reach the database. Read-write lets those through. Schema changes (CREATE, DROP, ALTER, TRUNCATE, GRANT, REVOKE) are blocked in every mode, and so are multiple statements in one call.

You set the mode per seat when you add it in My Account → MCP Self-hosted → Seats; DB_MODE is the fallback. The keyword check is a safety net, not a guarantee: a SELECT-only database user is what really stops writes. See entitlements vs. tool modes for the difference between buying a tool and its mode.

How do you restart and test the Database MCP setup?

Run the update script from the folder you unzipped:

./mcp-update.sh

Just bought the add-on? Force the license check:

docker exec mcp-core npm run refresh-license

In Claude, run mcp_status first: it shows the license state, the seat and each tool’s mode. Then ask “list the tables in the database”. If you use several clients, check which token belongs to which seat in MCP seats.

Which errors come up during a Database MCP setup?

The messages below come from the tool, so you can search for them directly.

  • No database tools at all: the log says “DB_TYPE/DB_HOST/DB_NAME/DB_USER are not fully set”. Fill them in and run ./mcp-update.sh.
  • “Unsupported DB_TYPE”: use exactly mysql or postgres.
  • “This looks like a write statement (INSERT/UPDATE/DELETE) but this seat is read-only”: expected in read-only mode.
  • “Schema-changing statements … are never allowed through this tool”: run schema changes directly against the database.
  • “Multiple statements in one call are not allowed”: send one statement per query.
  • “No such table (or it has no columns visible to this database user)”: a typo, or the user lacks rights on that table.
  • “…showing first 200 of N rows”: narrow the query with WHERE or LIMIT, or raise DB_MAX_ROWS.

A Database MCP setup is finished when database_list_tables returns your tables. The other add-ons are in the MCP setup guides.

Ready to connect your AI to real tools?

Start free trial