Ollama Database Assistant MCP Server

Enables natural language querying of PostgreSQL databases using Ollama's LLM and the Model Context Protocol.

Local serverstdioTypeScript 62

What is the Ollama Database Assistant MCP server?

Enables natural language querying of PostgreSQL databases using Ollama's LLM and the Model Context Protocol. The ollama database assistant mcp server wraps that behind the Model Context Protocol, so an assistant can use it rather than through you.

What it actually does

An interactive chat interface that combines Ollama's LLM capabilities with PostgreSQL database access through the Model Context Protocol (MCP). Ask questions about your data in natural language and get AI-powered responses backed by real SQL queries.

  • Natural language interface to your PostgreSQL database
  • Automatic SQL query generation
  • Schema-aware responses
  • Interactive chat interface
  • Secure, read-only database access

Configuration

You will need one environment variable: DATABASE_URL. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • Node.js 16 or higher - A running PostgreSQL database - Ollama installed and running locally - The qwen2.5-coder:7b-instruct model pulled in Ollama

Adding it to your client

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

When to reach for it

Plenty of database access servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. It is maintained by robdodson; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the ollama database assistant mcp server does with a few real requests.

Configuration

  • Node.js 16 or higher - A running PostgreSQL database - Ollama installed and running locally - The qwen2.5-coder:7b-instruct model pulled in Ollama
VariableDescriptionRequired
DATABASE_URLEndpoint or connection string the server talks to.Yes

Frequently asked questions

You need Node.js 16 or higher, a running PostgreSQL database, Ollama installed and running locally, and the qwen2.5-coder:7b-instruct model pulled in Ollama.