Metadata-Version: 2.4
Name: llm-kms-mcp
Version: 0.1.1
Summary: MCP Resource Server — llm-kms handbook distributor
License-Expression: MIT
Project-URL: Homepage, https://github.com/asynchronos/llm-kms-mcp
Project-URL: Source, https://github.com/asynchronos/llm-kms-mcp
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp>=1.2
Dynamic: license-file

# llm-kms MCP Handbook Server

An MCP Resource Server that ships the [llm-kms](https://github.com/operator47/llm-kms) schema, skill, and templates as a self-contained package. Any agent can read these resources to bootstrap its own llm-kms wiki in any repo — no external repo required.

## What it exposes

| Resource URI | Content |
|---|---|
| `llmkms://guide/bootstrap` | Step-by-step bootstrap guide (start here) |
| `llmkms://spec/claude-md` | Full authoritative schema (CLAUDE.md) |
| `llmkms://skill/skill-md` | Thin router (SKILL.md) — points to the per-op skills below |
| `llmkms://skill/ingest` | Ingest procedure |
| `llmkms://skill/query` | Query procedure |
| `llmkms://skill/lint` | Lint procedure |
| `llmkms://skill/prune` | Prune procedure |
| `llmkms://template/atomic-note` | Blank atomic-note template |
| `llmkms://template/index` | Blank index.md starter |
| `llmkms://template/log` | Blank log.md starter |
| `llmkms://reference/gitignore` | Recommended .gitignore |
| `llmkms://reference/gitleaks` | Recommended .gitleaks.toml |
| `llmkms://reference/lint-script` | Standalone Python lint script |
| `llmkms://manifest` | JSON index with sha256 per resource |

All resources are bundled inside the package — no environment variables needed.

## Tools

| Tool | Parameters | Does |
|---|---|---|
| `scaffold_llm_kms` | `target_dir` | Scaffolds an llm-kms wiki folder structure (`inbox/`, `raw/`, `archive/`, `system/templates/`, `index.md`, `log.md`, merged `.gitignore`) in `target_dir`. Safe to re-run — skips files that already exist. |
| `scaffold_mcp_server` | `target_dir`, `package_name`, `port=8765`, `concurrent_writes=False` | Generates a standalone wiki MCP server project in `target_dir`: `core.py`, `server_public.py` (HTTP, query-only), `server_local.py` (stdio, full tool set), a generated `_config.py` with a random bearer token, `pyproject.toml`, and a copy of the per-op skill files under `.claude/skills/<package_name>/`. `concurrent_writes=True` switches generated note IDs from 17 to 25 digits (collision-safe for multiple agents writing at once). |

## Requirements

- Python >= 3.10

## Install

### From PyPI

```bash
pip install llm-kms-mcp
```

### From source

```bash
git clone https://github.com/operator47/llm-kms-mcp.git
cd llm-kms-mcp
pip install .
```

## Run (smoke test with MCP Inspector)

Node.js must be installed.

```bash
npx @modelcontextprotocol/inspector python -m llm_kms_mcp
```

In the Inspector: confirm all 14 resources appear under `llmkms://` and both tools (`scaffold_llm_kms`, `scaffold_mcp_server`) are listed; read `llmkms://guide/bootstrap` to verify content.

## Register with Claude Code

**Project-scoped** (`.mcp.json` in your repo):

```json
{
  "mcpServers": {
    "llm-kms-handbook": {
      "command": "python",
      "args": ["-m", "llm_kms_mcp"]
    }
  }
}
```

**With `uv`** (no separate install step):

```json
{
  "mcpServers": {
    "llm-kms-handbook": {
      "command": "uvx",
      "args": ["llm-kms-mcp"]
    }
  }
}
```

**User-scoped via CLI:**

```bash
claude mcp add llm-kms-handbook -- python -m llm_kms_mcp
```

## Acceptance checks

After installing:

1. All 14 resources are listed in the Inspector.
2. `llmkms://guide/bootstrap` returns the bootstrap guide.
3. `llmkms://manifest` lists all resources with sha256 hashes and no errors.
4. A new empty repo bootstrapped from the guide produces a clean lint result.
5. `scaffold_llm_kms` and `scaffold_mcp_server` are both callable and produce the files described above.
