Where the data lives¶
backlog-mcp keeps all data in one SQLite file. It reads its defaults from TOML config files, from the environment and from the command line.
The database¶
One SQLite file holds every project, task, comment and note of every computer:
$XDG_DATA_HOME/backlog-mcp/backlog.sqlite3
If XDG_DATA_HOME is unset, empty or a relative path, the base directory is
~/.local/share. The default file is then ~/.local/share/backlog-mcp/backlog.sqlite3.
To use another file, give the global option --database (short form -d) or set
BACKLOG_MCP_DATABASE:
backlog --database ~/work/backlog.sqlite3 task list
BACKLOG_MCP_DATABASE=~/work/backlog.sqlite3 backlog mcp
The database key in a config file has the same effect. Give --database before the
command name, because it is a global option.
Config files¶
The backlog and backlog-mcp commands read these TOML files, in this order:
/etc/backlog-mcp/config.toml$XDG_CONFIG_HOME/backlog-mcp/config.toml, or~/.config/backlog-mcp/config.tomlifXDG_CONFIG_HOMEis unset, empty or a relative path../.backlog-mcp.tomlin the working directory.The file that
--config FILEnames.
A missing file is skipped. A later file overrides the keys of an earlier file. The other keys
of the earlier file stay in effect, so --config adds a file and does not replace the list.
--config is accepted before the command name and after mcp. Thus
backlog-mcp --config FILE works as well as backlog --config FILE mcp.
The global options are top-level keys. The options of backlog mcp form the [mcp] table,
and its groups form the [mcp.http], [mcp.auth] and [mcp.auth.jwt] tables:
computer = "laptop"
timeout = 60.0
[mcp]
protocol = "http"
[mcp.http]
listen = "127.0.0.1"
port = 3009
allowed_origin = ["https://backlog.example.com"]
The options of the other commands, such as backlog task list, are command-line only.
To make every backlog command use a remote server, see
Always use a remote server.
Precedence¶
Each option gets its value from the first source that sets it:
The command line.
The
BACKLOG_MCP_*environment variable.The config files, in the reverse of the order above:
--configfirst,/etclast.The built-in default.
For example, BACKLOG_MCP_COMPUTER=desk backlog --computer laptop whoami uses the name
laptop.
Environment variable names¶
backlog --help and backlog mcp --help show the variable of each option as [ENV: ...].
The rules are:
The prefix is
BACKLOG_MCP_, for the global options and for themcpoptions alike.The rest is the attribute name in upper case. Options of a group add the group name:
--http-portisBACKLOG_MCP_HTTP_PORT, and--auth-jwt-issuerisBACKLOG_MCP_AUTH_JWT_ISSUER.--default-useraftermcpis the exception. Its variable isBACKLOG_MCP_DEFAULT_USER_OVERRIDE, becauseBACKLOG_MCP_DEFAULT_USERbelongs to the global--default-user.
A list option takes a list literal in brackets:
BACKLOG_MCP_HTTP_ALLOWED_ORIGIN='["https://a.example", "https://b.example"]' backlog mcp
Do not separate list items with spaces. A plain string is read as a sequence of single characters.
A boolean option takes a word such as true, yes or 1; false or 0 turns it off:
BACKLOG_MCP_HTTP_NO_CONSOLE=true backlog mcp --protocol=http
The computer name¶
A project is a directory tree on one computer. The computer name tells the computers apart when one database, synced or served over HTTP, holds the projects of several of them.
The default name is the short host name: the part before the first dot, with characters other
than letters, digits, dots, dashes and underscores replaced by dashes. If no valid name
remains, the name is localhost.
Set the name in one of these places:
the global option
--computer NAME;the
BACKLOG_MCP_COMPUTERenvironment variable;the
computerkey of a config file;for a client of an HTTP server,
?computer=NAMEin the endpoint URL.--computertakes precedence over the URL.
A name is one word of up to 63 characters. It starts with a letter or a digit and contains
only letters, digits, dots, dashes and underscores. backlog whoami shows the name in the
principal row as user@computer.
Generate a config file¶
--generate-config FILE writes the effective options as a TOML config file and exits. -
prints the file to stdout instead:
backlog --generate-config -
backlog --computer laptop --generate-config ~/.config/backlog-mcp/config.toml
backlog mcp --protocol=http --http-port=3009 --generate-config ./.backlog-mcp.toml
The file contains the global options and the [mcp] tables. An option that is set is written
as an active key. That includes values from the command line before the flag, from the
environment and from the config files. Every other option is written as a commented-out
default with its help text. Options after --generate-config on the command line are not
read.
Options without a default, such as database, computer, project and root, appear in the
file only when they are set.
backlog --generate-config writes the mcp options with their config-file and environment
values. To include mcp options from the command line, give them after mcp and before the
flag, as in the third example.
Warning
A --password, --token or --auth-jwt-pre-shared-key value given before the flag lands in
the file in plain text. A --auth-basic account lands in the file as a bcrypt hash. The flag
does not restrict the file mode, so restrict it yourself, for example with chmod 600.