This is the Clients section of the LinkJar PDS documentation, as Markdown. # Binaries and ports > The PDS, operations console, and MCP server, their build targets, and the network connections between them. [Source](https://pds.linkjar.io/reference/binaries/) Start with `linkjar-pds`. Add the console for operators or the MCP server for AI clients when you need them. Each is a separate Rust executable. ## What runs where | Executable | Purpose | Distribution | | --------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------- | | `linkjar-pds` | Hosts accounts, repositories, blobs, OAuth, and the optional private operations API | Nix package, portable Linux archive, Cargo, or Docker | | `linkjar-pds-console` | Gives operators a browser interface to the private operations API | Cargo with its asset bundle, or `Dockerfile.console` | | `linkjar-pds-mcp` | Connects an AI client to an account through MCP and OAuth | Cargo, or `Dockerfile.mcp` | The Nix package and portable archives currently include **only `linkjar-pds`**. There are no published native sidecar archives or sidecar NixOS modules in this repository. The `pds-sidecar` crate is a shared library, not another executable. The console and MCP server use authenticated APIs. They do not open the PDS database or need its admin password or PLC rotation key. The MCP server has its own OAuth client key. ## Network map | Service | Native address or port | Who connects | | ------------------ | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | TLS proxy | Public `443`; usually `80` for HTTPS redirects and certificate setup | Apps, browsers, relays, and remote AI clients | | PDS HTTP | `2583`, on all interfaces; `PDS_PORT` changes it | The proxy and trusted sidecars; block public access with the host firewall | | PDS operations API | Disabled unless `PDS_OPS_ADDRESS` is set; use `127.0.0.1:2584` on one host | The console and authorized operator tools | | Operations console | `127.0.0.1:2585`; set with `CONSOLE_ADDRESS` | Your browser through an SSH tunnel | | MCP HTTP | `127.0.0.1:2586`; set with `MCP_ADDRESS` | A TLS proxy for the MCP hostname | Port `2584` is a convention in the examples, not an automatically enabled listener. Keep it private. The console’s browser URL must be an HTTP loopback address; a public console hostname is not supported. The PDS image sets its internal HTTP port to `3000`. Compose sidecars use `http://pds:3000`; sidecars beside a native installation use `http://127.0.0.1:2583`. Inside a container, `127.0.0.1` is that container, not the host or a sibling service. Use the [Compose examples](https://pds.linkjar.io/scale/sidecars/) for that topology. ## Platforms and runtime files | Build | Supported package targets | Files to retain | | ------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | Normal PDS Nix package | Linux AMD64, Linux ARM64, Apple Silicon macOS | The Nix store closure | | Portable PDS archive | Linux AMD64 and Linux ARM64 | The executable, license, deployment commit, and checksum | | Sidecars built with Cargo | Build for the intended host; no portable sidecar release matrix yet | Executable and required runtime libraries; the console also needs its `assets/` directory | Native services need CA certificates for outbound HTTPS. The MCP and console keep sessions in memory, so restarting either requires its users to sign in again. The PDS data directory must persist independently of executable updates. ## Build the sidecars Use a reviewed checkout and the toolchain in `rust-toolchain.toml`. The [build prerequisites](https://pds.linkjar.io/start/builds/#build-with-cargo) apply here too. **Build the MCP server** ```bash cargo build --release --locked --package pds-mcp --bin linkjar-pds-mcp ``` **Build and bundle the operations console** ```bash cargo build --release --locked --package pds-console --bin linkjar-pds-console && target/release/linkjar-pds-console bundle-assets target/release/assets ``` Bundle the console assets **on the build machine**, before copying the executable elsewhere. Copy `target/release/assets/` alongside the executable as `assets/`. Without that bundle, the console attempts to build its assets at runtime using files from the source tree. The console build downloads a pinned, checksum-verified Tailwind CLI. To use an existing compatible executable, set `TAILWIND_CLI` before building. ## Choose the next guide * [Install the native PDS](https://pds.linkjar.io/start/native/) or [use Docker Compose](https://pds.linkjar.io/start/install/). * [Connect an AI client with MCP](https://pds.linkjar.io/connect/mcp/). * [Set up the operations console](https://pds.linkjar.io/connect/console/). * [Use the PDS operator commands](https://pds.linkjar.io/operate/cli/). # Use these docs with AI > Use llms.txt, focused Markdown bundles, or a single guide with your chosen assistant. [Source](https://pds.linkjar.io/connect/ai-guidance/) Use **Copy page** above any guide to copy its Markdown, including the source URL and command examples. **Use with AI** offers the documentation index, the full documentation, and a link to the current page. Code blocks have their own copy buttons; copying a command does not include the language or file title. These controls copy public documentation to your clipboard. They do not send it to an AI provider. Choose what to paste into your assistant. ## Choose how much context to share | You need | Use | | ------------------------------------------------- | ------------------------------------------------------------------------------------ | | Help with one task | Copy that guide, such as [native installation](https://pds.linkjar.io/start/native/) | | Help finding the right guide | [Documentation index](https://pds.linkjar.io/llms.txt) | | A new server or a different installation method | [Setup bundle](https://pds.linkjar.io/llms-setup.txt) | | Backups, updates, migration, or troubleshooting | [Operations bundle](https://pds.linkjar.io/llms-operations.txt) | | Connecting an AI client or the operations console | [Clients bundle](https://pds.linkjar.io/llms-clients.txt) | | Context across the whole project | [Complete documentation](https://pds.linkjar.io/llms-full.txt) | The complete export can be large. Start with the relevant page when your assistant has a small context window. If copying is unavailable in your browser, use **View Markdown** and copy the text directly. ## Give an assistant the documentation URL If your assistant can fetch web pages, give it the index URL. It can choose the relevant guides from there: **Documentation index** ```text https://pds.linkjar.io/llms.txt ``` If it cannot fetch URLs, download a bundle and attach the file, or paste the copied text. This example saves the setup guides: **Download the setup bundle** ```bash curl --fail --location --output linkjar-pds-setup.md \ https://pds.linkjar.io/llms-setup.txt ``` Every guide also has a **View Markdown** link. For example, [`/start/native.md.txt`](https://pds.linkjar.io/start/native.md.txt) is the native installation guide. The exports include source links and language-labeled code blocks. They are generated from the same content as this site when it is built. The HTML identifies each page’s Markdown alternative and links to `llms.txt` for tools that support discovery. Support varies by assistant; supplying the URL or file directly is the most reliable way to provide the context. ## A starting prompt Copy this prompt and the relevant installation guide into your chosen assistant: **Plan a PDS installation** ```text Help me set up LinkJar PDS using the attached official documentation. First ask whether this is a new installation or an existing data directory. Ask for my OS, CPU architecture, domain, and preferred installation method. Use the documented settings and commands, and cite the relevant guides. Explain which checks are local and which require testing from another host. Prepare a plan before changing files, services, DNS, or firewall rules. Keep credentials and private keys out of the conversation and logs. Generate and store secrets locally using the documented protected files. Stop if existing data or an unsupported platform changes the plan. After setup, verify configuration, HTTPS, health, and server metadata. Explain what remains unverified, including email delivery and restore tests. ``` Share redacted error messages when you need help. Keep runtime environment files, passwords, private keys, and account exports on the host or in your secret manager. Review the assistant’s proposed commands before running them. ## Checks you can run today The server already provides `check-config` and `health`. Use the [operator-command helper](https://pds.linkjar.io/operate/cli/) to run them with the service’s actual environment. Then follow [verify the setup](https://pds.linkjar.io/start/verify/) for external HTTPS and metadata checks. `check-config` validates configuration and required serving secrets. It does not prove that DNS, inbound networking, SMTP delivery, or backups work. ## Installation help and MCP access These are separate uses of AI. An assistant can help you follow the manual installation guide. The [MCP sidecar](https://pds.linkjar.io/connect/mcp/) connects an AI client to records in an account after sign-in; it has no host-installation tools. The supported setup paths are [NixOS or a native binary](https://pds.linkjar.io/start/native/) and [Docker Compose](https://pds.linkjar.io/start/install/). Neither requires an LLM or a model-provider account. # Operations console > Run the console beside a native PDS, grant an operator role, and connect privately through an SSH tunnel. [Source](https://pds.linkjar.io/connect/console/) The operations console shows accounts, sessions, audit events, and live server state. Operators can take supported actions with a recorded reason. It calls the PDS’s private operations API; it does not open the server’s database. Use an SSH tunnel to reach it. The console currently requires an HTTP loopback URL and does not support a public console hostname. ## Build the console Follow [the sidecar build commands](https://pds.linkjar.io/reference/binaries/#build-the-sidecars). Keep the generated `assets/` directory next to `linkjar-pds-console` when you install it. The PDS Nix package and portable archives do not include the console. For containers, use the [Compose console guide](https://pds.linkjar.io/scale/sidecars/#the-operations-console). The examples below assume native services on one Linux host. ## Connect it to the PDS Enable the private operations listener in the PDS service environment: **PDS service environment** ```dotenv PDS_OPS_ADDRESS=127.0.0.1:2584 ``` Configure a separate unprivileged console service: **Console service environment** ```dotenv CONSOLE_ADDRESS=127.0.0.1:2585 CONSOLE_PUBLIC_URL=http://127.0.0.1:2585 CONSOLE_PDS_PUBLIC_URL=https://pds.example.com CONSOLE_PDS_INTERNAL_URL=http://127.0.0.1:2583 CONSOLE_OPS_URL=http://127.0.0.1:2584 ``` Run `linkjar-pds-console` without arguments, with these settings loaded by your service manager. Adapt the [native systemd guide](https://pds.linkjar.io/start/native/#linux-binary-with-systemd) for its executable, environment file, and service user. The console does not need the PDS’s secrets or data directory. Read the client ID from the console’s startup log. Add it to `PDS_OPS_CLIENT_IDS` in the PDS environment, preserving any existing comma-separated entries. For the exact loopback URL above, the ID is: **PDS service environment — console client allowlist** ```dotenv PDS_OPS_CLIENT_IDS=http://localhost?redirect_uri=http%3A%2F%2F127.0.0.1%3A2585%2Foauth%2Fcallback&scope=atproto ``` Restart the PDS after updating its settings. If you change the console’s browser port, use the new client ID from its log. ## Grant an operator role Create the operator’s PDS account first. Only the PDS admin password can grant a role. Use the private operations listener on the server host, and supply the account’s real DID: **Run on the PDS host — curl prompts for the admin password** ```bash curl --fail-with-body --user admin \ --header 'X-Ops-Reason: first operator' \ --header 'Content-Type: application/json' \ --data '{"did":"REPLACE_WITH_ACCOUNT_DID","role":"operator"}' \ http://127.0.0.1:2584/xrpc/internal.ops.grantRole ``` `operator` permits operations other than granting roles. Use `moderator` for the more restricted moderation role. Keep the operations port off the public network. ## Open the console From your own computer, leave this SSH session open: **Forward the console to your computer** ```bash ssh -N -L 2585:127.0.0.1:2585 operator@pds.example.com ``` Open `http://127.0.0.1:2585` in your browser. Sign in on the PDS with the account that holds the operator role. Do not use the admin password as a console login. For a local health check, run `linkjar-pds-console health` with the console’s environment. Restarting the console signs operators out because sessions are stored in memory. ## If sign-in fails Check that the browser URL matches `CONSOLE_PUBLIC_URL`, the PDS allows the logged client ID, and the account has a role. Verify that the console service can reach `CONSOLE_OPS_URL`. When using containers, use the Compose network addresses instead of these native loopback examples. Next: [monitor the server](https://pds.linkjar.io/operate/monitoring/) and [review the audit log](https://pds.linkjar.io/operate/audit-log/). # Connect an AI client with MCP > Run the optional MCP server and connect an AI client to your PDS account with OAuth and scoped permissions. [Source](https://pds.linkjar.io/connect/mcp/) The MCP server lets an AI client read your account’s records and, when you allow it, write to selected collections. Your chosen AI application runs the model. The PDS and MCP server do not need an LLM API key. Use a client that supports **remote Streamable HTTP with OAuth**. This server does not expose a local stdio transport. Client support and setup screens vary; check your client’s documentation for that combination. ## Connection at a glance | Setting in your AI client | Value for the example deployment | | ------------------------- | -------------------------------- | | Server URL | `https://mcp.example.com/mcp` | | Transport | Streamable HTTP | | Authentication | OAuth through the browser | **MCP server URL — replace the example hostname** ```text https://mcp.example.com/mcp ``` The AI client connects to the MCP sidecar. The sidecar connects to the PDS through OAuth and authenticated repository APIs. It does not grant shell access, install software, or administer the host. ## Prepare the server First finish [PDS installation](https://pds.linkjar.io/start/overview/) and [create an account](https://pds.linkjar.io/start/first-account/). Give MCP its own DNS name, such as `mcp.example.com`, pointing to the host that will run it. [Build `linkjar-pds-mcp`](https://pds.linkjar.io/reference/binaries/#build-the-sidecars) from a reviewed checkout, or build `Dockerfile.mcp`. The portable PDS download does not contain it. The following addresses assume native services on one Linux host. ### Set the environment Store these settings in a protected runtime environment file. Generate a fresh P-256 private key with your key-management tool and store its 32-byte private scalar as 64 hexadecimal digits. This is a separate MCP client key, not the PDS’s secp256k1 PLC rotation key. Do not paste either key into your AI client. **MCP service environment** ```dotenv MCP_ADDRESS=127.0.0.1:2586 MCP_PUBLIC_URL=https://mcp.example.com MCP_PDS_PUBLIC_URL=https://pds.example.com MCP_PDS_INTERNAL_URL=http://127.0.0.1:2583 MCP_CLIENT_KEY_P256_PRIVATE_KEY_HEX=REPLACE_WITH_MCP_P256_PRIVATE_KEY MCP_WRITE_COLLECTIONS= ``` Leave `MCP_WRITE_COLLECTIONS` empty for the initial read-only connection. `MCP_PDS_PUBLIC_URL` must match the PDS’s public OAuth issuer even when the internal connection uses loopback. ### Allow the client at the PDS Add this metadata URL to the PDS’s `PDS_MCP_CLIENT_IDS` allowlist. Preserve any existing entries; this setting is a comma-separated list. **PDS service environment** ```dotenv PDS_MCP_CLIENT_IDS=https://mcp.example.com/oauth-client-metadata.json ``` Restart the PDS through its service manager after updating the setting. If you use `PDS_OAUTH_KNOWN_CLIENTS_FILE`, keep its MCP metadata and public key aligned with the running sidecar. ### Run the sidecar behind HTTPS Run `linkjar-pds-mcp` without arguments, as a separate unprivileged service. Have the service manager load its protected environment file. On a native Linux host, adapt the [systemd example](https://pds.linkjar.io/start/native/#linux-binary-with-systemd) with a separate service user, the MCP executable path, and its environment file. MCP does not need access to the PDS data directory. Proxy the **whole MCP origin**, including OAuth discovery and callbacks: **Caddyfile — native services on the same host** ```caddyfile mcp.example.com { reverse_proxy 127.0.0.1:2586 } ``` Keep port `2586` private. For Docker, bind inside the container and proxy through the container network instead of using the native loopback addresses. Check the public health and discovery routes: **Verify MCP discovery** ```bash curl --fail --silent --show-error https://mcp.example.com/health curl --fail --silent --show-error https://mcp.example.com/.well-known/oauth-protected-resource curl --fail --silent --show-error https://mcp.example.com/.well-known/oauth-authorization-server curl --fail --silent --show-error https://mcp.example.com/oauth-client-metadata.json ``` ## Connect and try a read 1. Add `https://mcp.example.com/mcp` as a remote server in your AI client. 2. Start the OAuth sign-in flow. Sign in on your PDS’s page and review consent. 3. Ask the client to use `whoami`, then `list_collections`. 4. Try `list_records` on one collection you recognize. These are the available repository tools: | Tools | Purpose | | ---------------------------------------------- | ---------------------------------------------------------------- | | `whoami` | Identify the signed-in account | | `describe_repo`, `list_collections` | Inspect the repository and its collections | | `list_records`, `get_record` | Read records | | `create_record`, `put_record`, `delete_record` | Write records when the session has permission for the collection | The client may send tool results to its configured model provider. Choose records and a provider appropriate for the data you intend to share. ## Enable selected writes Set `MCP_WRITE_COLLECTIONS` to the comma-separated collection NSIDs you want the client to be able to request. For example: **Example allowlist — use your application's collection** ```dotenv MCP_WRITE_COLLECTIONS=com.example.note ``` Restart the sidecar, refresh any pinned client metadata at the PDS, and sign in again to request the new permissions. The allowlist alone does not authorize a session: the user must grant access, and the PDS still validates each write. Review `put_record` and `delete_record` calls carefully; they can replace or remove existing records. ## Sessions and troubleshooting Run one MCP instance. Its registrations, tokens, and sessions are held in memory; a restart ends them. Reconnect and sign in again after a restart. For a service-local check, run `linkjar-pds-mcp health` with the same environment. | Symptom | Check | | ------------------------------------------------- | ------------------------------------------------------------------------------ | | The client only accepts a command and arguments | Use a client with remote Streamable HTTP and OAuth support | | Discovery succeeds but sign-in fails | Public URLs, the PDS client allowlist, pinned metadata, and the callback route | | Connection uses a container name on a native host | Change the internal URL to an address reachable from the sidecar | | Reads work but a write is denied | The collection allowlist and the permissions granted to this session | | The client loses access after a restart | Reconnect; sessions are intentionally in memory | For the protocol background, see the official [MCP authorization specification](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization). For deployment boundaries, see [binaries and ports](https://pds.linkjar.io/reference/binaries/). # Console and MCP server > Optional console and MCP sidecars, with Compose deployment examples and native build scope. [Source](https://pds.linkjar.io/scale/sidecars/) For a first setup, use the dedicated [MCP guide](https://pds.linkjar.io/connect/mcp/) or [operations console guide](https://pds.linkjar.io/connect/console/). This page keeps the Compose examples and existing links together. The [binary and port map](https://pds.linkjar.io/reference/binaries/) explains the native equivalents. Both sidecars talk to the server over its APIs. Neither holds a database connection, a signing key or a secret of the server, so each can be added and removed without touching the data directory, and every action they take is in the [audit log](https://pds.linkjar.io/operate/audit-log/). The examples on this page use Docker Compose. The native PDS archives and Nix packages include only `linkjar-pds`, not these sidecars. A native PDS can use separately built sidecars through the same APIs. Replace Compose DNS names with reachable host addresses and keep operations listeners private. Native listeners on the same host should use loopback, not the container-only `0.0.0.0` examples below. ## The operations console A page with the live numbers of the server and the firehose subscribers, the accounts and the sessions of each, the audit log, the blocked email domains and the operator roles. It takes an account down and lifts the takedown, ends an account’s sessions, disconnects a subscriber, blocks an email domain, signs a checkpoint, and removes expired sessions. Each form has a field for the reason, which goes into the audit entry. An operator signs in with their own account on the server, through OAuth, and the account needs a role. The console is a loopback client: reach it through an SSH tunnel, never under a public name. ### Run it On the server’s side, in `pds.env`: ```dotenv PDS_OPS_ADDRESS=0.0.0.0:2584 ``` In `compose.yml`, a service beside `pds`: ```yaml console: image: ghcr.io/linkjar/pds-console@sha256:… restart: unless-stopped environment: CONSOLE_ADDRESS: 0.0.0.0:2585 CONSOLE_PUBLIC_URL: http://127.0.0.1:2585 CONSOLE_PDS_PUBLIC_URL: https://pds.example.com CONSOLE_PDS_INTERNAL_URL: http://pds:3000 CONSOLE_OPS_URL: http://pds:2584 ports: - "127.0.0.1:2585:2585" ``` Start it and read its client id from its first log lines: ```bash docker compose up -d console && docker compose logs console ``` Put the id into `pds.env` as `PDS_OPS_CLIENT_IDS` and restart the server. The ops listener takes a token only from a client on that list. ### Grant a role Roles are `operator`, which takes every action but a role grant, and `moderator`, which reads, changes the status of a subject, ends sessions and disables invites. Only the admin password grants a role. Publish the ops listener on the host’s loopback, beside the console’s port: ```yaml ports: - "127.0.0.1:2584:2584" ``` Then, with `PDS_ADMIN_PASSWORD` in the environment and a reason, which every action on the ops listener requires: ```bash curl -s -u "admin:$PDS_ADMIN_PASSWORD" -H 'X-Ops-Reason: first operator' -H 'content-type: application/json' -d '{"did": "did:plc:…", "role": "operator"}' http://127.0.0.1:2584/xrpc/internal.ops.grantRole ``` ### Open it From your workstation, a tunnel to the host: ```bash ssh -L 2585:127.0.0.1:2585 operator@pds.example.com ``` Open `http://127.0.0.1:2585`, and sign in with the account that holds the role. A restart of the console signs every operator out: it keeps the sessions in memory. ## The MCP server An MCP server that AI clients connect to with OAuth, in order to read and write an account’s records with the account’s consent. It is a public service under a name of its own, such as `mcp.example.com`, behind Caddy. Toward the PDS it is an OAuth client with a key of its own; its own tokens never reach the PDS, and each write names the AI client in the audit entry. Its configuration is `MCP_ADDRESS`, `MCP_PUBLIC_URL`, `MCP_PDS_PUBLIC_URL`, `MCP_PDS_INTERNAL_URL`, `MCP_CLIENT_KEY_P256_PRIVATE_KEY_HEX` and `MCP_WRITE_COLLECTIONS`, the collections an AI client may ask to write. Its client id is `MCP_PUBLIC_URL` followed by `/oauth-client-metadata.json`, and it logs it at start. On the server’s side, `PDS_MCP_CLIENT_IDS` names it, and `PDS_OAUTH_KNOWN_CLIENTS_FILE` can hold its client metadata so that the server fetches nothing. Sessions live in the process’s memory, so one instance runs and a restart ends every session. The design and the state of both sidecars are in [docs/sidecars.md](https://github.com/linkjar/pds/blob/main/docs/sidecars.md) in the repository.