Skip to content
LangChain

postgres mcp for LangChain

io.github.pgedge/postgres-mcp

Enterprise PostgreSQL MCP server with NL queries, hybrid search (pgvector+BM25), and web UI

client:LangChain transport:stdio runtime:oci

Install postgres mcp in LangChain

pip install langchain-mcp-adapters

from langchain_mcp_adapters.client import MultiServerMCPClient

client = MultiServerMCPClient({
        "postgres-mcp": {
            "transport": "stdio",
            "command": "docker",
            "args": ["run", "-i", "--rm", "ghcr.io/pgedge/postgres-mcp:latest"],
        }
})

tools = await client.get_tools()

get_tools() returns the server's tools as LangChain tools, ready for an agent. LangChain docs

postgres mcp in other clients