Langgraph-MCP Client for Postgresql Example
@BrianCusack
Langgraph-MCP Client for Postgresql Example について
LangGraph implementation interacting with a PostgreSQL MCP Server
基本情報
設定
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"LangGraph-MCP-Client": {
"command": "uv",
"args": [
"sync"
]
}
}
}ツール
ツールは検出されませんでした
ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。
概要
What is Langgraph-MCP Client for Postgresql Example?
This repository demonstrates a low-level example of how to interact with an MCP server as a Docker image, connected to a PostgreSQL database for LangGraph agents. It is intended for developers who want to integrate PostgreSQL data sources with LangGraph using the Model Context Protocol (MCP).
How to use Langgraph-MCP Client for Postgresql Example?
Clone the repository, create a .env file with database credentials (DB_HOST, DB_PORT, DB_USER, DB_PASSWORD, DB_NAME), install the UV package globally, and build the MCP Postgres Docker image. Then run uv sync followed by uv run queryagent to start the query agent, optionally passing a natural language query as an argument (e.g., uv run queryagent "Who holds the most funds in their account?").
Key features of Langgraph-MCP Client for Postgresql Example
- Connects to a PostgreSQL database via an MCP server.
- Uses
langchain_mcp_adapters.tools.load_mcp_toolsto create MCP tools. - Employs LangGraph's
create_react_agentfor fast agent templating. - Outputs the agent’s stream to a file.
- Accepts user queries via command line.
Use cases of Langgraph-MCP Client for Postgresql Example
- Querying a banking database using natural language questions.
- Learning how to integrate a PostgreSQL MCP server with LangGraph agents.
- Prototyping a LangGraph agent that uses database tools over MCP.
FAQ from Langgraph-MCP Client for Postgresql Example
What are the prerequisites for running this project?
You need Docker, a running PostgreSQL database, and the MCP Servers repository (to build the Postgres MCP image). The UV package manager must also be installed globally.
How do I set up the database connection?
Create a .env file in the repository root with the variables DB_HOST, DB_PORT, DB_USER, DB_PASSWORD, and DB_NAME, replacing placeholders with your actual credentials.
What should I do if I encounter UV package errors?
Ensure the UV CLI is installed globally and that the uv sync command completes without errors.
How do I build the PostgreSQL MCP Server Docker image?
Clone the MCP Servers repository, navigate to its directory, and run docker build -t mcp/postgres -f src/postgres/Dockerfile .
How can I run the query agent with a specific question?
Run uv run queryagent "your question" from the project directory, replacing "your question" with the desired natural language query.
「推論」の他のコンテンツ
Agentic MCP Client
peakmojoA standalone agent runner that executes tasks using MCP (Model Context Protocol) tools via Anthropic Claude, AWS BedRock and OpenAI APIs. It enables AI agents to run autonomously in cloud environments and interact with various systems securely.
Sandbox Mcp
pottekkatA Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.
MCP Servers
junfanz1This project demonstrates a decoupled real-time agent architecture that connects LangGraph agents to remote tools served by custom MCP (Modular Command Protocol) servers. The architecture enables a flexible and scalable multi-agent system where each tool can be hosted independent
Deno Sandbox MCP Server
bewt85An MCP server that allows you to run TypeScript, JavaScript, and Python code in a sandbox on your local machine using the Deno® sandbox. This server provides a controlled environment for executing code with explicit permission controls.
Node Code Sandbox MCP 🛠️
mozicim# 🐢🚀 Node.js Sandbox MCP ServerThis repository hosts a Node.js server that implements the Model Context Protocol (MCP) for running JavaScript in isolated Docker containers. It allows for on-the-fly npm dependency installation, making it easy to execute code safely and efficient
コメント