Expand description
MCP tool layer: error texts, the shared query runner, the tool catalog and the rmcp server handler.
Modules§
- core
- The four core tools: list_databases, execute_query, explain_query and server_info.
- envelope
- Result envelope shared by the query tools: typed columns, JSON rows and truncation flags.
- logs
- read_server_log: entries from the PostgreSQL server log, or the log files and logging settings.
- mask
- Best-effort masking of secrets in log text: SQL PASSWORD literals, connection-string keys and URL passwords.
- monitor
- Monitoring tools: sessions and locks, statement statistics, cumulative statistics, table usage and replication.
- schema
- Schema introspection: list_schemas, list_objects, describe_table, describe_function, search_schema and get_privileges.
- text
- Every string an MCP client reads: tool titles, descriptions and server instructions. Changing a tool’s behaviour means changing its text here and in README.md.
- timescale
- TimescaleDB tools: hypertables, continuous aggregates and background jobs, read from timescaledb_information and the extension’s functions.
Structs§
- Call
- One tool call’s outcome, with what the audit line needs.
- PgMcp
- The server handler: lists the enabled tools and dispatches calls.
- Runner
- Runs SQL for the tools: user SQL through the gate, internal SQL without it.
- Statement
- One SQL execution: the text, its bind values, whether it is user SQL and its fetch limits.
Enums§
- Tool
Error - Why a tool call failed.
messageis the exact text the client receives. - Toolset
- Tool groups; a tool is listed and callable only when its group is enabled in the config.
Functions§
- check_
sql - Gates SQL on a blocking thread, since a long parse must not stall the runtime; a rejection is a tool error.
- parse_
args - value_
of - Serializes a successful result.