PRODUCTS

KEYWORDS

Dolt MCP Server Now Supports Doltgres

Last year, we launched the Dolt MCP server in order to enable AI agents to more easily interact with Dolt databases. We’ve since used it to power the agent mode experience in Dolt Workbench. Today, we’re announcing that we’ve extended the MCP server to support Doltgres databases. This article will discuss how to use it.

Usage#

If you’ve used the Dolt MCP server before, you’ll find that usage is largely the same for Doltgres. To get started, you’ll need a running Doltgres server, the Dolt MCP server, and an MCP client. Start by spinning up a Doltgres server:

doltgres
INFO[0000] Server ready. Accepting connections.
WARN[0000] secure_file_priv is set to "", which is insecure.
WARN[0000] Any user with GRANT FILE privileges will be able to read any file which the sql-server process can read.
WARN[0000] Please consider restarting the server with secure_file_priv set to a safe (or non-existent) directory.

Then, connect to the server with the psql client and seed some data:

psql -U postgres
Password for user postgres:
psql (17.5 (Homebrew), server 15.17)
Type "help" for help.

postgres=> CREATE TABLE t1 (pk int primary key);
CREATE TABLE
postgres=> INSERT INTO t1 VALUES (1), (2), (3);
INSERT 0 3
postgres=> SELECT DOLT_COMMIT('-Am', 'Add t1 and some values');
            dolt_commit
------------------------------------
 {7spcum5cj8mli7dmgd668knkaear65k2}
(1 row)

Now, start up the MCP server:

docker run -d \
    --name dolt-mcp-server \
    -p 8080:8080 \
    -e MCP_MODE=http \
    -e MCP_DIALECT=doltgres \
    -e DOLT_HOST=host.docker.internal \
    -e DOLT_PORT=5432 \
    -e DOLT_USER=postgres \
    -e DOLT_DATABASE=postgres \
    -e DOLT_PASSWORD=password \
    dolthub/dolt-mcp:latest

By default, the MCP server assumes you are connecting to a Dolt database. You can change that by passing the MCP_DIALECT environment variable with value doltgres. This is the only difference in usage between Dolt and Doltgres. Alternatively, if you’re running the MCP server binary directly, you can use the --doltgres flag:

./dolt-mcp-server \
  --stdio \
  --doltgres \
  --host 0.0.0.0 \
  --port 5432 \
  --user postgres \
  --database mydb

Now that we have a Doltgres server running with the Dolt MCP server pointed at it, let’s connect an MCP client. For this example, I’ll use Claude Code:

claude mcp add -t http dolt-mcp http://localhost:8080/mcp

Then, in my Claude Code session, I can start having the agent interact with my database:

 can you use the dolt mcp server to tell me what tables are in my database?                                                                                                                               

  Called dolt-mcp (ctrl+o to expand)

 You have four databases: hello, test, postgres, and information_schema. Which one did you mean? (And which branch typically main?)

 use the postgres database                                                                                                                                                                                

  Called dolt-mcp (ctrl+o to expand)  

 The postgres database has one table on main: t1.
                                                                                  
 now create a new branch and add some data to it                                                                                                                                                          
                                                                                                                                                                                                           
 I'll check the schema of t1 and create a new branch in parallel.                                                                                                                                         
                                                                                                                                                                                                           
  Called dolt-mcp 6 times (ctrl+o to expand)                                                                                                                                                               
                                                                                                                                                                                                           
⏺ Done. Created branch add-data from main and inserted 5 new rows (pks 4–8) into t1. The branch now has 8 rows total; main is unchanged at 3. The rows are in the working set — let me know if you want me 
  to stage and commit them.

Conclusion#

For more information about the Dolt MCP server, including the full list of configuration options and the toolset, check out the GitHub repository. We’re currently working on supporting Doltgres agent mode in Dolt Workbench, which will leverage the work we’ve done here supporting Doltgres in the MCP server, so keep an eye out for a future announcement. If you have any questions about Doltgres or the MCP server, come by our Discord and let us know.