Skip to main content
Version: dev

MCP Protocol

The Model Context Protocol (MCP) enables DB-GPT agents to connect with external tools and services through a standardized interface.

What is MCP?

MCP is an open protocol that provides a standard way for AI applications to connect with external data sources and tools. DB-GPT supports MCP as both a client (consuming MCP tools) and a server (exposing DB-GPT capabilities as MCP tools).

Architecture​

Using MCP tools in agents​

Step 1 — Configure MCP servers​

MCP servers are configured in your TOML config file or through the Web UI's agent configuration.

Example TOML configuration:

[[agent.mcp_servers]]
name = "filesystem"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/directory"]

[[agent.mcp_servers]]
name = "web-search"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-brave-search"]
env = { BRAVE_API_KEY = "${env:BRAVE_API_KEY}" }

Step 2 — Assign tools to agents​

In the Web UI:

  1. Go to Apps → create or edit an app
  2. In the agent configuration, select available MCP tools
  3. The agent can now use these tools during conversations

Step 3 — Use in chat​

When chatting with an MCP-enabled agent, the agent automatically selects and invokes the appropriate tools based on your request.

Supported MCP server types​

TypeDescriptionExample
stdioLocal process communicationFile system access, code execution
SSEServer-Sent Events over HTTPRemote APIs, cloud services

Common MCP servers​

ServerPurposePackage
FilesystemRead/write local files@modelcontextprotocol/server-filesystem
Brave SearchWeb search@modelcontextprotocol/server-brave-search
GitHubRepository operations@modelcontextprotocol/server-github
PostgreSQLDatabase queries@modelcontextprotocol/server-postgres
SlackSend/read Slack messages@modelcontextprotocol/server-slack
Finding MCP servers

Browse the growing ecosystem of MCP servers at the MCP Servers Directory.

DB-GPT as an MCP server​

DB-GPT can also expose its capabilities as an MCP server, allowing other MCP-compatible applications to use DB-GPT features like:

  • Knowledge base queries
  • Database access (Text2SQL)
  • Agent execution

Next steps​

TopicLink
Agent conceptsAgents
Agent development with toolsTools Development
dbgpts community toolsdbgpts