MCP Protocol
The Model Context Protocol (MCP) enables DB-GPT agents to connect with external tools and services through a standardized interface.
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:
- Go to Apps â create or edit an app
- In the agent configuration, select available MCP tools
- 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â
| Type | Description | Example |
|---|---|---|
| stdio | Local process communication | File system access, code execution |
| SSE | Server-Sent Events over HTTP | Remote APIs, cloud services |
Common MCP serversâ
| Server | Purpose | Package |
|---|---|---|
| Filesystem | Read/write local files | @modelcontextprotocol/server-filesystem |
| Brave Search | Web search | @modelcontextprotocol/server-brave-search |
| GitHub | Repository operations | @modelcontextprotocol/server-github |
| PostgreSQL | Database queries | @modelcontextprotocol/server-postgres |
| Slack | Send/read Slack messages | @modelcontextprotocol/server-slack |
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â
| Topic | Link |
|---|---|
| Agent concepts | Agents |
| Agent development with tools | Tools Development |
| dbgpts community tools | dbgpts |