pgmcp
Provides low-level PostgreSQL administration tools, including executing SQL queries (SELECT, INSERT, UPDATE, DELETE, UPSERT), managing extensions, and handling functions.
Provides tools for orchestrating, monitoring, and analyzing web crawling jobs using Scrapy, supporting full job lifecycle including creation, start, monitoring, and log management.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pgmcpsearch my knowledge base for 'authentication'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PGMCP: PostgreSQL Model Context Protocol
Overview
PGMCP connects the pgkeen Postgres Docker image to a mesh-based FastMCP-backed server. It bridges AI Agents with low-level PostgreSQL administration, asynchronous crawling, knowledge base ingestion/curation/search, and more.
Servers
PGMCP Server (server.py)
The main FastMCP server that acts as the hub for all sub-servers listed below. It provides a unified interface interacting with each sub-server and focuses on routing and tool composition. Each of the sub-servers are mounted onto this server.
Knowledge Base Server (server_kb.py)
A concise interface for ingesting, curating, and semantically searching technical documentation and web content across multiple corpora. Features include corpus discovery, ingestion pipelines, document chunking, embedding, and RAG-based retrieval.
Tool Name | Purpose/Description | Arguments |
| Search the knowledge base using RAG (Retrieval-Augmented Generation) with scoping. |
|
| Expand and clarify chunk context for deeper relevance analysis. |
|
| Ingest a completed crawl job into the knowledge base as a new corpus. |
|
| Embed all documents in a corpus to enable semantic search and retrieval. |
|
| List all corpora in the knowledge base. |
|
| Destroy a corpus and all its associated documents and chunks. |
|
| List all documents, or within a specific corpus. |
|
| Destroy a document by ID and all its associated chunks. |
|
Crawl Server (server_crawl.py)
These tools offer a unified interface for AI Agents to orchestrate, monitor, and analyze web crawling jobs with Scrapy and PostgreSQL. They support the full job lifecycle as well as metadata and log management.
Scrapy's configuration is flexible and will eventually be exposable. Currently, sensible defaults are set for local crawling. The crawl toolset streamlines job management and provides detailed insights into job execution and results.
Tool Name | Purpose/Description | Arguments |
| Define a new CrawlJob in an IDLE state. |
|
| Enqueue a CrawlJob by its ID to be run by the Scrapy engine. |
|
| Follow a CrawlJob, reporting process to the client, for a max time. |
|
| Get extra information about a specific CrawlJob by its ID. |
|
| List all CrawlJobs and their metadata. |
|
| Get detailed logs for a specific CrawlJob by its ID. |
|
PSQL Server (server_psql.py)
This server provides a set of tools for low-level PostgreSQL administration, including executing SQL queries, managing extensions, and handling functions. It is designed to be used by AI Agents for advanced database management tasks.
Basic enforcement of SQL query type safety is provided, but it is recommended to use these tools with caution, and never in production environments.
Tool Name | Purpose/Description | Arguments |
| Execute a SQL SELECT query and return rows. |
|
| Execute a SQL DELETE query. |
|
| Execute a SQL INSERT query. |
|
| Execute a SQL UPDATE query. |
|
| Execute a SQL UPSERT (INSERT ... ON CONFLICT UPDATE) query. |
|
| Create a PostgreSQL extension if it does not exist. |
|
| Create or replace a PostgreSQL function. |
|
| Drop a PostgreSQL function by name. |
|
| List all functions in the specified schema. |
|
| Make an HTTP request using the pg_http extension. |
|
Server Setup
Clone the repository:
git clone <repository-url> /your/local/path/to/pgmcpNavigate to the project directory:
cd /your/local/path/to/pgmcpInstall the required dependencies:
uv syncRun the server:
uv run pgmcp run --port 8000 --transport streamable-httpYou should see something like this:
[07/30/25 14:32:54] INFO Starting MCP server 'pgmcp' with transport 'streamable-http' on http://0.0.0.0:8000/mcp/ INFO: Started server process [13951] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
Client Setup
VSCode
Open Command Palette (Cmd+Shift+P or Ctrl+Shift+P).
Select
MCP: Add Server...Choose "HTTP" option.
Enter the server URL (e.g.,
http://localhost:8000/mcp/).Enter a "server id" (e.g.,
pgmcp).Select
Globalfor the scope.Done. (It should appear in the
extensionssidebar.)
Roo / Cline / Claude
{
"mcpServers": {
"pgmcp": {
"url": "http://localhost:7999/mcp/",
"type": "streamable-http",
"headers": {
"Content-Type": "application/json"
}
}
}
}This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/veloper/pgmcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server