A Model Context Protocol (MCP) server written in Go that provides document storage and vector similarity search backed by PostgreSQL with [pgvector]. It exposes six tools over SSE transport for storing, querying, listing, updating, and deleting documents with 384-dimensional embeddings.
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"go-mcp-postgres-server": {
"command": "<see-readme>",
"args": []
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A Model Context Protocol (MCP) server written in Go that provides document storage and vector similarity search backed by PostgreSQL with [pgvector]. It exposes six tools over SSE transport for storing, querying, listing, updating, and deleting documents with 384-dimensional embeddings.
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
This server is missing a description. Tools and install config are also missing.If you've used it, help the community.
Add informationBe the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in data / ai-ml
Dynamic problem-solving through sequential thought chains
Query and manage PostgreSQL databases directly from AI assistants
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Manage Supabase projects — databases, auth, storage, and edge functions
MCP Security Weekly
Get CVE alerts and security updates for Go Mcp Postgres Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A Model Context Protocol (MCP) server written in Go that provides document storage and vector similarity search backed by PostgreSQL with pgvector. It exposes six tools over SSE transport for storing, querying, listing, updating, and deleting documents with 384-dimensional embeddings.
log/slog| Tool | Description |
|---|---|
store_data | Store a record with key, content, metadata, and a 384-dim embedding |
query_similar | Find records similar to a given embedding vector, with optional namespace and metadata filtering |
get_data | Retrieve a document by UUID (includes full embedding) |
list_data | List records with pagination and optional namespace/metadata filtering |
update_data | Partially update an existing record by UUID |
delete_data | Delete a document by UUID |
Configuration is loaded with the following priority (highest to lowest):
.env file in the working directory (only fills in vars not already set)| Variable | Default | Description |
|---|---|---|
MCP_DB_HOST | 192.168.0.65 | PostgreSQL host |
MCP_DB_PORT | 5432 | PostgreSQL port |
MCP_DB_USER | $USER | Database user |
MCP_DB_PASSWORD | (empty) | Database password |
MCP_DB_NAME | mcp_db | Database name |
MCP_LISTEN_ADDR | 0.0.0.0:5353 | SSE server listen address |
Make sure PostgreSQL is running and the pgvector extension is available. Create the database:
CREATE DATABASE mcp_db;
Option A: Use a .env file (recommended for local development and Docker)
cp .env.example .env
# Edit .env with your values
Option B: Export environment variables directly
Linux / macOS:
export MCP_DB_HOST=localhost
export MCP_DB_USER=postgres
export MCP_DB_PASSWORD=yourpassword
export MCP_DB_NAME=mcp_db
Windows (PowerShell):
$env:MCP_DB_HOST = "localhost"
$env:MCP_DB_USER = "postgres"
$env:MCP_DB_PASSWORD = "yourpassword"
$env:MCP_DB_NAME = "mcp_db"
Environment variables always override .env file values, so you can use both — set defaults in .env and override specific values per environment.
Print the DDL without connecting to the database:
go run main.go --init-schema
This outputs the SQL that creates the documents table, the HNSW vector index, a namespace B-tree index, and a GIN index for metadata queries.
go run main.go
The server will:
0.0.0.0:5353Point your MCP client at the SSE endpoint. For example, in a Kiro or other MCP-compatible client config:
{
"mcpServers": {
"go-postgres": {
"url": "http://localhost:5353/sse"
}
}
}
CREATE TABLE documents (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
namespace TEXT NOT NULL DEFAULT 'default',
key TEXT NOT NULL
... [View full README on GitHub](https://github.com/gcclinux/go-mcp-postgres-server#readme)