MCP#
gptme acts as a MCP client supporting MCP servers (Model Context Protocol), allowing integration with external tools and services through a standardized protocol.
We also intend to expose tools in gptme as MCP servers, allowing you to use gptme tools in other MCP clients.
Configuration#
You can configure MCP in your Global config (~/.config/gptme/config.toml
) file:
[mcp]
enabled = true
auto_start = true
[[mcp.servers]]
name = "my-server"
enabled = true
command = "server-command"
args = ["--arg1", "--arg2"]
env = { API_KEY = "your-key" }
We also intend to support specifying it in the Project config, and the ability to set it per-conversation.
Configuration Options#
enabled
: Enable/disable MCP support globallyauto_start
: Automatically start MCP servers when neededservers
: List of MCP server configurationsname
: Unique identifier for the serverenabled
: Enable/disable individual servercommand
: Command to start the serverargs
: List of command-line argumentsenv
: Environment variables for the server
MCP Server Examples#
SQLite Server#
The SQLite server provides database interaction and business intelligence capabilities through SQLite. It enables running SQL queries, analyzing business data, and automatically generating business insight memos:
[[mcp.servers]]
name = "sqlite"
enabled = true
command = "uvx"
args = [
"mcp-server-sqlite",
"--db-path",
"/path/to/sqlitemcp-store.sqlite"
]
The server provides these core tools:
- Query Tools:
read_query
: Execute SELECT queries to read datawrite_query
: Execute INSERT, UPDATE, or DELETE queriescreate_table
: Create new tables in the database
- Schema Tools:
list_tables
: Get a list of all tablesdescribe_table
: View schema information for a specific table
- Analysis Tools:
append_insight
: Add business insights to the memo resource
- Resources:
memo://insights
: A continuously updated business insights memo
The server also includes a demonstration prompt mcp-demo
that guides users through database operations and analysis.
Running MCP Servers#
Each server provides its own set of tools that become available to the assistant.
MCP servers can be run in several ways:
Using package managers like
npx
,uvx
, orpipx
for convenient installation and executionRunning from source or pre-built binaries
Using Docker containers
Warning
Be cautious when using MCP servers from unknown sources, as they run with the same privileges as your user.
You can find a list of available MCP servers in the example servers and MCP directories like MCP.so.