Skip to main content
Glama
README.md
# node01-mcp

A typed MCP server for Linux. It serves a skill catalogue over Streamable HTTP
and supports optional Telegram, WhatsApp and guarded shell tools.

## Install

From the checkout, with Python 3.12 or later:

```sh
python3 -m pip install .
```

## Run locally

Copy the [example config](config.example.toml) to the XDG config directory
and start the server:

```sh
config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/node01-mcp"
mkdir -p "$config_dir"
cp config.example.toml "$config_dir/config.toml"
node01-skills list
node01-mcp
```

With the example, `node01-skills list` prints an empty catalogue. The server
listens at `http://127.0.0.1:18420/mcp`. Set `MCP_CONFIG_PATH` to use a
separate config, and set `server.port` to an unused loopback port when testing.

## Configuration

- `server.skill_roots` lists directories containing skills. A skill needs a
  `SKILL.md` with a description. `node01-skills load NAME` reads a skill;
  `node01-skills search REQUEST` returns keyword matches and, if configured,
  semantic recommendations. `node01-skills classify` refreshes the semantic
  categories. Set `skills.router_skill` to the directory name of an optional
  routing skill.
- `NODE01_ENV_FILE` points to the environment file. Its default is
  `${XDG_CONFIG_HOME:-~/.config}/node01-mcp/.env`. The process reads only
  the named values needed for a tool or the optional semantic ranker.
- `NODE01_GUARD_HOOK` points to the operator's approval hook. Its default is
  `${XDG_CONFIG_HOME:-~/.config}/node01-mcp/guard.py`. The hook receives
  PreToolUse JSON on stdin. Guarded operations fail closed when it is
  unavailable. Optional non-secret shell variables go in `shell.env`.
- Define `cli.tlgr` and `telegram.visible_ops` to enable typed Telegram
  tools. An optional `cli.wacli` with `mode = "run"` enables the WhatsApp
  wrapper. Each configured wrapper has a `binary`, `timeout` and
  `max_output_bytes`. Use `env_names` to select environment-file entries.
- Loopback connections are checked against the Linux socket owner. With an
  authenticated Cloudflare proxy, configure `server.access_team_domain`
  and put `NODE01_ACCESS_AUD` in the environment file. The
  `load_instructions` tool requires a verified web request and reads
  `server.rules_file`, defaulting to `instructions.md` in the XDG config
  directory. `server.web_header` defaults to the standard proxy header.
- Runtime files live under `node01-mcp` in `${XDG_DATA_HOME:-~/.local/share}`
  (semantic category cache), `${XDG_STATE_HOME:-~/.local/state}` (classify log,
  oversized outputs) and `${XDG_CACHE_HOME:-~/.cache}` (Telegram schema).

When moving an existing installation, point the guard, environment file and
instructions settings at their existing operator-managed files. Set the
router name and any shell environment values in the local config.

## Command help

<!-- cli-help:start -->

```text
usage: node01-mcp
Serves the MCP endpoint on the host and port of [server] in the config file
(${XDG_CONFIG_HOME:-~/.config}/node01-mcp/config.toml, or MCP_CONFIG_PATH). See config.example.toml.

usage: node01-skills search <request> | list [category|all] | classify | load <name> [file]
```

<!-- cli-help:end -->

## Verify

Run `uv run --locked pytest` for the offline tests. To check a temporary server
with a synthetic skill and MCP clients, use the example port and your test
skill name:

```sh
uv run --locked python scripts/check_web_consumer.py http://127.0.0.1:18420/mcp demo
```

The check uses FastMCP and `mcporter`, reads the local skill and verifies
that an unauthenticated proxy request is rejected.