samsiva-dev/pg_mcp_server — explained in plain English
Analysis updated 2026-05-18
Ask natural language questions about PostgreSQL internals from Zed or VSCode.
Look up exact function callers and definitions in the PostgreSQL source with search_symbol.
Run semantic search over PostgreSQL's C source without sending code to any API.
Study a specific PostgreSQL subsystem like the buffer manager or WAL using scoped queries.
| samsiva-dev/pg_mcp_server | 0xallam/my-recipe | 0xhassaan/nn-from-scratch | |
|---|---|---|---|
| Stars | 0 | — | 0 |
| Language | Python | Python | Python |
| Last pushed | — | 2022-11-22 | — |
| Maintenance | — | Dormant | — |
| Setup difficulty | hard | moderate | moderate |
| Complexity | 4/5 | 2/5 | 4/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Needs local Postgres 18 with pgvector, Ollama models, and a full PostgreSQL source checkout indexed with ctags and cscope.
This project is a local, offline assistant for exploring PostgreSQL's internal C source code by asking plain language questions instead of digging through the codebase by hand. It runs entirely on your own machine, with no API costs and no internet connection needed once set up, and connects to code editors like Zed and VSCode through the Model Context Protocol, or MCP. Under the hood it combines a few pieces: ctags and cscope provide exact symbol lookups such as who calls a function or where something is defined, while a vector database extension called pgvector, running inside a local Postgres 18 database, holds semantic search embeddings for tens of thousands of chunks of the PostgreSQL source code. A local embedding model turns questions and code into those vectors, and a small local language model, run through Ollama, uses the matched source snippets to write an answer grounded in the real code rather than guessing. Three tools are exposed to your editor's AI agent panel: one that performs a full retrieval and answer cycle, one that just returns the raw matching source code chunks, and one that does exact symbol lookups using cscope. Setting it up involves installing Ollama and pulling two local models, installing the pgvector extension, creating a database and loading its schema, building the ctags and cscope index over a local copy of the PostgreSQL source, indexing everything into the database with a provided script, and finally pointing your editor's MCP configuration at the server script. The author notes the local seven billion parameter model is good for explaining how code works but not for deep architecture decisions, where a larger hosted model would do better, and that the indexer needs to be rerun after upgrading to a newer PostgreSQL source version. The project is released under the MIT license.
A local, offline MCP server that lets you ask plain language questions about PostgreSQL's C source code, answered by a local LLM.
Mainly Python. The stack also includes Python, PostgreSQL, pgvector.
Use freely for any purpose, including commercial use, as long as you keep the copyright notice (MIT License).
Setup difficulty is rated hard.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.