Remote MCP server over HTTP

In this scenario, one long-running server holds the backlog. Agents on several computers, the backlog command and the browser interface connect to it over HTTP.

Start the server

backlog mcp --protocol=http

backlog-mcp --protocol=http does the same thing. By default, the server listens on 127.0.0.1, port 3009. Use --http-listen and --http-port to change them:

backlog-mcp --protocol=http --http-listen=0.0.0.0 --http-port=8080

The server answers on these paths:

Path

What

/mcp

The MCP endpoint (Streamable HTTP).

/

Redirects to the browser interface at /ui/.

/ui/

The browser interface. See Browser interface.

/ui/static/connect.html

The Connect agent page. See Connect an agent.

/console

The bundled MCP console, for diagnostics. --http-no-console removes it.

Only /mcp requires credentials. The pages under /ui/ and /console are static files and contain no backlog data. They send the credentials that you enter to /mcp.

The server uses the same database options as the local server. See Where the data lives.

Authentication

Without authentication, the server accepts every request and serves it as one user: the value of --default-user, or $USER. In this mode, keep the default listen address 127.0.0.1.

The server has three independent authentication policies: Basic, JWT with a pre-shared key, and JWT with a public key. Configure any combination. A request must pass one of the configured policies. Requests without valid credentials get HTTP 401.

Each authenticated user sees only their own projects and the projects that other users shared with them. A Basic username and a JWT sub claim with the same value are the same user. --default-user is not accepted together with authentication.

Basic

Give one --auth-basic=USERNAME:PASSWORD for each account. Repeat the flag, or give several values to one flag:

backlog-mcp --protocol=http --auth-basic=alice:secret --auth-basic=bob:another-secret

Usernames must be unique and must not contain a colon. A password can contain colons. The server hashes plaintext passwords with bcrypt at startup. A bcrypt password must fit in 72 UTF-8 bytes.

To keep plaintext passwords out of the configuration, give a hashed entry bcrypt|USERNAME|<hash> instead. backlog hash-password asks for a username and a password and prints such an entry:

backlog hash-password

--auth-bcrypt-cost sets the bcrypt cost for new hashes, from 4 to 31 (default: 10).

JWT with a pre-shared key

backlog-mcp --protocol=http --auth-jwt-pre-shared-key="$BACKLOG_JWT_KEY"

The key must contain at least 32 bytes. The server accepts HS256 tokens signed with this key.

JWT with a public key

backlog-mcp --protocol=http --auth-jwt-public-key=/etc/backlog/jwt-public.pem

The value is a PEM public key, or the path to a file that contains it. The key type sets the accepted algorithms:

Key

Algorithms

RSA, at least 2048 bits

RS256, RS384, RS512, PS256, PS384, PS512

EC, P-256 / P-384 / P-521

ES256 / ES384 / ES512

Ed25519 or Ed448

EdDSA

JWT claims

Both JWT policies apply these rules:

  • Every token must have a valid exp claim.

  • Every token must have a non-empty sub claim. The sub value is the username.

  • --auth-jwt-issuer requires this iss value. When it is not set, any issuer is accepted.

  • --auth-jwt-audience requires this aud value. When it is not set, the audience is not checked.

The issuer and the audience require a pre-shared key or a public key; otherwise the server does not start. The server verifies tokens that another system issued. It does not issue or refresh tokens.

How clients send credentials

Policy

Header

Query parameter on the endpoint URL

Basic

Authorization: Basic <base64 of user:password>

auth=<base64 of user:password>

JWT

Authorization: Bearer <JWT>

token=<JWT>

Use the query parameter only for a client that cannot send an Authorization header. When a request has an Authorization header, the server ignores the query credentials. URLs can appear in browser history and proxy logs, so prefer the header.

The backlog command sends credentials with --user and --password, or with --token. See Command line.

Reverse proxy and browser origins

The endpoint refuses a browser request whose Origin is not the origin of the server itself. This check protects against DNS rebinding.

Behind a reverse proxy that terminates TLS, the server sees a different scheme or host than the browser. Give the exact public origins:

backlog-mcp --protocol=http --http-allowed-origin https://backlog.example

The server keeps the origin check and also accepts these origins. Use --http-trust-proxy only when the proxy validates the Origin header itself: this flag turns off the check in the server.

One server for several computers

One HTTP server answers for every computer of a user. The server cannot see the client’s computer or working directory, so the client names them in the endpoint URL:

https://backlog.example/mcp?computer=laptop&project=app
  • computer is the name of the computer that the client runs on. When it is missing or empty, the server uses unknown.

  • project fixes the current project of the connection. Without it, the agent passes project=<slug> to the tools that work on one project.

For a client that cannot read MCP resources natively, add resources=tool. The server then gives the tools mcp_resources_list and mcp_resources_read instead of native resource access.

Connect an agent

The configuration of each MCP client is different. The server generates it for you:

  1. Open /ui/static/connect.html on the server, or click Connect agent in the browser interface.

  2. The page fills in the MCP endpoint from the address of the server. Enter the computer name and the credentials, and select the agent and the configuration level.

  3. Copy the command or the configuration that the page shows.

The page generates the configuration in the browser. It does not send or save the credentials. The MCP console at /console has the same generator in its “Connect an agent” section.

To check the connection, ask the agent to call whoami. The result shows the user, the authentication type and the computer name from the URL.

Configuration file and environment

Every option of the server can come from the command line, from an environment variable, or from a TOML configuration file. The command line wins over the environment, and the environment wins over the file. See Where the data lives for the locations of the configuration files. --config FILE reads another file.

The server options are in the [mcp] table and its nested tables:

[mcp]
protocol = "http"

[mcp.http]
listen = "127.0.0.1"
port = 3009
allowed_origin = ["https://backlog.example"]

[mcp.auth]
basic = ["alice:secret", "bob:another-secret"]

[mcp.auth.jwt]
public_key = "/etc/backlog/jwt-public.pem"
issuer = "https://identity.example"
audience = "backlog"

backlog mcp --generate-config FILE writes a template of this file. Options given before --generate-config are written active; the others are written as commented-out defaults. Plaintext Basic passwords are written as bcrypt entries.

The environment variables use the prefix BACKLOG_MCP_ and the table path:

Option

TOML table and key

Environment variable

--protocol

[mcp] protocol

BACKLOG_MCP_PROTOCOL

--default-user

[mcp] default_user_override

BACKLOG_MCP_DEFAULT_USER_OVERRIDE

--http-listen

[mcp.http] listen

BACKLOG_MCP_HTTP_LISTEN

--http-port

[mcp.http] port

BACKLOG_MCP_HTTP_PORT

--http-no-console

[mcp.http] no_console

BACKLOG_MCP_HTTP_NO_CONSOLE

--http-allowed-origin

[mcp.http] allowed_origin

BACKLOG_MCP_HTTP_ALLOWED_ORIGIN

--http-trust-proxy

[mcp.http] trust_proxy

BACKLOG_MCP_HTTP_TRUST_PROXY

--auth-bcrypt-cost

[mcp.auth] bcrypt_cost

BACKLOG_MCP_AUTH_BCRYPT_COST

--auth-basic

[mcp.auth] basic

BACKLOG_MCP_AUTH_BASIC

--auth-jwt-pre-shared-key

[mcp.auth.jwt] pre_shared_key

BACKLOG_MCP_AUTH_JWT_PRE_SHARED_KEY

--auth-jwt-public-key

[mcp.auth.jwt] public_key

BACKLOG_MCP_AUTH_JWT_PUBLIC_KEY

--auth-jwt-issuer

[mcp.auth.jwt] issuer

BACKLOG_MCP_AUTH_JWT_ISSUER

--auth-jwt-audience

[mcp.auth.jwt] audience

BACKLOG_MCP_AUTH_JWT_AUDIENCE

Two variables take a list. BACKLOG_MCP_AUTH_BASIC takes a shell-quoted list of accounts. BACKLOG_MCP_HTTP_ALLOWED_ORIGIN takes a quoted list literal:

export BACKLOG_MCP_AUTH_BASIC="alice:secret 'bob:password with spaces'"
export BACKLOG_MCP_HTTP_ALLOWED_ORIGIN='["https://backlog.example", "https://backlog-admin.example"]'

Run it in a container

To run the server in Docker or in Kubernetes, see Installation.