The Postgres MCP Agent is a Model Context Protocol (MCP) server designed to interact with PostgreSQL databases. It allows querying and managing database resources using the MCP framework.
- Node.js (v16 or later)
- PostgreSQL
To install the Postgres MCP Agent via npm, run:
npm install -g postgres-mcp-agent
To build the Postgres MCP Agent from source, first clone the repository:
git clone https://github.com/your-repo/postgres-mcp-agent.git
cd postgres-mcp-agent
Install the required dependencies:
npm install
Build the project using TypeScript:
npm run build
This will compile the TypeScript files into JavaScript and generate the dist
folder containing the compiled files.
To start the MCP server, use the following command:
node dist/index.js postgres://<username>:<password>@<host>:<port>/<database>
Replace <username>
, <password>
, <host>
, <port>
, and <database>
with your PostgreSQL credentials.
To integrate the Postgres MCP Agent into an MCP client, add the following configuration to your MCP client settings:
{
"postgres-local": {
"command": "node",
"args": [
"/path/to/postgres-mcp-agent/dist/index.js",
"postgres://<username>:<password>@<host>:<port>/<database>"
]
}
}
Replace /path/to/postgres-mcp-agent/dist/index.js
with the path to the built MCP agent and <username>
, <password>
, <host>
, <port>
, and <database>
with your PostgreSQL credentials.
Contributions are welcome! Please submit a pull request or open an issue for any bugs or feature requests.
This project is licensed under the MIT License.