pg-multi-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DATABASE_URI | No | Compatibility variable: becomes a read-only session connection named default. | |
| PG_MULTI_MCP_CONFIG | No | Path to the connections file (same as --config). Defaults to ~/.pg-multi-mcp/connections.json if unset. | ~/.pg-multi-mcp/connections.json |
| PG_MULTI_MCP_DEFAULT | No | Default connection for the session; takes precedence over the connections file's default. | |
| PG_MULTI_MCP_CONN_<NAME> | No | Declares a session connection named <name> (lower-cased). The value is either a PostgreSQL URL/DSN or a JSON object with the same fields as a connection in the config file. | |
| PG_MULTI_MCP_INCLUDE_DTA_TRACE | No | Set to true to include the index advisor's internal trace in its output. | false |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_connectionsA | Lista as conexões configuradas (nome, aliases, tags, descrição, destino sem senha, modo de acesso, status do pool, conexão ativa/padrão). Use 'search' para filtrar por nome, alias, tag ou descrição. |
| reload_connectionsA | Relê o arquivo de conexões agora e informa o que mudou (added/changed/removed/unchanged). Pools de conexões inalteradas continuam abertos; os de alteradas/removidas são fechados. Normalmente não é necessário: o arquivo é recarregado sozinho quando muda. |
| use_connectionA | Define a conexão ativa da sessão (usada quando 'connection' é omitido) e valida que ela abre. |
| open_connectionB | Abre (ou reaproveita) o pool da conexão e testa: retorna banco, usuário, versão e latência. |
| close_connectionA | Fecha o pool de uma conexão (libera as conexões no servidor). Use close_all=true para fechar todas. A configuração não é removida; a conexão reabre automaticamente no próximo uso. |
| add_connectionA | Adiciona uma conexão nomeada. A 'url' aceita URI (postgresql://... ou mongodb://, mongodb+srv://) ou DSN PostgreSQL (host=... dbname=...) e placeholders ${VAR} resolvidos de variáveis de ambiente — prefira-os a senhas literais. O 'engine' é inferido da URL quando omitido. Por padrão testa a conexão antes de salvar e grava no arquivo de configuração (persist=true). |
| remove_connectionA | Remove uma conexão do registro (fecha o pool e, se veio do arquivo, apaga do arquivo de configuração). Conexões definidas por variável de ambiente (.mcp.json) só saem desta sessão. |
| list_schemasA | List all schemas in the database (MongoDB: lists the databases) |
| list_objectsC | List objects in a schema (MongoDB: collections or views in a database) |
| get_object_detailsA | Show detailed information about a database object. MongoDB: collection type, estimated count, indexes and the fields/types inferred from a sample of documents (values are never returned). |
| explain_queryC | Explains the execution plan for a SQL query, showing how the database will execute it and provides detailed cost estimates. |
| analyze_workload_indexesB | Analyze frequently executed queries in the database and recommend optimal indexes |
| analyze_query_indexesB | Analyze a list of (up to 10) SQL queries and recommend optimal indexes |
| analyze_db_healthA | Analyzes database health. Here are the available health checks:
|
| get_top_queriesA | Reports the slowest or most resource-intensive queries using data from the 'pg_stat_statements' extension. |
| execute_sqlA | Execute SQL on the chosen connection. Connections in 'restricted' mode only accept read-only SQL (validated, READ ONLY transaction, timeout); 'unrestricted' connections accept any SQL (DML/DDL). |
| execute_mongoA | Run a MongoDB operation on the chosen connection. 'restricted' connections only accept reads (find, aggregate without $out/$merge, count, distinct, read-only commands; no server-side JavaScript; timeout); 'unrestricted' connections also accept insert/update/replace/delete. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 17 tools
Most tools target clearly distinct operations: connection lifecycle, schema/object introspection, query execution, health analysis, and index recommendations. A few boundaries are slightly subtle, especially use_connection vs. open_connection and the three query/index analysis tools, but descriptions provide enough distinction.
All tool names use consistent snake_case with predictable verb_noun phrasing, such as list_connections, add_connection, execute_sql, and analyze_db_health. The pattern is stable across SQL, MongoDB, connection, and analysis tools.
Seventeen tools is slightly heavy but reasonable for a multi-database server covering connection management, introspection, query execution, health checks, and index analysis. Each tool appears to serve a meaningful role rather than duplicating another.
The surface covers the core lifecycle: add/remove/open/close/use/reload connections, list schemas and objects, inspect details, execute SQL and MongoDB operations, explain queries, analyze health, and recommend indexes. Minor gaps exist, such as no dedicated MongoDB explain or broader transaction/administration tooling, but agents can work around them.