Skip to content

AI

Saphira Linux aiDragon

A practical Saphira workspace for AI agents: your code, services, databases and tools stay under your control, while the model can run wherever it works best.

Saphira ships saphira-sysref 0.1.0

Saphira Linux aiDragon, the AI agent workspace mascot

You are about to unpack an archive. Before an agent touches it, can it explain tar -xzf?

A release archive turns up in a deployment directory. The command looks familiar, and that is exactly when it is easy to let a model fill in the gaps. Before we ask an agent to run it, we can ask it to show us what those three letters mean on this host.

After Sysref is connected, the agent begins the same way you would expect any MCP client to begin: it asks the server what is available. Here, the real tools/list reply contains one small tool:

tools/list
akaman.man
  Get minimal local man-page context for command syntax.
  query: string (required)
  section?: string
  source?: man | doc | headers
  stats?: boolean

That is enough to ask a precise follow-up. Instead of treating the bundle as a magic incantation, it asks the local manual about it:

akaman.man({
  "query": "tar -xzf",
  "source": "man",
  "stats": true
})
tar(1)
     -x, --extract, --get
            Extract files from an archive.

     -z, --gzip, --gunzip, --ungzip
            Filter the archive through gzip(1).

     -f, --file=ARCHIVE
            Use archive file or device ARCHIVE.

[akaman] tar(1) full=43836B/~10959tok returned=1605B/~402tok reduction=96.3% status=0

Now we have something solid to work from: extraction, gzip filtering and an archive argument. The next action is no longer based on the model remembering tar correctly; it is based on the tar(1) installed here. The excerpt is short, while the statistics describe the complete response.

Put Sysref beside your agent

On Saphira, the package is ready to install:

apk add saphira-sysref

This installs release 0.1.0-r5 from the hatched repository: one static binary, no dependencies, no database and no network. On Saphira, the public binary and MCP server are called sysref. That is the name to use in your configuration.

MCP uses standard input and output here. With Codex, register the local binary like this:

codex mcp add sysref -- /usr/bin/sysref --mcp

With opencode, add the same local server to opencode.json and restart, since configuration is read at startup and not hot-reloaded:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "sysref": {
      "type": "local",
      "command": ["/usr/bin/sysref", "--mcp"],
      "enabled": true
    }
  }
}

After the restart, your agent does not need to memorise this page. It lists the server's tools and gets exactly one back, man, with query, section, source and stats parameters. Start with a bare command for the overview; add the option or term you actually need. In the manual source, section means the manual-page section: stat defaults to stat(1), while section 2 selects stat(2) and section 3 selects stat(3p).

The questions that arrive halfway through the work

You are reviewing a process that starts another program. Should this file descriptor survive a successful exec? The answer is spread between a header and a manual page, so the agent follows the local trail instead of guessing from a constant name:

akaman.man({
  "query": "fcntl",
  "source": "headers",
  "stats": true
})
  → #include <fcntl.h>

akaman.man({
  "query": "bits/fcntl-linux F_SETFD",
  "source": "headers",
  "stats": true
})
  → #define F_SETFD 2  /* Set file descriptor flags. */

akaman.man({
  "query": "bits/fcntl-linux FD_CLOEXEC",
  "source": "headers",
  "stats": true
})
  → #define FD_CLOEXEC 1  /* Actually anything with low bit set goes */
akaman.man({
  "query": "fcntl F_SETFD",
  "source": "man",
  "stats": true
})
  → fcntl(3p)
    F_SETFD       Set the file descriptor flags defined in <fcntl.h>, that are
                   associated with fildes, to the third argument, arg, taken as
                   type int.  If the FD_CLOEXEC flag in the third argument is
                   0, the file descriptor shall remain open across the exec
                   functions; otherwise, the file descriptor shall be closed
                   upon successful execution of one of the exec functions.

    [akaman] fcntl(3p) full=26832B/~6708tok returned=476B/~119tok reduction=98.2% status=0

That gives you a narrow, checkable conclusion: F_SETFD with FD_CLOEXEC closes the descriptor after a successful exec. It does not settle the creation path, error handling or portability policy for a particular program, so the agent still needs to do that work before it writes code. The public include remains fcntl.h; the focused definitions came from following its local include chain.

Later, you may be debugging NSS behaviour and need to know which setting changes its logging. This is not a man-page question, so the agent asks the documentation source which files it has, then narrows its question:

akaman.man({
  "query": "systemd",
  "source": "doc",
  "stats": true
})
  → systemd(doc)
    DOC FILES: README | TRANSIENT-SETTINGS.md | UIDS-GIDS.md | ENVIRONMENT.md

akaman.man({
  "query": "systemd SYSTEMD_NSS_LOG_LEVEL",
  "source": "doc",
  "stats": true
})
  → systemd/ENVIRONMENT.md
    * `$SYSTEMD_NSS_LOG_LEVEL=<level>` — If set, sets the log level for `nss-systemd`
      and other NSS plugins specifically. Takes priority over `$SYSTEMD_LOG_LEVEL`.

    [akaman] systemd(ENVIRONMENT.md) full=45984B/~11496tok returned=187B/~47tok reduction=99.6% status=0

You can now scope the change to NSS plug-ins and see that it takes priority over the general log level. We have not established the accepted values for level here, so a careful agent keeps looking or tests safely instead of making them up. Different question, different source, same habit: ask, read, then take the next step.

Keep the useful bit; leave the manual where it is

There is a practical reason to work this way. You need the part that answers the question, not ten thousand tokens of manual page in the middle of a conversation. These figures came back from the actual calls on this server; another machine may have a different documentation set.

ExampleFull pageReturnedReduction
tar (bare synopsis)43,836 B / ~10,959 tok1,121 B / ~281 tok97.4%
tar -xzf (three bundled options)43,836 B / ~10,959 tok1,605 B / ~402 tok96.3%
tar --gzip43,836 B / ~10,959 tok92 B / ~23 tok99.8%
fcntl.h (header start)11,400 B / ~2,850 tok337 B / ~85 tok97.0%
fcntl F_SETFD26,832 B / ~6,708 tok476 B / ~119 tok98.2%
systemd NSS setting45,984 B / ~11,496 tok187 B / ~47 tok99.6%

For the same tar(1) page, a broad lookup brought back about 281 tokens; the narrow gzip question needed about 23. That is roughly 92% less context to read. The bundled -xzf question is larger at about 402 tokens because we genuinely needed three option entries. Small is useful only when it is still enough.

When you pass stats: true, the reply also tells you the full size, returned size, estimated tokens, reduction and status. That lets an agent tighten a question before it fills the conversation with context it did not need.

When Sysref says no, listen

Sometimes the useful answer is that the documentation is not there. These two documentation-source lookups returned no content and status 1:

akaman.man({
  "query": "openssl",
  "source": "doc",
  "stats": true
})
  → no local doc match for "openssl"

    [akaman] ?() full=0B/~0tok returned=33B/~9tok reduction=0.0% status=1

akaman.man({
  "query": "php",
  "source": "doc",
  "stats": true
})
  → no local doc match for "php"

    [akaman] ?() full=0B/~0tok returned=29B/~8tok reduction=0.0% status=1

Ambiguous names are quieter. Bare stat returned stat(1). Section 2 returned the system-call page stat(2), and section 3 returned stat(3p). Sysref will not stop to ask which one you mean; an agent needs to notice that choice and say so.

akaman.man({
  "query": "stat RETURN VALUE",
  "section": "2",
  "source": "man",
  "stats": true
})
  → stat(2)
    RETURN VALUE
      On success, zero is returned. On error, -1 is returned, and errno is set
      to indicate the error.

    [akaman] stat(2) full=10965B/~2742tok returned=129B/~33tok reduction=98.8% status=0

A green status is not proof that you have the right passage. tar --file returned only the example --file=remotehost:/dev/sr0 with status 0; tar -f returned the option definition. Read what came back. If it is merely nearby, ask again more precisely; if the documentation is absent, use another source or a safe experiment.

WarningSysref can narrow local documentation. It cannot validate an interpretation, create a missing document, or choose between similarly named manual pages for you.

One tool, two names you may see

The transcripts above say akaman because that was the upstream, pre-rebrand MCP registration used for this investigation. Saphira packages the functionally identical tool as Sysref: recipe saphira-sysref, release 0.1.0-r5, with the public binary and MCP registration named sysref. You do not need to learn a second tool.

So the evidence above reads akaman. On Saphira, use the Sysref commands shown earlier: install saphira-sysref and point your MCP client at /usr/bin/sysref --mcp. The public name changes; the MCP interaction does not.