Compare commits

...
10 Commits
Author SHA1 Message Date
m3ta-chironandClaude Opus 5.5 04528f206f docs(agents): Projektlandschaft-Abschnitt mit Verweis auf PM
CLAUDE.md und AGENTS.md nennen die direkten Abhängigkeiten zu den
Nachbar-Repos unter ~/ap und verweisen auf Gesamtübersicht und
OKF-Konzept im PM-Repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 19:34:06 +01:00
m3tam3re 3809d2e276 Merge pull request 'feat(coding/agents): split headless agent CLIs into cli.nix' (#11) from feat/coding-agents-cli-split into master
Reviewed-on: #11
2026-11-14 09:33:41 +01:00
m3ta-chironandClaude Opus 5.5 ab0439cbba feat(coding/agents): split headless agent CLIs into cli.nix
Move agent-lib and beads into a desktop-free module so servers that skip
the full coding set (AZ-PRM-1) can import it on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:25:59 +01:00
m3tam3re e3c8498fde Merge pull request 'feat(coding/agents): add Outlook MCP server via Microsoft Graph' (#10) from feat/outlook-graph-mcp into master
Reviewed-on: #10
2026-11-12 09:13:07 +01:00
m3ta-chiron 3b370a067d feat(coding/agents): add Outlook MCP server via Microsoft Graph
- Package marlonluo2018/microsoft_graph_mcp_server as a Python app; it talks to the Graph API, so it runs on Linux
- Register it as the Outlook entry in the shared MCP catalogue (mcp.nix)
- Authenticate with the device-code flow (`auth` tool, start then complete); tokens are stored in ~/.microsoft_graph_mcp_tokens.json
- Default USER_TIMEZONE to Europe/Berlin
2026-11-12 09:09:40 +01:00
m3ta-chiron f4ab2ab6c9 Merge pull request 'feat(coding/agents): hand the shared MCP catalogue to Claude Code' (#9) from feat/claude-mcp-integration into master 2026-11-10 20:16:00 +01:00
m3ta-chironandClaude Fable 5.1 c9f68a4361 feat(coding/agents): hand the shared MCP catalogue to Claude Code
- Move programs.mcp.servers out of agents.nix into mcp.nix so hosts that
  do not load the whole coding set (T3 Code servers) can import it alone
- Add claude-code.nix: programs.claude-code with enableMcpIntegration,
  replacing the bare llm-agents.claude-code package (would collide on
  bin/claude). home-manager delivers the catalogue as a generated plugin,
  ~/.claude/settings.json and ~/.claude.json stay writable
- ai-memory: register the session-aware Claude bridge via
  programs.claude-code.mcpServers instead of `ai-memory install-mcp`;
  activation only removes the stale user-scope entry now
- Adjust ai-memory.test.sh accordingly

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-10 20:15:24 +01:00
m3ta-chiron b63db50485 Merge branch 'master' of code.m3ta.dev:m3tam3re/m3ta-home 2026-11-05 07:59:10 +01:00
m3ta-chiron 11ddf5e00c Merge branch 'feat/t3code-environment-file' 2026-11-05 07:58:22 +01:00
m3ta-chironandClaude Opus 5.5 2187d9263d feat(t3code): add environmentFile option
Loads an optional KEY=value file (e.g. an agenix secret) as the
service's systemd EnvironmentFile. Store paths are rejected so secrets
cannot end up in the Nix store.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 07:48:18 +01:00
11 changed files with 211 additions and 54 deletions

No files matched your search

+11
View File
@@ -126,3 +126,14 @@ bd prime # Refresh Beads context
**Architecture in one line:** issues live in a local Dolt DB; sync uses `refs/dolt/data` on your git remote; `.beads/issues.jsonl` is a passive export. See https://github.com/gastownhall/beads/blob/main/docs/core-concepts/sync-concepts.md for details and anti-patterns. **Architecture in one line:** issues live in a local Dolt DB; sync uses `refs/dolt/data` on your git remote; `.beads/issues.jsonl` is a passive export. See https://github.com/gastownhall/beads/blob/main/docs/core-concepts/sync-concepts.md for details and anti-patterns.
<!-- END BEADS CODEX SETUP --> <!-- END BEADS CODEX SETUP -->
<!-- BEGIN PM-PROJEKTLANDSCHAFT -->
## Projektlandschaft
Dieses Repo ist eines von mehreren Projekten unter `~/ap`. Die Gesamtübersicht (Zweck, Remotes, Abhängigkeiten aller Repos) und das OKF-Wissensbündel liegen im privaten PM-Repo (`~/ap/PM/CLAUDE.md`, `~/ap/PM/.okf/`); das Konzept zu diesem Repo ist `.okf/systems/m3ta-home.md`. Ist das PM-Repo nicht vorhanden, diesen Abschnitt ignorieren. Ändern sich Zweck, Schnittstellen oder Abhängigkeiten dieses Repos, dort das Konzept aktualisieren und `.okf/log.md` ergänzen.
Direkte Abhängigkeiten:
- Konsumiert Pakete aus `m3ta-nixpkgs` (u. a. `agent-lib`, `talk`).
- `profiles/sets/coding/agents/claude-skills.nix` spiegelt `~/.agents/skills` (Ziel von `agent-lib sync` aus `agent-prod`) nach `~/.claude/skills` — Änderungen dort wirken auf alle Skills in Claude Code.
<!-- END PM-PROJEKTLANDSCHAFT -->
+11
View File
@@ -75,3 +75,14 @@ _Add a brief overview of your project architecture_
## Conventions & Patterns ## Conventions & Patterns
_Add your project-specific conventions here_ _Add your project-specific conventions here_
<!-- BEGIN PM-PROJEKTLANDSCHAFT -->
## Projektlandschaft
Dieses Repo ist eines von mehreren Projekten unter `~/ap`. Die Gesamtübersicht (Zweck, Remotes, Abhängigkeiten aller Repos) und das OKF-Wissensbündel liegen im privaten PM-Repo (`~/ap/PM/CLAUDE.md`, `~/ap/PM/.okf/`); das Konzept zu diesem Repo ist `.okf/systems/m3ta-home.md`. Ist das PM-Repo nicht vorhanden, diesen Abschnitt ignorieren. Ändern sich Zweck, Schnittstellen oder Abhängigkeiten dieses Repos, dort das Konzept aktualisieren und `.okf/log.md` ergänzen.
Direkte Abhängigkeiten:
- Konsumiert Pakete aus `m3ta-nixpkgs` (u. a. `agent-lib`, `talk`).
- `profiles/sets/coding/agents/claude-skills.nix` spiegelt `~/.agents/skills` (Ziel von `agent-lib sync` aus `agent-prod`) nach `~/.claude/skills` — Änderungen dort wirken auf alle Skills in Claude Code.
<!-- END PM-PROJEKTLANDSCHAFT -->
@@ -35,6 +35,7 @@ Agents committen auf beiden Hosts als `m3ta-chiron`.
| `m3ta.t3code.port` | port | `3773` | | `m3ta.t3code.port` | port | `3773` |
| `m3ta.t3code.interface` | str | `"wt0"` | | `m3ta.t3code.interface` | str | `"wt0"` |
| `m3ta.t3code.package` | package | `pkgs.llm-agents.t3code` | | `m3ta.t3code.package` | package | `pkgs.llm-agents.t3code` |
| `m3ta.t3code.environmentFile` | null oder absoluter Pfad außerhalb des Stores | `null` |
Eine Assertion verlangt `services.netbird.enable = true`. Eine Assertion verlangt `services.netbird.enable = true`.
@@ -42,6 +43,7 @@ Eine Assertion verlangt `services.netbird.enable = true`.
- Läuft als `user` mit Gruppe `users`; `HOME` und `WorkingDirectory` kommen aus `config.users.users.<user>.home`. - Läuft als `user` mit Gruppe `users`; `HOME` und `WorkingDirectory` kommen aus `config.users.users.<user>.home`.
- `T3CODE_PORT` kommt aus `port`. - `T3CODE_PORT` kommt aus `port`.
- `environmentFile` wird, falls gesetzt, als `EnvironmentFile` geladen (`KEY=value`-Zeilen, z. B. ein agenix-Secret).
- `path` enthält `/etc/profiles/per-user/<user>` und `/run/current-system/sw`. - `path` enthält `/etc/profiles/per-user/<user>` und `/run/current-system/sw`.
- `Restart = "on-failure"`, `RestartSec = 5`. - `Restart = "on-failure"`, `RestartSec = 5`.
- `bindsTo`, `after` und `wantedBy` zeigen auf `sys-subsystem-net-devices-<interface>.device`. - `bindsTo`, `after` und `wantedBy` zeigen auf `sys-subsystem-net-devices-<interface>.device`.
+15
View File
@@ -52,6 +52,20 @@ in {
defaultText = lib.literalExpression "pkgs.llm-agents.t3code"; defaultText = lib.literalExpression "pkgs.llm-agents.t3code";
description = "T3 Code package."; description = "T3 Code package.";
}; };
environmentFile = lib.mkOption {
type = lib.types.nullOr (lib.types.pathWith {
inStore = false;
absolute = true;
});
default = null;
example = "/run/agenix/t3code-env";
description = ''
File with `KEY=value` lines loaded into the server's environment
(systemd `EnvironmentFile`), e.g. tokens for the harnesses. Keep it
outside the Nix store, for example as an agenix secret.
'';
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@@ -75,6 +89,7 @@ in {
ExecStart = "${serve}/bin/t3code-serve ${cfg.interface} ${cfg.package}/bin/t3"; ExecStart = "${serve}/bin/t3code-serve ${cfg.interface} ${cfg.package}/bin/t3";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = "5"; RestartSec = "5";
EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile;
}; };
environment = { environment = {
+6 -42
View File
@@ -18,50 +18,17 @@
}; };
imports = [ imports = [
# ai-memory client, skill mirror and OpenCode config # ai-memory client, skill mirror, shared MCP catalogue, OpenCode and
# Claude Code config
./ai-memory.nix ./ai-memory.nix
./claude-skills.nix ./claude-skills.nix
./mcp.nix
./opencode.nix ./opencode.nix
./claude-code.nix
# headless agent CLIs (beads, agent-lib)
./cli.nix
]; ];
programs.mcp = {
enable = true;
servers = {
ContextMode = {
command = "bash";
args = ["-c" "exec bunx context-mode@latest"];
};
DeepWiki = {
url = "https://mcp.deepwiki.com/mcp";
};
Exa = {
command = "bash";
args = ["-c" "EXA_API_KEY=$(cat /run/agenix/exa-key) exec bunx exa-mcp-server@latest tools=web_search_exa"];
};
SallyAI = {
url = "https://app.sally.io/api/v1/McpExternal";
};
Metabase = {
url = "https://kpi.az-gruppe.com/api/metabase-mcp";
};
Outline = {
url = "https://wiki.az-gruppe.com/mcp";
};
Playwright = {
command = "bash";
args = ["-c" "exec bunx @playwright/mcp@latest"];
};
Ref = {
command = "bash";
args = ["-c" "REF_API_KEY=$(cat /run/agenix/ref-key) exec bunx ref-tools-mcp@latest"];
};
Teams = {
command = "bunx";
args = ["-y" "@floriscornel/teams-mcp@latest"];
};
};
};
# NOTE: llm-agent packages are consumed via the `llm-agents` namespace # NOTE: llm-agent packages are consumed via the `llm-agents` namespace
# (pkgs.llm-agents.*), provided by numtide/llm-agents.nix's # (pkgs.llm-agents.*), provided by numtide/llm-agents.nix's
# `overlays.shared-nixpkgs`. The consumer's nixos-config MUST apply that # `overlays.shared-nixpkgs`. The consumer's nixos-config MUST apply that
@@ -69,10 +36,7 @@
# silently falling back to (outdated) nixpkgs attributes. # silently falling back to (outdated) nixpkgs attributes.
home.packages = with pkgs; [ home.packages = with pkgs; [
agenix-cli agenix-cli
agent-lib
llm-agents.agent-browser llm-agents.agent-browser
llm-agents.beads
llm-agents.claude-code
llm-agents.claude-desktop llm-agents.claude-desktop
crunch crunch
docker-sbx docker-sbx
+21 -11
View File
@@ -3,12 +3,13 @@
# The server runs on m3-hermes (nixos-config) and is reached at # The server runs on m3-hermes (nixos-config) and is reached at
# memory.m3ta.dev; no server runs on clients. Hybrid setup: # memory.m3ta.dev; no server runs on clients. Hybrid setup:
# - Nix owns the package, the client config (server URL + bearer token # - Nix owns the package, the client config (server URL + bearer token
# file), the OpenCode MCP entry (via programs.mcp, since opencode.json # file), the MCP entries (programs.mcp for OpenCode, and a session-aware
# is a home-manager symlink) and the scope markers (~/.ai-memory.toml # override in programs.claude-code.mcpServers for Claude Code, both
# plus one marker per workspace directory). # delivered through the agents' enableMcpIntegration) and the scope
# - Activation runs ai-memory's own installers for the lifecycle hooks, # markers (~/.ai-memory.toml plus one marker per workspace directory).
# the session-aware Claude Code MCP entry and the skills, so generated # - Activation runs ai-memory's own installers for the lifecycle hooks and
# files always match the installed ai-memory version. # the skills, so generated files always match the installed ai-memory
# version.
# #
# The bearer token (an `aim_` API key, one per host) is an agenix secret the # The bearer token (an `aim_` API key, one per host) is an agenix secret the
# host repo provides at `tokenFile`. It is never copied into a generated # host repo provides at `tokenFile`. It is never copied into a generated
@@ -100,6 +101,18 @@ in {
args = ["mcp-bridge" "--no-session-id" "--server-url" "${cfg.serverUrl}/mcp"]; args = ["mcp-bridge" "--no-session-id" "--server-url" "${cfg.serverUrl}/mcp"];
}; };
# Claude Code gets the same server name through
# programs.claude-code.enableMcpIntegration, but session-aware: the stdio
# bridge forwards the lifecycle-hook session id and reads the token file
# itself. (A plain HTTP entry carries no credentials, and Claude Code then
# tries OAuth client registration, which ai-memory does not offer.)
# Claude Code's own mcpServers take precedence over the shared entry, so
# this is one server, not two.
programs.claude-code.mcpServers.ai-memory = mkIf (elem "claude-code" cfg.agents) {
command = exe;
args = ["mcp-bridge" "--server-url" "${cfg.serverUrl}/mcp"];
};
home.file = home.file =
{ {
# Client config: `ai-memory hook`, `mcp-bridge` and the installers # Client config: `ai-memory hook`, `mcp-bridge` and the installers
@@ -130,13 +143,10 @@ in {
'') '')
cfg.agents} cfg.agents}
${optionalString (elem "claude-code" cfg.agents) '' ${optionalString (elem "claude-code" cfg.agents) ''
# The MCP entry now comes from programs.claude-code (see above);
# drop the user-scope entry earlier versions wrote into ~/.claude.json.
export PATH="${pkgs.llm-agents.claude-code}/bin:$PATH" export PATH="${pkgs.llm-agents.claude-code}/bin:$PATH"
run claude mcp remove ai-memory -s user >/dev/null 2>&1 || true run claude mcp remove ai-memory -s user >/dev/null 2>&1 || true
# --session-aware: stdio bridge that reads the token file itself. A
# plain HTTP entry carries no credentials, and Claude Code then tries
# OAuth client registration, which ai-memory does not offer.
run ${exe} install-mcp --client claude-code --apply --session-aware \
--server-url ${escapeShellArg "${cfg.serverUrl}/mcp"}
''} ''}
# Into ~/.agents/skills; claude-skills-sync mirrors them to Claude. # Into ~/.agents/skills; claude-skills-sync mirrors them to Claude.
run ${exe} install-skills --scope global --agent agents run ${exe} install-skills --scope global --agent agents
@@ -51,7 +51,12 @@ check "hooks opencode2" "$act" "install-hooks --agent opencode2 --apply"
check "auth-token symlink" "$act" "ln -sfn /run/agenix/ai-memory-token " check "auth-token symlink" "$act" "ln -sfn /run/agenix/ai-memory-token "
refute "no token on command lines" "$act" "--auth-token" refute "no token on command lines" "$act" "--auth-token"
refute "activation must not write opencode.json (home-manager symlink)" "$act" "install-mcp --client opencode" refute "activation must not write opencode.json (home-manager symlink)" "$act" "install-mcp --client opencode"
check "claude mcp is the session-aware bridge" "$act" "install-mcp --client claude-code --apply --session-aware" refute "activation no longer registers the claude mcp itself" "$act" "install-mcp --client claude-code"
check "stale user-scope claude entry is removed" "$act" "claude mcp remove ai-memory -s user"
claude="$(ev programs.claude-code.mcpServers.ai-memory.args --apply 'builtins.concatStringsSep " "')"
check "claude mcp is the session-aware bridge" "$claude" "mcp-bridge --server-url https://memory.m3ta.dev/mcp"
refute "claude mcp forwards the session id" "$claude" "--no-session-id"
# Missing token file: skip with a warning, exit 0, never call ai-memory. # Missing token file: skip with a warning, exit 0, never call ai-memory.
script="$(printf '%s\n' "$act" | sed 's|/run/agenix/ai-memory-token|/nonexistent/ai-memory-token|g')" script="$(printf '%s\n' "$act" | sed 's|/run/agenix/ai-memory-token|/nonexistent/ai-memory-token|g')"
@@ -0,0 +1,20 @@
# Claude Code via home-manager `programs.claude-code`.
#
# enableMcpIntegration hands the shared programs.mcp catalogue (mcp.nix) to
# Claude Code the same way opencode.nix does for OpenCode: home-manager
# generates a plugin carrying .mcp.json and registers it (as a personal plugin
# under ~/.claude/skills/claude-code-home-manager on home-manager master, via a
# `--plugin-dir` wrapper on release-26.05). Nothing in ~/.claude is turned
# into a store symlink: settings.json (ai-memory hooks, plugins, theme) and
# ~/.claude.json (logins) stay writable for Claude Code itself.
#
# Do NOT add llm-agents.claude-code to home.packages next to this module;
# programs.claude-code installs its (possibly wrapped) package and a second
# `claude` would collide in the profile.
{pkgs, ...}: {
programs.claude-code = {
enable = true;
package = pkgs.llm-agents.claude-code;
enableMcpIntegration = true;
};
}
+11
View File
@@ -0,0 +1,11 @@
# Headless agent CLIs — safe for servers without a desktop.
# Imported by agents.nix; servers that skip the full "coding" set (e.g.
# AZ-PRM-1 in AZ-NIX-SERVERS) can import this file on its own.
# Packages from the `llm-agents` namespace need numtide/llm-agents.nix's
# `overlays.shared-nixpkgs` in the consumer (see agents.nix).
{pkgs, ...}: {
home.packages = with pkgs; [
agent-lib
llm-agents.beads
];
}
+51
View File
@@ -0,0 +1,51 @@
# Shared MCP server catalogue (home-manager `programs.mcp`).
#
# Single source for every agent that integrates with programs.mcp:
# OpenCode (opencode.nix, enableMcpIntegration) and Claude Code
# (claude-code.nix, enableMcpIntegration). ai-memory adds its own entry in
# ai-memory.nix. Hosts that do not load the whole coding set (servers running
# T3 Code) import this file directly.
{pkgs, ...}: {
programs.mcp = {
enable = true;
servers = {
ContextMode = {
command = "bash";
args = ["-c" "exec bunx context-mode@latest"];
};
DeepWiki = {
url = "https://mcp.deepwiki.com/mcp";
};
Exa = {
command = "bash";
args = ["-c" "EXA_API_KEY=$(cat /run/agenix/exa-key) exec bunx exa-mcp-server@latest tools=web_search_exa"];
};
SallyAI = {
url = "https://app.sally.io/api/v1/McpExternal";
};
Metabase = {
url = "https://kpi.az-gruppe.com/api/metabase-mcp";
};
Outline = {
url = "https://wiki.az-gruppe.com/mcp";
};
# Outlook mail, calendar and contacts via Microsoft Graph. First use:
# call the `auth` tool (start, then complete) for the device-code login.
Outlook = {
command = "${pkgs.callPackage ./microsoft-graph-mcp-server.nix {}}/bin/microsoft-graph-mcp-server";
};
Playwright = {
command = "bash";
args = ["-c" "exec bunx @playwright/mcp@latest"];
};
Ref = {
command = "bash";
args = ["-c" "REF_API_KEY=$(cat /run/agenix/ref-key) exec bunx ref-tools-mcp@latest"];
};
Teams = {
command = "bunx";
args = ["-y" "@floriscornel/teams-mcp@latest"];
};
};
};
}
@@ -0,0 +1,57 @@
# Microsoft Graph MCP server (mail, calendar, contacts of the signed-in M365
# account) by marlonluo2018. Chosen over the author's outlook-mcp-server,
# which drives the Outlook desktop client through win32COM and therefore only
# runs on Windows; this one talks to the Graph API and is plain Python.
#
# Not on PyPI, so it is built from the GitHub source. Auth is the device-code
# flow against Microsoft's public client id (no Azure app registration);
# tokens land in ~/.microsoft_graph_mcp_tokens.json. Settings come from env
# vars (CLIENT_ID, TENANT_ID, USER_TIMEZONE, ...); the optional .env the
# upstream README mentions would sit inside the store and is not used.
{
lib,
python3Packages,
fetchFromGitHub,
}:
python3Packages.buildPythonApplication {
pname = "microsoft-graph-mcp-server";
version = "0.1.0-unstable-2026-11-12";
pyproject = true;
src = fetchFromGitHub {
owner = "marlonluo2018";
repo = "microsoft_graph_mcp_server";
rev = "b4c2725ee9e3d47dce8641d5ca90434aca16c9db";
hash = "sha256-RSPyjq3Zu9WBbihI4yuB3PhxgRaF9G2gl+xaslnBdJI=";
};
build-system = with python3Packages; [hatchling];
dependencies = with python3Packages; [
mcp_1 # upstream targets the 1.x low-level Server API (list_tools decorators); mcp 2.x removed it
msal
httpx
pydantic
pydantic-settings
python-dotenv
click
rich
typing-extensions
tzdata
pillow # optional image attachments (MULTIMODAL_SUPPORTED)
];
# Upstream defaults USER_TIMEZONE to Asia/Shanghai; the env still wins.
makeWrapperArgs = ["--set-default" "USER_TIMEZONE" "Europe/Berlin"];
# server.py builds an MSAL client at import time, which hits the network,
# so only the config module is import-checked in the sandbox.
pythonImportsCheck = ["microsoft_graph_mcp_server.config"];
meta = {
description = "MCP server for Microsoft Graph (Outlook mail, calendar, contacts)";
homepage = "https://github.com/marlonluo2018/microsoft_graph_mcp_server";
license = lib.licenses.mit;
mainProgram = "microsoft-graph-mcp-server";
};
}