MCP Server

Tacnode is a distributed database compatible with the PostgreSQL protocol, offering data query and metadata retrieval services through mainstream ModelContextProtocol (MCP) Servers. This document uses the official MCP server-postgres and the open-source multi-database MCP gateway Bytebase DBHub as examples to demonstrate how to connect an MCP Server to a Tacnode database and validate functionality with the MCP Server debugging tool, MCP Inspector.

MCP Servers typically operate alongside MCP Clients, large language models, and agents to form a service invocation chain. Within this chain, the MCP Server in Tacnode focuses on two core capabilities: data queries and schema exploration. In the diagram below, the PG MCP Server could refer to server-postgres, Bytebase DBHub, or any MCP Server supporting the PostgreSQL protocol. An MCP Client might be MCP Inspector or any client compatible with the MCP protocol. Supported large language models include ChatGPT, DeepSeek, Gemini, and others. This document focuses solely on the interaction between MCP Clients and MCP Servers, without covering large language model integration.

MCP Inspector

MCP Inspector is a visual MCP Server testing tool in the Model Context Protocol (MCP) ecosystem. Designed for heterogeneous AI environments such as LLM (large language models) and browser plugins, it provides a standardized data structure and protocol to enable plug-and-play LLM contexts and cross-platform traceability.

Core Features:

  • Cross-platform reporting and visualization: Prompt, result, environment, reference chain history collection and display for greater transparency and traceability in prompt engineering, context data, and plugin calls
  • Multi-platform support: Browser, IoT, and server-side AI context tracing
  • Standardized protocol: Context data structure for easy integration, extension, and testing

Starting MCP Inspector

The easiest way to start MCP Inspector is with the npx command:

npx http://127.0.0.1:6274

This will launch the following interface:

MCP Official server-postgres

MCP Official server-postgres is a PostgreSQL backend data service implementation within the Model Context Protocol (MCP) ecosystem. It implements the MCP protocol, providing standardized APIs for clients to interact with model-related data in the database system. Project repository: modelcontextprotocol/servers.

Key Features:

  • Read-only database query
  • Table metadata retrieval
  • Stdio transport protocol

Launching MCP server-postgres

You can launch MCP Server directly with MCP Inspector via npx.

Parameters:

  • Transport protocol: STDIO
  • Command: npx
  • Parameter: "postgres://mcp_user:mcp_password" to access server-postgres through Inspector

Inspector issues the resources/list command to enumerate and return metadata for all tables. The resources/read command retrieves detailed metadata of a selected table.

Inspector issues the tool/list command to return definitions of query interfaces. Through these interfaces, clients can perform specific SQL queries on the database.

Using DBHub as MCP Server

DBHub is a gateway product supporting multiple databases and implementing the MCP Server interface. It allows MCP Clients to connect to various databases, such as PostgreSQL, MySQL, SQL Server, and more.

Compared to the official server-postgres, DBHub offers more capabilities, including SSE transport protocol support and extended resource templates, such as viewing table schemas, index structures, and stored procedures.

Launching DBHub

A straightforward way to start MCP Inspector is with an npx command:

npx  --transport sse  --dsn "postgres://mcp_user:mcp_password" http://localhost:8080/sse

Connecting Inspector to DBHub

Configure Inspector as follows to connect to the running DBHub service (parameters):

After clicking "Connect," "Connected" status should display.

Accessing DBHub via Inspector

Inspector uses the resources/template/list command; DBHub supports a wider range of resource templates.

Inspector uses the tool/list command to obtain the definition of the execute_sql interface. With execute_sql, clients can issue custom SQL queries to the database.

On this page