sw-postgres-mcp for LangChain
io.github.jpka/sw-postgres-mcp
Safe-write Postgres MCP server with preview-before-execute writes and rollback safety.
client:LangChain
transport:stdio
runtime:npm
Install sw-postgres-mcp in LangChain
pip install langchain-mcp-adapters
from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient({
"sw-postgres-mcp": {
"transport": "stdio",
"command": "npx",
"args": ["-y", "sw-postgres-mcp"],
}
})
tools = await client.get_tools()
get_tools() returns the server's tools as LangChain tools, ready for an agent. LangChain docs