iso27001-mcp 0.8.4 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +21 -1293
  2. package/dist/index.js +436 -49
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Turn Claude into an ISO 27001 compliance assistant** — controls, risk register, policies, evidence tracking, SoA generation, and full audit workflows in one local encrypted MCP server.
4
4
 
5
- [![Socket Badge](https://badge.socket.dev/npm/package/iso27001-mcp/0.8.4)](https://socket.dev/npm/package/iso27001-mcp/overview/0.8.4)
5
+ [![Socket Badge](https://badge.socket.dev/npm/package/iso27001-mcp/0.8.6)](https://socket.dev/npm/package/iso27001-mcp/overview/0.8.6)
6
6
  [![npm version](https://img.shields.io/npm/v/iso27001-mcp.svg)](https://npmjs.com/package/iso27001-mcp)
7
7
  [![npm downloads](https://img.shields.io/npm/dt/iso27001-mcp.svg)](https://npmjs.com/package/iso27001-mcp)
8
8
  [![CI](https://github.com/Sushegaad/MCP-Server-for-ISO27001/actions/workflows/ci.yml/badge.svg)](https://github.com/Sushegaad/MCP-Server-for-ISO27001/actions/workflows/ci.yml)
@@ -52,13 +52,12 @@ The difference from generating static documents: Claude can *query, reason, and
52
52
  - **Ubuntu/Debian:** `sudo apt-get install build-essential python3`
53
53
  - **Windows:** [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/) → "Desktop development with C++"
54
54
 
55
- ### Four commands to get running
55
+ ### Three commands to get running
56
56
 
57
57
  ```bash
58
58
  npm install -g iso27001-mcp # 1. install globally
59
- iso27001-mcp init # 2. interactive setup wizard
60
- iso27001-mcp keygen --label "me" --role admin # 3. generate admin API key (if not already done by init)
61
- iso27001-mcp doctor # 4. verify everything is working
59
+ iso27001-mcp init # 2. interactive setup — secrets, database, API key, Claude config
60
+ iso27001-mcp doctor # 3. verify everything is working
62
61
  ```
63
62
 
64
63
  After running `iso27001-mcp doctor` you should see:
@@ -71,7 +70,7 @@ iso27001-mcp — health check
71
70
  ✅ MCP_API_KEY set (starts with iso27001_)
72
71
  ✅ Database file /Users/you/.iso27001/isms.db
73
72
  ✅ Database accessible opened and queried successfully
74
- ✅ Migrations 6/6 applied
73
+ ✅ Migrations 7/7 applied
75
74
  ✅ Controls seeded 93 ISO 27001:2022 controls
76
75
  ✅ Active API key 1 active key found
77
76
  ✅ Claude Desktop config /Users/you/.../claude_desktop_config.json
@@ -133,11 +132,11 @@ Generate any of these with a single Claude prompt:
133
132
 
134
133
  ### Evidence Document Templates
135
134
 
136
- Pre-structured evidence documents for auditor submissions: `risk_assessment` · `internal_audit` · `management_review` · `access_review` · `incident_review` · `bcp_test`
135
+ Pre-structured evidence documents for auditor submissions: `access_review_attestation` · `bcp_test_report` · `incident_post_mortem` · `risk_treatment_sign_off` · `supplier_security_questionnaire` · `training_acknowledgement`
137
136
 
138
137
  ### Sample Outputs
139
138
 
140
- The [`samples/`](samples/) directory contains auditor-ready example outputs for a fictitious organisation ("Acme Financial Services Ltd") — a full gap assessment, remediation roadmap, risk register CSV, SoA CSV, access control policy, incident handling procedure, internal audit report, corrective action records, and evidence package. See [Sample Outputs](#sample-outputs) for the full index.
139
+ The [`samples/`](samples/) directory contains auditor-ready example outputs for a fictitious organisation ("Acme Financial Services Ltd") — a full gap assessment, remediation roadmap, risk register CSV, SoA CSV, access control policy, incident handling procedure, internal audit report, corrective action records, and evidence package. See [Sample Outputs](docs/REFERENCE.md#sample-outputs) for the full index.
141
140
 
142
141
  > **ISO 27001 keywords:** ISO 27001 Statement of Applicability generator · ISO 27001 risk register template · ISO 27001 gap assessment tool · ISO 27001 audit evidence tracker · ISO 27001 MCP server · Claude ISO 27001 compliance assistant · AI GRC tool open source
143
142
 
@@ -191,19 +190,7 @@ For the full security profile — threat model, hardening guide, supply chain at
191
190
  - [Templates](#templates)
192
191
  - [Security Model](#security-model)
193
192
  - [Use Cases](#use-cases)
194
- - [Installation](#installation)
195
- - [Connecting to Claude](#connecting-to-claude)
196
- - [Advanced / Manual Setup](#advanced--manual-setup)
197
- - [Tools Reference](#tools-reference)
198
- - [MCP Resources](#mcp-resources)
199
- - [Architecture](#architecture)
200
- - [Modes](#modes)
201
- - [Sample Outputs](#sample-outputs)
202
- - [Integrations](#integrations)
203
- - [Roadmap](#roadmap)
204
- - [Development](#development)
205
- - [Contributing](#contributing)
206
- - [Security](#security)
193
+ - [Full Reference](#full-reference) — installation, tools API, architecture, modes, development, security
207
194
 
208
195
  ---
209
196
 
@@ -301,1280 +288,21 @@ Every tool call is logged in a tamper-evident audit trail. Admins can query it a
301
288
 
302
289
  ---
303
290
 
304
- ## Installation
291
+ ## Full Reference
305
292
 
306
- ### Prerequisites
307
-
308
- - **Node.js ≥ 20.11.0** — use [nvm](https://github.com/nvm-sh/nvm) or [Volta](https://volta.sh)
309
- - **npm ≥ 10**
310
- - **Build tools** for the native SQLite module:
311
- - macOS: `xcode-select --install`
312
- - Ubuntu/Debian: `sudo apt-get install build-essential python3`
313
- - Windows: Install [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/) → "Build Tools for Visual Studio" → check "Desktop development with C++"
314
-
315
- ### Step 1 — Install
316
-
317
- ```bash
318
- npm install -g iso27001-mcp
319
- ```
320
-
321
- The `iso27001-mcp` command is now available globally. The encrypted SQLite module (`better-sqlite3-multiple-ciphers`) downloads a prebuilt binary on supported platforms; it compiles from source if none is available.
322
-
323
- ### Step 2 — Run the setup wizard
324
-
325
- ```bash
326
- iso27001-mcp init
327
- ```
328
-
329
- The wizard handles everything in one guided session — no `openssl` required:
330
-
331
- - Generates `DB_ENCRYPTION_KEY` and `HMAC_SECRET` (AES-256 / HMAC-SHA256, 64 hex chars each)
332
- - Writes a `~/.iso27001/.env` file with mode `600`
333
- - Creates and seeds the encrypted SQLite database with all 93 ISO 27001:2022 controls
334
- - Generates an admin API key
335
- - Detects your Claude Desktop config and offers to add the `iso27001-mcp` entry automatically
336
-
337
- ### Step 3 — Verify
338
-
339
- ```bash
340
- iso27001-mcp doctor
341
- ```
342
-
343
- Runs 10 health checks and prints `✅ / ❌ / --` for each. All green means Claude Desktop is ready.
344
-
345
- ### Step 4 — Restart Claude Desktop
346
-
347
- Quit the app fully and reopen it. The ISO 27001 tools will appear in the tools panel.
348
-
349
- > **Tip:** Ask Claude `"Use get_server_info to verify the server is running"` to confirm the connection.
350
-
351
- ---
352
-
353
- ## Connecting to Claude
354
-
355
- ### Claude Desktop (automatic via `init`)
356
-
357
- `iso27001-mcp init` writes the following entry into `claude_desktop_config.json` automatically. You can also add or update it manually:
358
-
359
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
360
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
361
-
362
- ```json
363
- {
364
- "mcpServers": {
365
- "iso27001-mcp": {
366
- "command": "iso27001-mcp",
367
- "env": {
368
- "DB_ENCRYPTION_KEY": "<generated by init>",
369
- "HMAC_SECRET": "<generated by init>",
370
- "MCP_API_KEY": "<generated by init>",
371
- "DB_PATH": "/Users/you/.iso27001/isms.db",
372
- "AUDIT_LOG_PATH": "/Users/you/.iso27001/audit.jsonl"
373
- }
374
- }
375
- }
376
- }
377
- ```
378
-
379
- ### Claude Code
380
-
381
- ```bash
382
- # Add to your project's MCP config
383
- claude mcp add iso27001-mcp iso27001-mcp
384
- ```
385
-
386
- Then set the required env vars in your shell or `.env`:
387
-
388
- ```bash
389
- export DB_ENCRYPTION_KEY=your_db_encryption_key
390
- export HMAC_SECRET=your_hmac_secret
391
- export MCP_API_KEY=iso27001_your_key_here
392
- export DB_PATH=$HOME/.iso27001/isms.db
393
- ```
394
-
395
- ### Managing API Keys
396
-
397
- ```bash
398
- # Generate additional keys for team members
399
- iso27001-mcp keygen --label "Alice" --role viewer # read-only, 31 tools
400
- iso27001-mcp keygen --label "Bob" --role analyst --expires 90d # 49 tools
401
- iso27001-mcp keygen --label "CISO" --role admin --expires 1y # all 63 tools
402
-
403
- # List all keys
404
- iso27001-mcp keys list
405
-
406
- # Revoke a key immediately
407
- iso27001-mcp keys revoke --label "Alice"
408
- ```
409
-
410
- The raw key is printed **once** and never stored in plaintext. Save it immediately.
411
-
412
- ---
413
-
414
- ## Advanced / Manual Setup
415
-
416
- > Use this path if you need a custom database location, CI/CD integration, or prefer to manage secrets without the wizard.
417
-
418
- **1. Generate secrets:**
419
-
420
- ```bash
421
- openssl rand -hex 32 # → DB_ENCRYPTION_KEY
422
- openssl rand -hex 32 # → HMAC_SECRET
423
- ```
424
-
425
- **2. Create `.env`** (store outside your project root, never commit):
426
-
427
- ```bash
428
- DB_ENCRYPTION_KEY=<64 hex chars>
429
- HMAC_SECRET=<64 hex chars>
430
- DB_PATH=/path/to/isms.db
431
- AUDIT_LOG_PATH=/path/to/audit.jsonl
432
- ```
433
-
434
- **3. Generate an admin API key:**
435
-
436
- ```bash
437
- source /path/to/.env # or export vars individually
438
- iso27001-mcp keygen --label admin --role admin
439
- ```
440
-
441
- **4. Add the `iso27001-mcp` entry** to `claude_desktop_config.json` manually (see JSON block above), then restart Claude Desktop.
442
-
443
- **Full environment variable reference:**
444
-
445
- | Variable | Required | Default | Description |
446
- |----------|----------|---------|-------------|
447
- | `DB_ENCRYPTION_KEY` | ✅ | — | 32-byte hex key for AES-256 SQLite encryption |
448
- | `HMAC_SECRET` | ✅ | — | 32-byte hex secret for HMAC-signing API keys |
449
- | `DB_PATH` | | `./isms.db` | Path to the encrypted database file |
450
- | `AUDIT_LOG_PATH` | | `./audit.jsonl` | Path for the append-only JSON-L audit log (`.jsonl` or `.log` only) |
451
- | `RATE_LIMIT_RPM` | | `500` | Tool calls per minute per API key |
452
- | `SESSION_TTL_HOURS` | | `4` | SSE session TTL (hosted/team modes) |
453
- | `SSE_PORT` | | `3000` | Port for the SSE server (hosted/team modes) |
454
- | `BEHIND_TLS_PROXY` | | `false` | Set `true` when behind nginx/Caddy in production |
455
- | `CORS_ORIGIN` | | `http://localhost` (dev) / `https://claude.ai` (prod) | Allowed CORS origin for the SSE server — never set to `*` |
456
- | `JIRA_BASE_URL` | | — | e.g. `https://your-org.atlassian.net` |
457
- | `JIRA_API_TOKEN` | | — | Jira API token for the integration |
458
- | `JIRA_PROJECT_KEY` | | — | e.g. `SEC` |
459
- | `JIRA_USER_EMAIL` | | — | Email address associated with the Jira API token |
460
- | `GITHUB_TOKEN` | | — | GitHub personal access token (scope: `issues:write`) |
461
- | `GITHUB_REPO` | | — | e.g. `your-org/your-repo` |
462
-
463
- **Run from source** (for development or to get the latest unreleased changes):
464
-
465
- ```bash
466
- git clone https://github.com/Sushegaad/MCP-Server-for-ISO27001
467
- cd MCP-server-for-ISO27001
468
- npm install
469
- npm run build
470
- # Use `node dist/index.js` instead of `iso27001-mcp` in all commands below
471
- ```
472
-
473
- ---
474
-
475
- ## Tools Reference
476
-
477
- The server exposes **63 tools** across 14 groups. All tools require a valid API key. The minimum role required is noted per group; `✅` marks required parameters, `—` marks optional ones.
478
-
479
- ---
480
-
481
- ### Group 1 — Control Registry *(minimum role: viewer)*
482
-
483
- #### `get_control`
484
- Fetch a single control by ID and version.
485
-
486
- | Parameter | Req | Type | Values / Notes |
487
- |-----------|-----|------|----------------|
488
- | `control_id` | ✅ | string | e.g. `5.1`, `A.8.1` |
489
- | `version` | — | enum | `2022` \| `2013` |
490
-
491
- #### `list_controls`
492
- List controls with optional filters.
493
-
494
- | Parameter | Req | Type | Values / Notes |
495
- |-----------|-----|------|----------------|
496
- | `version` | — | enum | `2022` \| `2013` |
497
- | `theme` | — | string | e.g. `Technological` |
498
- | `control_type` | — | enum | `Preventive` \| `Detective` \| `Corrective` |
499
- | `new_in_2022` | — | boolean | Filter to controls added in the 2022 revision |
500
- | `cybersecurity_concept` | — | enum | `Identify` \| `Protect` \| `Detect` \| `Respond` \| `Recover` |
501
- | `include_guidance` | — | boolean | Default: `false` |
502
- | `limit` | — | integer | Default: `50`, max `100` |
503
- | `offset` | — | integer | Default: `0` |
504
-
505
- #### `search_controls`
506
- Full-text search across control names, descriptions, and guidance (FTS5).
507
-
508
- | Parameter | Req | Type | Values / Notes |
509
- |-----------|-----|------|----------------|
510
- | `query` | ✅ | string | Search terms |
511
- | `version` | — | enum | `2022` \| `2013` |
512
- | `limit` | — | integer | Default: `10`, max `50` |
513
- | `offset` | — | integer | Default: `0` |
514
-
515
- #### `get_control_attributes`
516
- Retrieve 2022 attribute taxonomy (cybersecurity concepts, operational capabilities) for a control.
517
-
518
- | Parameter | Req | Type | Values / Notes |
519
- |-----------|-----|------|----------------|
520
- | `control_id` | ✅ | string | 2022 control ID |
521
-
522
- #### `compare_versions`
523
- Show the mapping between a 2013 control and its 2022 equivalent. Provide at least one ID.
524
-
525
- | Parameter | Req | Type | Values / Notes |
526
- |-----------|-----|------|----------------|
527
- | `v2013_id` | — | string | ISO 27001:2013 control ID |
528
- | `v2022_id` | — | string | ISO 27001:2022 control ID |
529
-
530
- #### `get_clause_requirement`
531
- Fetch a clause requirement (clauses 4–10) with optional sub-clauses.
532
-
533
- | Parameter | Req | Type | Values / Notes |
534
- |-----------|-----|------|----------------|
535
- | `clause_id` | ✅ | string | e.g. `4.1`, `9.2` |
536
- | `include_sub_clauses` | — | boolean | Default: `false` |
537
-
538
- #### `list_clause_requirements`
539
- List all clause requirements, optionally filtered by parent.
540
-
541
- | Parameter | Req | Type | Values / Notes |
542
- |-----------|-----|------|----------------|
543
- | `parent_id` | — | string | e.g. `9` to list all sub-clauses of clause 9 |
544
-
545
- ---
546
-
547
- ### Group 2 — Gap Analysis *(reads: viewer+, writes: analyst+)*
548
-
549
- #### `create_gap_assessment`
550
- Create a new gap assessment. Pre-populates all in-scope controls as `not_started`.
551
-
552
- | Parameter | Req | Type | Values / Notes |
553
- |-----------|-----|------|----------------|
554
- | `name` | ✅ | string | Assessment name |
555
- | `scope` | — | string | ISMS scope description |
556
- | `isms_version` | — | enum | `2022` \| `2013` — default: `2022` |
557
- | `themes_in_scope` | — | array | e.g. `["Organizational","Technological"]` |
558
- | `exclude_controls` | — | array | Control IDs to exclude |
559
- | `exclude_justification` | — | string | Reason for exclusions |
560
-
561
- #### `update_control_status`
562
- Set a control's implementation status within an assessment.
563
-
564
- | Parameter | Req | Type | Values / Notes |
565
- |-----------|-----|------|----------------|
566
- | `assessment_id` | ✅ | string (UUID) | |
567
- | `control_id` | ✅ | string | |
568
- | `status` | ✅ | enum | `implemented` \| `partial` \| `not_implemented` \| `na` \| `not_started` |
569
- | `evidence_refs` | — | array | Evidence UUIDs |
570
- | `notes` | — | string | Implementation notes |
571
- | `na_justification` | — | string | Required when `status=na` |
572
- | `assessed_by` | — | string | Assessor name |
573
-
574
- #### `get_gap_summary`
575
- Return compliance %, counts by status, and a top-10 remediation priority list.
576
-
577
- | Parameter | Req | Type | Values / Notes |
578
- |-----------|-----|------|----------------|
579
- | `assessment_id` | ✅ | string (UUID) | |
580
- | `breakdown_by` | — | enum | `theme` \| `control_type` \| `cybersecurity_concept` |
581
-
582
- #### `list_gap_assessments`
583
- List assessments with a status filter.
584
-
585
- | Parameter | Req | Type | Values / Notes |
586
- |-----------|-----|------|----------------|
587
- | `filter` | — | enum | `active` \| `archived` \| `all` — default: `active` |
588
-
589
- #### `export_gap_report`
590
- Export a full gap report.
591
-
592
- | Parameter | Req | Type | Values / Notes |
593
- |-----------|-----|------|----------------|
594
- | `assessment_id` | ✅ | string (UUID) | |
595
- | `format` | ✅ | enum | `markdown` \| `csv` \| `json` |
596
-
597
- #### `generate_remediation_roadmap`
598
- Generate a prioritised remediation roadmap with phases, risk linkage, and due dates.
599
-
600
- | Parameter | Req | Type | Values / Notes |
601
- |-----------|-----|------|----------------|
602
- | `assessment_id` | ✅ | string (UUID) | |
603
- | `timeline_weeks` | — | integer | 1–52, default: `12` |
604
-
605
- #### `archive_gap_assessment`
606
- Archive a completed assessment.
607
-
608
- | Parameter | Req | Type | Values / Notes |
609
- |-----------|-----|------|----------------|
610
- | `assessment_id` | ✅ | string (UUID) | |
611
- | `reason` | — | string | Archival reason |
612
-
613
- ---
614
-
615
- ### Group 3 — Risk Management *(reads: viewer+, writes: analyst+)*
616
-
617
- #### `create_risk`
618
- Register a new risk. `risk_score` is computed automatically as `likelihood × impact`.
619
-
620
- | Parameter | Req | Type | Values / Notes |
621
- |-----------|-----|------|----------------|
622
- | `asset` | ✅ | string | Asset at risk |
623
- | `threat` | ✅ | string | Threat description |
624
- | `vulnerability` | ✅ | string | Vulnerability description |
625
- | `likelihood` | ✅ | integer | 1–5 |
626
- | `impact` | ✅ | integer | 1–5 |
627
- | `owner` | — | string | Risk owner |
628
- | `related_controls` | — | array | Control IDs |
629
- | `status` | — | enum | `open` \| `accepted` \| `mitigated` \| `transferred` \| `closed` — default: `open` |
630
-
631
- #### `get_risk`
632
- Fetch a risk record with optional treatment plans.
633
-
634
- | Parameter | Req | Type | Values / Notes |
635
- |-----------|-----|------|----------------|
636
- | `risk_id` | ✅ | string (UUID) | |
637
- | `include_treatments` | — | boolean | Default: `false` |
638
-
639
- #### `update_risk`
640
- Update any mutable field; `risk_score` recomputes automatically.
641
-
642
- | Parameter | Req | Type | Values / Notes |
643
- |-----------|-----|------|----------------|
644
- | `risk_id` | ✅ | string (UUID) | |
645
- | `asset` | — | string | |
646
- | `threat` | — | string | |
647
- | `vulnerability` | — | string | |
648
- | `likelihood` | — | integer | 1–5 |
649
- | `impact` | — | integer | 1–5 |
650
- | `owner` | — | string | |
651
- | `status` | — | enum | `open` \| `accepted` \| `mitigated` \| `transferred` \| `closed` |
652
- | `related_controls` | — | array | Control IDs |
653
-
654
- #### `list_risks`
655
- List risks with optional filters.
656
-
657
- | Parameter | Req | Type | Values / Notes |
658
- |-----------|-----|------|----------------|
659
- | `risk_level` | — | enum | `Low` \| `Medium` \| `High` \| `Critical` |
660
- | `status` | — | enum | `open` \| `accepted` \| `mitigated` \| `transferred` \| `closed` |
661
- | `owner` | — | string | |
662
- | `limit` | — | integer | Default: `50`, max `100` |
663
- | `offset` | — | integer | Default: `0` |
664
-
665
- #### `get_risk_summary`
666
- Return aggregated stats: counts by level, 5×5 heatmap matrix, top 10 by score. No parameters.
667
-
668
- #### `create_treatment_plan`
669
- Create a risk treatment plan. `mitigate` type requires at least one control reference.
670
-
671
- | Parameter | Req | Type | Values / Notes |
672
- |-----------|-----|------|----------------|
673
- | `risk_id` | ✅ | string (UUID) | |
674
- | `treatment_type` | ✅ | enum | `mitigate` \| `accept` \| `avoid` \| `transfer` |
675
- | `description` | ✅ | string | |
676
- | `owner` | ✅ | string | |
677
- | `due_date` | ✅ | string | `YYYY-MM-DD` |
678
- | `controls` | — | array | Required for `mitigate` type |
679
- | `residual_likelihood` | — | integer | 1–5 |
680
- | `residual_impact` | — | integer | 1–5 |
681
- | `evidence_ref` | — | string | |
682
-
683
- #### `update_treatment_status`
684
- Update a treatment plan's status and link evidence.
685
-
686
- | Parameter | Req | Type | Values / Notes |
687
- |-----------|-----|------|----------------|
688
- | `treatment_id` | ✅ | string (UUID) | |
689
- | `status` | ✅ | enum | `planned` \| `in_progress` \| `implemented` \| `verified` \| `cancelled` |
690
- | `evidence_ref` | — | string | |
691
- | `residual_likelihood` | — | integer | 1–5 |
692
- | `residual_impact` | — | integer | 1–5 |
693
-
694
- #### `generate_risk_register`
695
- Export the full risk register.
696
-
697
- | Parameter | Req | Type | Values / Notes |
698
- |-----------|-----|------|----------------|
699
- | `format` | ✅ | enum | `markdown` \| `csv` \| `json` |
700
- | `risk_level_filter` | — | enum | `Low` \| `Medium` \| `High` \| `Critical` |
701
- | `status_filter` | — | enum | `open` \| `accepted` \| `mitigated` \| `transferred` \| `closed` |
702
-
703
- ---
704
-
705
- ### Group 4 — Policy Management *(reads: viewer+, create: analyst+, update: admin)*
706
-
707
- #### `create_policy`
708
- Render a policy from a Mustache template with org-specific variables.
709
-
710
- | Parameter | Req | Type | Values / Notes |
711
- |-----------|-----|------|----------------|
712
- | `type` | ✅ | enum | `information_security` \| `access_control` \| `risk_management` \| `asset_management` \| `incident_response` \| `business_continuity` \| `supplier_security` \| `cryptography` \| `physical_security` \| `acceptable_use` \| `data_classification` \| `secure_development` |
713
- | `organisation_name` | — | string | Auto-injected from org profile if set |
714
- | `scope` | — | string | Auto-injected from org profile if set |
715
- | `owner` | ✅ | string | |
716
- | `approver` | — | string | |
717
- | `review_cycle_months` | — | integer | 1–36, default: `12` |
718
- | `effective_date` | ✅ | string | `YYYY-MM-DD` |
719
-
720
- #### `get_policy`
721
- Fetch a policy with optional version history.
722
-
723
- | Parameter | Req | Type | Values / Notes |
724
- |-----------|-----|------|----------------|
725
- | `policy_id` | ✅ | string (UUID) | |
726
- | `include_versions` | — | boolean | Default: `false` |
727
-
728
- #### `update_policy`
729
- Archive the current version and create a new one. Admin only.
730
-
731
- | Parameter | Req | Type | Values / Notes |
732
- |-----------|-----|------|----------------|
733
- | `policy_id` | ✅ | string (UUID) | |
734
- | `scope` | — | string | |
735
- | `owner` | — | string | |
736
- | `approver` | — | string | |
737
- | `reviewed_by` | ✅ | string | |
738
- | `change_summary` | ✅ | string | |
739
-
740
- #### `list_policies`
741
- List policies with optional filters.
742
-
743
- | Parameter | Req | Type | Values / Notes |
744
- |-----------|-----|------|----------------|
745
- | `status` | — | enum | `draft` \| `active` \| `archived` |
746
- | `type` | — | enum | Any of the 12 policy types above |
747
- | `owner` | — | string | |
748
- | `overdue_only` | — | boolean | Filter to policies past their review date — default: `false` |
749
- | `limit` | — | integer | Default: `50`, max `100` |
750
- | `offset` | — | integer | Default: `0` |
751
-
752
- ---
753
-
754
- ### Group 5 — Statement of Applicability *(minimum role: analyst)*
755
-
756
- #### `generate_soa`
757
- Create an SoA from an assessment, pre-populating all 93 (2022) or 114 (2013) entries.
758
-
759
- | Parameter | Req | Type | Values / Notes |
760
- |-----------|-----|------|----------------|
761
- | `assessment_id` | ✅ | string (UUID) | |
762
- | `isms_version` | — | enum | `2022` \| `2013` — default: `2022` |
763
-
764
- #### `update_soa_entry`
765
- Update a single SoA entry's inclusion, justification, status, and responsible party.
766
-
767
- | Parameter | Req | Type | Values / Notes |
768
- |-----------|-----|------|----------------|
769
- | `soa_id` | ✅ | string (UUID) | |
770
- | `control_id` | ✅ | string | |
771
- | `included` | ✅ | boolean | |
772
- | `justification` | ✅ | string | |
773
- | `status` | — | enum | `implemented` \| `partial` \| `not_implemented` \| `na` \| `not_started` |
774
- | `responsible_party` | — | string | |
775
-
776
- #### `export_soa`
777
- Export the Statement of Applicability.
778
-
779
- | Parameter | Req | Type | Values / Notes |
780
- |-----------|-----|------|----------------|
781
- | `soa_id` | ✅ | string (UUID) | |
782
- | `format` | ✅ | enum | `markdown` \| `csv` |
783
-
784
- ---
785
-
786
- ### Group 6 — Audit Management *(reads: viewer+, writes: admin)*
787
-
788
- #### `create_audit`
789
- Create an internal audit with auditor, planned date, and scope.
790
-
791
- | Parameter | Req | Type | Values / Notes |
792
- |-----------|-----|------|----------------|
793
- | `name` | ✅ | string | Audit name |
794
- | `scope` | ✅ | string | |
795
- | `auditor` | ✅ | string | |
796
- | `planned_date` | ✅ | string | `YYYY-MM-DD` |
797
- | `controls_in_scope` | — | array | Control IDs |
798
- | `clauses_in_scope` | — | array | Clause IDs |
799
-
800
- #### `record_finding`
801
- Record a finding. Non-conformities (`nc`) require a severity.
802
-
803
- | Parameter | Req | Type | Values / Notes |
804
- |-----------|-----|------|----------------|
805
- | `audit_id` | ✅ | string (UUID) | |
806
- | `type` | ✅ | enum | `nc` \| `obs` \| `ofi` |
807
- | `clause_or_control` | ✅ | string | |
808
- | `description` | ✅ | string | |
809
- | `objective_evidence` | ✅ | string | |
810
- | `severity` | — | enum | `major` \| `minor` — required for `type=nc` |
811
-
812
- #### `create_corrective_action`
813
- Raise a Corrective Action Request (CAR) linked to a finding.
814
-
815
- | Parameter | Req | Type | Values / Notes |
816
- |-----------|-----|------|----------------|
817
- | `finding_id` | ✅ | string (UUID) | |
818
- | `description` | ✅ | string | |
819
- | `owner` | ✅ | string | |
820
- | `due_date` | ✅ | string | `YYYY-MM-DD` |
821
- | `root_cause` | — | string | |
822
-
823
- #### `update_corrective_action`
824
- Update CAR status. Closing (`status=closed`) requires `effectiveness_verified: true` (ISO 27001 Clause 10.1).
825
-
826
- | Parameter | Req | Type | Values / Notes |
827
- |-----------|-----|------|----------------|
828
- | `car_id` | ✅ | string (UUID) | |
829
- | `description` | — | string | |
830
- | `owner` | — | string | |
831
- | `due_date` | — | string | `YYYY-MM-DD` |
832
- | `status` | — | enum | `open` \| `in_progress` \| `implemented` \| `verified` \| `closed` |
833
- | `root_cause` | — | string | |
834
- | `effectiveness_verified` | — | boolean | Must be `true` to close the CAR |
835
- | `evidence_ref` | — | string | |
836
-
837
- #### `generate_audit_report`
838
- Export a full audit report (executive summary, findings, CARs).
839
-
840
- | Parameter | Req | Type | Values / Notes |
841
- |-----------|-----|------|----------------|
842
- | `audit_id` | ✅ | string (UUID) | |
843
- | `format` | ✅ | enum | `markdown` \| `json` |
844
-
845
- ---
846
-
847
- ### Group 7 — Evidence Tracking *(reads: viewer+, writes: analyst+)*
848
-
849
- #### `register_evidence`
850
- Register an evidence artefact for a control.
851
-
852
- | Parameter | Req | Type | Values / Notes |
853
- |-----------|-----|------|----------------|
854
- | `control_id` | ✅ | string | |
855
- | `type` | ✅ | enum | `policy` \| `procedure` \| `log` \| `screenshot` \| `report` \| `certificate` \| `configuration` \| `meeting_minutes` \| `training_record` \| `contract` \| `audit_report` \| `test_result` \| `ticket` \| `other` |
856
- | `description` | ✅ | string | |
857
- | `source_url` | — | string | URL to the artefact |
858
- | `collected_by` | ✅ | string | |
859
- | `collected_date` | ✅ | string | `YYYY-MM-DD` |
860
- | `expiry_date` | — | string | `YYYY-MM-DD` |
861
-
862
- #### `list_evidence`
863
- List evidence for a control, optionally filtered by currency.
864
-
865
- | Parameter | Req | Type | Values / Notes |
866
- |-----------|-----|------|----------------|
867
- | `control_id` | ✅ | string | |
868
- | `status` | — | enum | `current` \| `stale` \| `expired` |
869
-
870
- #### `get_evidence_gaps`
871
- Find controls marked `implemented` or `partial` that have no current evidence.
872
-
873
- | Parameter | Req | Type | Values / Notes |
874
- |-----------|-----|------|----------------|
875
- | `assessment_id` | ✅ | string (UUID) | |
876
-
877
- #### `link_jira_ticket`
878
- Link evidence to an existing Jira issue (`jira_key`) or create a new one (`summary`). Provide at least one.
879
-
880
- | Parameter | Req | Type | Values / Notes |
881
- |-----------|-----|------|----------------|
882
- | `evidence_id` | ✅ | string (UUID) | |
883
- | `jira_key` | — | string | e.g. `ISMS-42` — links to existing issue |
884
- | `summary` | — | string | Creates a new Jira task with this title |
885
- | `description` | — | string | Body for the new issue |
886
-
887
- #### `link_github_issue`
888
- Link evidence to an existing GitHub issue (`issue_number`) or create a new one (`title`). Provide at least one.
889
-
890
- | Parameter | Req | Type | Values / Notes |
891
- |-----------|-----|------|----------------|
892
- | `evidence_id` | ✅ | string (UUID) | |
893
- | `issue_number` | — | integer | Links to an existing issue |
894
- | `title` | — | string | Creates a new issue with this title |
895
- | `body` | — | string | Body for the new issue |
896
-
897
- ---
898
-
899
- ### Group 8 — Server Info *(minimum role: viewer)*
900
-
901
- #### `get_server_info`
902
- Return version, uptime, DB stats, control counts, and rate limit config. No parameters.
903
-
904
- ---
905
-
906
- ### Group 9 — Admin & Key Management *(minimum role: admin)*
907
-
908
- #### `query_audit_log`
909
- Query the tamper-evident audit log.
910
-
911
- | Parameter | Req | Type | Values / Notes |
912
- |-----------|-----|------|----------------|
913
- | `start_date` | — | string | `YYYY-MM-DD` |
914
- | `end_date` | — | string | `YYYY-MM-DD` |
915
- | `tool` | — | string | Filter by tool name |
916
- | `outcome` | — | enum | `success` \| `denied` \| `error` |
917
- | `role` | — | enum | `viewer` \| `analyst` \| `admin` |
918
- | `key_hash` | — | string | Filter by API key hash (max 64 chars) |
919
- | `limit` | — | integer | Default: `50`, max `100` |
920
- | `offset` | — | integer | Default: `0` |
921
-
922
- #### `list_api_keys`
923
- List all API keys with metadata. Never returns key hashes. No parameters.
924
-
925
- #### `revoke_api_key`
926
- Immediately revoke a key by label.
927
-
928
- | Parameter | Req | Type | Values / Notes |
929
- |-----------|-----|------|----------------|
930
- | `label` | ✅ | string | The label assigned at key generation |
931
-
932
- ---
933
-
934
- ### Group 10 — Organisation Profile *(minimum role: admin for writes, viewer for reads)*
935
-
936
- #### `set_organization_profile`
937
- Upsert the singleton organisation profile. Used to auto-inject `organisation_name` and `scope` into `create_policy` and `create_procedure`.
938
-
939
- | Parameter | Req | Type | Values / Notes |
940
- |-----------|-----|------|----------------|
941
- | `legal_entity_name` | ✅ | string | Registered legal name |
942
- | `registered_jurisdiction` | ✅ | string | e.g. `England and Wales` |
943
- | `in_scope_activities` | ✅ | string | Activities within ISMS scope |
944
- | `isms_scope_statement` | ✅ | string | Formal scope statement (used as `scope` default) |
945
- | `regulatory_licences` | — | array | Applicable licences or regulations |
946
- | `declared_exclusions` | — | string | Out-of-scope exclusions and justifications |
947
- | `raci_roles` | — | object | Keys: `ciso`, `dpo`, `data_owner`, `isms_manager`, `internal_auditor` |
948
- | `review_cadence_months` | — | integer | Default: `12` |
949
-
950
- #### `get_organization_profile`
951
- Retrieve the singleton organisation profile. Returns `{ profile: null }` if not yet set. No parameters.
952
-
953
- ---
954
-
955
- ### Group 11 — Procedure Management *(reads: viewer+, create/export: analyst+, update: admin)*
956
-
957
- #### `create_procedure`
958
- Render a procedure from a Mustache template and store it in the database.
959
-
960
- | Parameter | Req | Type | Values / Notes |
961
- |-----------|-----|------|----------------|
962
- | `type` | ✅ | enum | `incident_handling` \| `access_provisioning` \| `asset_onboarding_offboarding` \| `audit_log_review` \| `backup_restore` \| `bcp_testing` \| `change_management` \| `cryptographic_key_management` \| `data_classification_handling` \| `secure_development_workflow` \| `supplier_onboarding` \| `vulnerability_management` |
963
- | `owner` | ✅ | string | |
964
- | `effective_date` | ✅ | string | `YYYY-MM-DD` |
965
- | `organisation_name` | — | string | Auto-injected from org profile if set |
966
- | `scope` | — | string | Auto-injected from org profile if set |
967
- | `approver` | — | string | Defaults to `TBD` |
968
- | `policy_id` | — | string (UUID) | Link to a parent policy (must be active) |
969
- | `related_controls` | — | array | Control IDs |
970
- | `review_cycle_months` | — | integer | 1–36, default: `12` |
971
-
972
- #### `get_procedure`
973
- Fetch a procedure by ID, optionally including archived version history.
974
-
975
- | Parameter | Req | Type | Values / Notes |
976
- |-----------|-----|------|----------------|
977
- | `procedure_id` | ✅ | string (UUID) | |
978
- | `include_versions` | — | boolean | Default: `false` |
979
-
980
- #### `list_procedures`
981
- List procedures with optional filters, sorted by upcoming review date.
982
-
983
- | Parameter | Req | Type | Values / Notes |
984
- |-----------|-----|------|----------------|
985
- | `procedure_type` | — | enum | Any of the 12 procedure types above |
986
- | `status` | — | enum | `draft` \| `active` \| `archived` |
987
- | `policy_id` | — | string (UUID) | Filter to procedures linked to a specific policy |
988
- | `overdue_only` | — | boolean | Filter to active procedures past their review date — default: `false` |
989
- | `limit` | — | integer | Default: `50`, max `100` |
990
- | `offset` | — | integer | Default: `0` |
991
-
992
- #### `update_procedure`
993
- Archive the current version and re-render with updated fields. Admin only.
994
-
995
- | Parameter | Req | Type | Values / Notes |
996
- |-----------|-----|------|----------------|
997
- | `procedure_id` | ✅ | string (UUID) | |
998
- | `reviewed_by` | ✅ | string | |
999
- | `change_summary` | ✅ | string | |
1000
- | `scope` | — | string | |
1001
- | `owner` | — | string | |
1002
- | `approver` | — | string | |
1003
- | `related_controls` | — | array | Control IDs |
1004
-
1005
- #### `export_procedure`
1006
- Export a procedure as Markdown or JSON.
1007
-
1008
- | Parameter | Req | Type | Values / Notes |
1009
- |-----------|-----|------|----------------|
1010
- | `procedure_id` | ✅ | string (UUID) | |
1011
- | `format` | ✅ | enum | `markdown` \| `json` |
1012
-
1013
- ---
1014
-
1015
- ### Group 12 — Management Review *(reads: viewer+, writes: admin)* — Clause 9.3
1016
-
1017
- #### `create_management_review`
1018
- Schedule a management review meeting.
1019
-
1020
- | Parameter | Req | Type | Values / Notes |
1021
- |-----------|-----|------|----------------|
1022
- | `title` | ✅ | string | Review title |
1023
- | `review_date` | ✅ | string | `YYYY-MM-DD` |
1024
- | `chair` | ✅ | string | Review chair / CISO name |
1025
- | `attendees` | — | array | List of attendee names |
1026
- | `agenda` | — | string | Meeting agenda |
1027
-
1028
- #### `record_review_input`
1029
- Record an input item to a management review (e.g. audit results, risk summary, performance metrics).
1030
-
1031
- | Parameter | Req | Type | Values / Notes |
1032
- |-----------|-----|------|----------------|
1033
- | `review_id` | ✅ | string (UUID) | |
1034
- | `input_type` | ✅ | enum | `audit_results` \| `risk_summary` \| `objective_performance` \| `nonconformities` \| `previous_actions` \| `changes` \| `resources` \| `stakeholder_feedback` \| `other` |
1035
- | `summary` | ✅ | string | |
1036
- | `detail` | — | string | Supporting detail |
1037
-
1038
- #### `record_review_output`
1039
- Record a decision or action item from a management review.
1040
-
1041
- | Parameter | Req | Type | Values / Notes |
1042
- |-----------|-----|------|----------------|
1043
- | `review_id` | ✅ | string (UUID) | |
1044
- | `output_type` | ✅ | enum | `improvement_opportunity` \| `resource_decision` \| `policy_change` \| `objective_change` \| `other` |
1045
- | `description` | ✅ | string | |
1046
- | `owner` | — | string | |
1047
- | `due_date` | — | string | `YYYY-MM-DD` |
1048
-
1049
- #### `complete_management_review`
1050
- Mark a management review as complete and record the outcome.
1051
-
1052
- | Parameter | Req | Type | Values / Notes |
1053
- |-----------|-----|------|----------------|
1054
- | `review_id` | ✅ | string (UUID) | |
1055
- | `outcome_summary` | ✅ | string | |
1056
-
1057
- #### `get_management_review`
1058
- Fetch a management review with all inputs, outputs, and status.
1059
-
1060
- | Parameter | Req | Type | Values / Notes |
1061
- |-----------|-----|------|----------------|
1062
- | `review_id` | ✅ | string (UUID) | |
1063
-
1064
- #### `list_management_reviews`
1065
- List management reviews with optional status filter.
1066
-
1067
- | Parameter | Req | Type | Values / Notes |
1068
- |-----------|-----|------|----------------|
1069
- | `status` | — | enum | `scheduled` \| `in_progress` \| `completed` |
1070
- | `limit` | — | integer | Default: `20`, max `100` |
1071
- | `offset` | — | integer | Default: `0` |
1072
-
1073
- ---
1074
-
1075
- ### Group 13 — Improvement Plan *(reads: viewer+, writes: analyst+)* — Clause 10.1
1076
-
1077
- #### `create_improvement_opportunity`
1078
- Register an improvement opportunity, typically identified during a management review or audit.
1079
-
1080
- | Parameter | Req | Type | Values / Notes |
1081
- |-----------|-----|------|----------------|
1082
- | `title` | ✅ | string | |
1083
- | `description` | ✅ | string | |
1084
- | `source` | ✅ | enum | `audit` \| `management_review` \| `incident` \| `risk_assessment` \| `self_assessment` \| `other` |
1085
- | `priority` | — | enum | `low` \| `medium` \| `high` \| `critical` — default: `medium` |
1086
- | `owner` | — | string | |
1087
- | `due_date` | — | string | `YYYY-MM-DD` |
1088
- | `related_controls` | — | array | Control IDs |
1089
- | `review_id` | — | string (UUID) | Link to a management review output |
1090
-
1091
- #### `update_improvement_opportunity`
1092
- Update the status, owner, or due date of an improvement opportunity.
1093
-
1094
- | Parameter | Req | Type | Values / Notes |
1095
- |-----------|-----|------|----------------|
1096
- | `opportunity_id` | ✅ | string (UUID) | |
1097
- | `status` | — | enum | `open` \| `in_progress` \| `completed` \| `cancelled` |
1098
- | `owner` | — | string | |
1099
- | `due_date` | — | string | `YYYY-MM-DD` |
1100
- | `resolution_notes` | — | string | Required when closing |
1101
-
1102
- #### `get_improvement_opportunity`
1103
- Fetch a single improvement opportunity by ID.
1104
-
1105
- | Parameter | Req | Type | Values / Notes |
1106
- |-----------|-----|------|----------------|
1107
- | `opportunity_id` | ✅ | string (UUID) | |
1108
-
1109
- #### `list_improvement_opportunities`
1110
- List improvement opportunities with optional filters.
1111
-
1112
- | Parameter | Req | Type | Values / Notes |
1113
- |-----------|-----|------|----------------|
1114
- | `status` | — | enum | `open` \| `in_progress` \| `completed` \| `cancelled` |
1115
- | `priority` | — | enum | `low` \| `medium` \| `high` \| `critical` |
1116
- | `source` | — | enum | Any source enum value above |
1117
- | `limit` | — | integer | Default: `50`, max `100` |
1118
- | `offset` | — | integer | Default: `0` |
1119
-
1120
- ---
1121
-
1122
- ### Group 14 — Evidence Templates *(reads: viewer+, generate: analyst+)*
1123
-
1124
- #### `generate_evidence_document`
1125
- Render a Mustache evidence template and store it. The document is dual-written to both the `evidence` table and the `generated_evidence` table for tracking and version history.
1126
-
1127
- | Parameter | Req | Type | Values / Notes |
1128
- |-----------|-----|------|----------------|
1129
- | `template_type` | ✅ | enum | `access_review_attestation` \| `bcp_test_report` \| `incident_post_mortem` \| `risk_treatment_sign_off` \| `supplier_security_questionnaire` \| `training_acknowledgement` |
1130
- | `title` | ✅ | string | Document title |
1131
- | `generated_by` | ✅ | string | Author or system that generated the document |
1132
- | `organisation_name` | — | string | Auto-injected from org profile if set |
1133
- | `control_id` | — | string | Link to a specific control (default: `general`) |
1134
- | `vars` | — | object | Additional Mustache template variables |
1135
-
1136
- #### `get_evidence_document`
1137
- Fetch a generated evidence document by ID, including rendered content and clause/control mappings.
1138
-
1139
- | Parameter | Req | Type | Values / Notes |
1140
- |-----------|-----|------|----------------|
1141
- | `document_id` | ✅ | string (UUID) | |
1142
-
1143
- #### `list_evidence_documents`
1144
- List generated evidence documents with optional filters.
1145
-
1146
- | Parameter | Req | Type | Values / Notes |
1147
- |-----------|-----|------|----------------|
1148
- | `template_type` | — | enum | Filter to a specific template type |
1149
- | `generated_by` | — | string | Filter by author |
1150
- | `control_id` | — | string | Filter by linked control |
1151
- | `limit` | — | integer | Default: `20`, max `100` |
1152
- | `offset` | — | integer | Default: `0` |
1153
-
1154
- ---
1155
-
1156
- ## MCP Resources
1157
-
1158
- In addition to tools, the server exposes ISMS artefacts as browseable **MCP Resources** under the `iso27001://` URI scheme. Claude can reference these directly without a tool call — ideal for inline document review, cross-referencing controls, and long-context analysis.
1159
-
1160
- Resources are read-only. Write operations always go through tools (which enforce the security pipeline and audit log).
1161
-
1162
- ### Resource URI Scheme
1163
-
1164
- | Resource | URI pattern | Auth |
1165
- |----------|-------------|------|
1166
- | `iso27001-control` | `iso27001://control/{control_id}` | Public |
1167
- | `iso27001-control-versioned` | `iso27001://control/{control_id}/version/{version}` | Public |
1168
- | `iso27001-clause` | `iso27001://clause/{clause_id}` | Public |
1169
- | `iso27001-org-profile` | `iso27001://org/profile` | Viewer |
1170
- | `iso27001-policy` | `iso27001://policy/{policy_id}` | Viewer |
1171
- | `iso27001-policy-versioned` | `iso27001://policy/{policy_id}/version/{n}` | Viewer |
1172
- | `iso27001-procedure` | `iso27001://procedure/{procedure_id}` | Viewer |
1173
- | `iso27001-procedure-versioned` | `iso27001://procedure/{procedure_id}/version/{n}` | Viewer |
1174
- | `iso27001-risk` | `iso27001://risk/{risk_id}` | Viewer |
1175
- | `iso27001-assessment` | `iso27001://assessment/{assessment_id}` | Viewer |
1176
- | `iso27001-soa` | `iso27001://soa/{soa_id}` | Viewer |
1177
- | `iso27001-audit` | `iso27001://audit/{audit_id}` | Viewer |
1178
-
1179
- ### Resource Formats
1180
-
1181
- **Controls and clauses** (`application/json`) — full control record including `control_type`, `attributes`, `related_controls`, and ISO clause refs.
1182
-
1183
- **Policies and procedures** (`text/markdown`) — rendered document body with a YAML frontmatter envelope containing `uri`, `procedure_type` / policy `type`, version, owner, clause and control mappings, and review dates.
1184
-
1185
- **Risks** (`application/json`) — risk record with nested `treatments` array.
1186
-
1187
- **Assessments** (`application/json`) — assessment record with `control_status_summary` (counts by status).
1188
-
1189
- **Statement of Applicability** (`application/json`) — SoA record with nested `entries` array (boolean `included` field).
1190
-
1191
- **Audits** (`application/json`) — audit record with nested `findings` array, each containing its `corrective_actions`.
1192
-
1193
- ### Example
1194
-
1195
- ```
1196
- "Read iso27001://policy/pol-abc123 and compare it against control 5.1."
1197
- "List all open risks from iso27001://risk and summarise which controls are most often cited."
1198
- "Review the SoA at iso27001://soa/soa-xyz789 and identify excluded controls."
1199
- ```
1200
-
1201
- ---
1202
-
1203
- ## Architecture
1204
-
1205
- ```
1206
- ┌─────────────────────────────────────────────────────────┐
1207
- │ Claude (LLM) │
1208
- └──────────┬───────────────────────────────┬──────────────┘
1209
- │ MCP Tools (read/write) │ MCP Resources (read-only)
1210
- │ 63 tools, RBAC enforced │ 12 iso27001:// URIs
1211
- ┌──────────▼───────────────────────────────▼──────────────┐
1212
- │ iso27001-mcp server │
1213
- │ │
1214
- │ ┌─────────────────────────────────────────────────┐ │
1215
- │ │ 7-Step Security Pipeline │ │
1216
- │ │ │ │
1217
- │ │ 1. Extract credential (_meta.apiKey / env) │ │
1218
- │ │ 2. Auth — session token OR validateKey() │ │
1219
- │ │ SSE sessions use opaque token (no raw key) │ │
1220
- │ │ 3. checkRateLimit() sliding 60s window (RPM) │ │
1221
- │ │ 4. assertPermission() RBAC check │ │
1222
- │ │ 5. sanitiseParams() strip injection patterns │ │
1223
- │ │ 6. Domain handler business logic │ │
1224
- │ │ 7. writeAuditEvent() HMAC chain + row_hash │ │
1225
- │ └─────────────────────────────────────────────────┘ │
1226
- │ │
1227
- │ ┌─────────────┐ ┌──────────┐ ┌────────────────────┐ │
1228
- │ │ Controls │ │ Risks │ │ Policies & │ │
1229
- │ │ Gap Assess │ │ Register │ │ Procedures │ │
1230
- │ │ SoA │ │ Treatmts │ │ (Mustache+partls) │ │
1231
- │ └─────────────┘ └──────────┘ └────────────────────┘ │
1232
- │ ┌─────────────┐ ┌──────────┐ ┌────────────────────┐ │
1233
- │ │ Audits │ │ Evidence │ │ Mgmt Review & │ │
1234
- │ │ Findings │ │ Jira/GH │ │ Improvement Plan │ │
1235
- │ │ CARs │ │ Tmplts │ │ (Clauses 9.3/10.1)│ │
1236
- │ └─────────────┘ └──────────┘ └────────────────────┘ │
1237
- │ ┌─────────────────────────────────────────────────┐ │
1238
- │ │ Org Profile · Audit Log (HMAC-SHA256 chain) │ │
1239
- │ │ Session Token Store · API Key RBAC (63 tools) │ │
1240
- │ └─────────────────────────────────────────────────┘ │
1241
- │ │
1242
- │ ┌─────────────────────────────────────────────────┐ │
1243
- │ │ AES-256 encrypted SQLite (isms.db) │ │
1244
- │ │ better-sqlite3-multiple-ciphers │ │
1245
- │ │ WAL mode · foreign keys · FTS5 index │ │
1246
- │ └─────────────────────────────────────────────────┘ │
1247
- └─────────────────────────────────────────────────────────┘
1248
- ```
1249
-
1250
- ### Database
1251
-
1252
- All data is stored in a single encrypted SQLite file (`isms.db`) using AES-256 via `better-sqlite3-multiple-ciphers`. The schema is managed by six SQL migrations applied automatically on first startup:
1253
-
1254
- - `0001_initial.sql` — 17 tables covering every ISMS domain (controls, gap assessments, risks, policies, audits, evidence, API keys, audit log, and more)
1255
- - `0002_fts_index.sql` — FTS5 full-text search index on controls, plus 12 performance indexes
1256
- - `0003_org_profile_procedures.sql` — `organization_profile` singleton table, `procedures` table, and `procedure_versions` history table
1257
- - `0004_management_review_improvement.sql` — `management_reviews`, `review_inputs`, `review_outputs`, and `improvement_opportunities` tables (Clauses 9.3 and 10.1)
1258
- - `0005_evidence_documents.sql` — `generated_evidence` table for Mustache-rendered evidence documents with dual-write to `evidence`
1259
- - `0006_audit_log_hmac.sql` — adds `prev_hash` column to `audit_log` for HMAC chain integrity
1260
-
1261
- ### Seed Data
1262
-
1263
- On first startup, `seedAll()` inserts all ISO 27001 reference data and verifies SHA-256 checksums before inserting:
1264
-
1265
- - **93** ISO 27001:2022 Annex A controls across 4 themes (Organizational, People, Physical, Technological)
1266
- - **114** ISO 27001:2013 controls across 14 Annex A domains
1267
- - **125** version mappings (2013 ↔ 2022), including direct, merged, split, and new_2022 relationships
1268
- - **41** clause requirements for clauses 4–10 with sub-clauses, requirement text, and implementation notes
1269
-
1270
- ### Security Pipeline
1271
-
1272
- Every tool call passes through the same 7-step pipeline before any business logic runs. SSE sessions use an opaque session token so the raw API key is never retained in server memory after the initial `/sse` handshake. Audit events are always written — including on authentication failure and RBAC denial — so the log is a complete record of all attempts, not just successful ones.
1273
-
1274
- ### Business Rules Enforced
1275
-
1276
- The server encodes ISO 27001 requirements as hard constraints, not just guidance:
1277
-
1278
- | Rule | Tool | Behaviour |
1279
- |------|------|-----------|
1280
- | `implemented` without evidence → silently downgraded | `update_control_status` | Status becomes `partial`; response includes `warning` field |
1281
- | `na` status requires justification | `update_control_status` | `BUSINESS_RULE` error if `na_justification` absent |
1282
- | Cannot update an archived assessment | `update_control_status` | `BUSINESS_RULE` error |
1283
- | `mitigate` treatment requires control references | `create_treatment_plan` | `BUSINESS_RULE` error if `controls[]` is empty |
1284
- | CAR closure requires effectiveness verified | `update_corrective_action` | Enforces Clause 10.1; `BUSINESS_RULE` error otherwise |
1285
- | NC findings require severity | `record_finding` | `BUSINESS_RULE` error if `severity` absent for `type=nc` |
1286
-
1287
- ### RBAC
1288
-
1289
- Three roles with strict hierarchy. A key can only call tools at or below its assigned role level.
1290
-
1291
- | Role | Tools available | Typical user |
1292
- |------|----------------|--------------|
1293
- | `viewer` | 31 (all read-only tools) | Auditor, stakeholder |
1294
- | `analyst` | 49 (reads + gap/risk/policy/procedure/evidence/improvement writes) | ISMS practitioner, consultant |
1295
- | `admin` | 63 (all tools, including org profile, audit management, audit log and key management) | CISO, ISMS owner |
1296
-
1297
- ---
1298
-
1299
- ## Modes
1300
-
1301
- The server supports four operating modes selected with the `--mode` flag:
1302
-
1303
- | Mode | Transport | Typical use |
1304
- |------|-----------|-------------|
1305
- | `local` *(default)* | stdio | Claude Desktop, single user |
1306
- | `ci` | stdio | Automated pipelines, no TTY |
1307
- | `team` | SSE over HTTP | Shared instance, multiple users |
1308
- | `hosted` | SSE over HTTP | Production, behind a TLS proxy |
1309
-
1310
- ### Local / CI (stdio)
1311
-
1312
- ```bash
1313
- iso27001-mcp --mode local --db ./isms.db
1314
- ```
1315
-
1316
- Claude Desktop manages the process. The server reads from stdin and writes to stdout.
1317
-
1318
- ### Team / Hosted (SSE)
1319
-
1320
- ```bash
1321
- iso27001-mcp --mode hosted --db /data/isms.db
1322
- ```
1323
-
1324
- Starts an Express HTTP server on `SSE_PORT` (default `3000`):
1325
-
1326
- | Endpoint | Description |
1327
- |----------|-------------|
1328
- | `GET /health` | Health check — no auth required |
1329
- | `GET /sse` | Open SSE connection; first event contains `{ type: "session", sessionId }` |
1330
- | `POST /messages?sessionId=X` | Send an MCP message on an active session |
1331
-
1332
- Sessions expire after `SESSION_TTL_HOURS` hours of inactivity. In `NODE_ENV=production`, CORS is restricted to `https://claude.ai` and `/messages` is rate-limited to 100 requests per minute per IP.
1333
-
1334
- ---
1335
-
1336
- ## Sample Outputs
1337
-
1338
- The [`samples/`](samples/) directory contains auditor-ready example outputs generated from a demo ISMS for a fictitious organisation ("Acme Financial Services Ltd" — a UK payments processor preparing for ISO 27001:2022 certification). Each file states which tool(s) produced it.
1339
-
1340
- | Sample | Description |
1341
- |--------|-------------|
1342
- | [gap-assessment-summary.md](samples/gap-assessment-summary.md) | Complete gap assessment across all 93 controls |
1343
- | [remediation-roadmap.md](samples/remediation-roadmap.md) | 26-week prioritised remediation plan with owners and effort estimates |
1344
- | [risk-register.csv](samples/risk-register.csv) | Risk register with 10 risks, scores, and treatment plans |
1345
- | [statement-of-applicability.csv](samples/statement-of-applicability.csv) | Full SoA — all 93 ISO 27001:2022 controls with applicability justifications |
1346
- | [access-control-policy.md](samples/access-control-policy.md) | Generated access control policy (Annex A 5.15–5.18, 8.2–8.5) |
1347
- | [incident-handling-procedure.md](samples/incident-handling-procedure.md) | Incident handling procedure with severity tiers and GDPR notification |
1348
- | [internal-audit-report.md](samples/internal-audit-report.md) | Internal audit report — 3 major NCs, 4 minor NCs, 2 positive observations |
1349
- | [corrective-action-record.md](samples/corrective-action-record.md) | Two corrective action records: one in progress, one closed and verified |
1350
- | [evidence-package.md](samples/evidence-package.md) | 47-item evidence inventory with 28-control gap analysis |
1351
-
1352
- ---
1353
-
1354
- ## Integrations
1355
-
1356
- ### Jira
1357
-
1358
- ```bash
1359
- JIRA_BASE_URL=https://your-org.atlassian.net
1360
- JIRA_API_TOKEN=your_api_token
1361
- JIRA_PROJECT_KEY=SEC
1362
- JIRA_USER_EMAIL=you@your-org.com
1363
- ```
1364
-
1365
- Use `link_jira_ticket` to create a Task in your Jira project or link an existing one. The Jira key and browse URL are stored on the evidence record. Requests time out after 10 seconds and retry once on 5xx responses. A clear `INTEGRATION_ERROR` is returned — with the exact missing variable names — if credentials are not configured.
1366
-
1367
- ### GitHub
1368
-
1369
- ```bash
1370
- GITHUB_TOKEN=ghp_your_token # requires issues:write, metadata:read
1371
- GITHUB_REPO=your-org/your-repo
1372
- ```
1373
-
1374
- Use `link_github_issue` to create an issue with `compliance` and `iso27001` labels or link an existing one by number. The issue URL and number are stored on the evidence record.
1375
-
1376
- ---
1377
-
1378
- ## Roadmap
1379
-
1380
- The following features are planned or under consideration. Contributions welcome — see [Contributing](#contributing).
1381
-
1382
- ### Near-term (next 1–2 releases)
1383
-
1384
- - **ISO 27001:2022 ↔ SOC 2 control mapping** — show which ISO 27001 controls satisfy which SOC 2 Trust Services Criteria
1385
- - **Evidence expiry alerts** — surface evidence artefacts approaching their `expiry_date` in gap summaries and audit reports
1386
- - **Bulk control status import** — accept a CSV to batch-update control statuses in a gap assessment
1387
- - **HTML export** — add `html` as an export format for gap reports, SoA, and the risk register
1388
-
1389
- ### Medium-term
1390
-
1391
- - **ISO 27001:2022 ↔ NIST CSF 2.0 mapping** — cross-reference controls to NIST Cybersecurity Framework 2.0 functions and categories
1392
- - **PostgreSQL backend** — optional PostgreSQL transport via a pluggable DB adapter (SQLite stays default for local use)
1393
- - **Supplier risk register** — track third-party suppliers against ISO 27001 Annex A 5.19–5.22 controls
1394
- - **Multi-ISMS support** — scope-isolated tenants sharing a single server instance (hosted mode)
1395
-
1396
- ### Under consideration
1397
-
1398
- - GDPR Article 30 RoPA generation linked to the risk register
1399
- - NIS2 control mapping
1400
- - Automated evidence collection via API integrations (AWS Config, GitHub Security Advisories, etc.)
1401
-
1402
- ---
1403
-
1404
- ## Development
1405
-
1406
- ```bash
1407
- # Install dependencies
1408
- npm install
1409
-
1410
- # Typecheck (strict — zero errors tolerated)
1411
- npm run typecheck
1412
-
1413
- # Build dist/
1414
- npm run build
1415
-
1416
- # Run all tests (470 unit + integration tests)
1417
- npm test
1418
-
1419
- # Watch mode
1420
- npm run test:watch
1421
-
1422
- # Lint
1423
- npm run lint
1424
-
1425
- # Verify seed data SHA-256 checksums
1426
- npm run verify-checksums
1427
-
1428
- # Run from source without building
1429
- npm run dev
1430
- ```
1431
-
1432
- ### Project Structure
1433
-
1434
- ```
1435
- src/
1436
- ├── index.ts CLI entry (init, doctor, keygen, keys, server startup)
1437
- ├── server.ts McpServer factory — registers tools + resources
1438
- ├── cli/
1439
- │ ├── init.ts Interactive setup wizard (iso27001-mcp init)
1440
- │ ├── doctor.ts 10-check health report (iso27001-mcp doctor)
1441
- │ ├── prompt.ts Lazy readline wrapper — ask, confirm, banner, check
1442
- │ └── claude-config.ts Claude Desktop config detection + entry builder
1443
- ├── auth/
1444
- │ ├── api-key.ts Key generation, HMAC validation, expiry, revocation
1445
- │ ├── rbac.ts Permission matrix (63 tools × 3 roles)
1446
- │ └── session-store.ts SSE session token store (opaque token → keyHash + role)
1447
- ├── security/
1448
- │ ├── sanitise.ts Prompt-injection stripping for free-text fields
1449
- │ ├── rate-limiter.ts Sliding-window RPM counter per key hash
1450
- │ ├── secrets.ts Env var validation (fail-fast on startup)
1451
- │ └── validate.ts Zod schemas for all 63 tool inputs
1452
- ├── audit/
1453
- │ └── logger.ts Tamper-evident audit event writer
1454
- ├── db/
1455
- │ ├── connection.ts Encrypted SQLite open/close/migrate
1456
- │ ├── dal.ts Shared helpers: newId, now, toJson, fromJsonArray, computeEvidenceStatus
1457
- │ └── migrations/ 0001_initial.sql through 0006_audit_log_hmac.sql
1458
- ├── seed/
1459
- │ ├── seeder.ts Idempotent seed runner with checksum verification
1460
- │ ├── controls-2022.json 93 ISO 27001:2022 Annex A controls
1461
- │ ├── controls-2013.json 114 ISO 27001:2013 controls
1462
- │ ├── version-mapping.json 125 cross-version mappings
1463
- │ ├── clause-requirements.json 41 clause requirements (clauses 4–10)
1464
- │ ├── policy-templates/ 12 Mustache .md policy templates
1465
- │ ├── procedure-templates/ 12 Mustache .md procedure templates
1466
- │ ├── evidence-templates/ 6 Mustache .md evidence document templates
1467
- │ └── partials/ Shared Mustache partials (org_header, revision_block, approver_signature)
1468
- ├── tools/
1469
- │ ├── index.ts Tool registry and security pipeline
1470
- │ ├── controls.ts Group 1: Control Registry (7 tools)
1471
- │ ├── gap-analysis.ts Group 2: Gap Analysis (7 tools)
1472
- │ ├── risks.ts Group 3: Risk Management (8 tools)
1473
- │ ├── policies.ts Group 4: Policy Management (4 tools)
1474
- │ ├── soa.ts Group 5: Statement of Applicability (3 tools)
1475
- │ ├── audit-management.ts Group 6: Audit Management (5 tools)
1476
- │ ├── evidence-tracking.ts Group 7: Evidence Tracking (5 tools)
1477
- │ ├── server-info.ts Group 8: Server Info (1 tool)
1478
- │ ├── org-profile.ts Group 10: Organisation Profile (2 tools) + loadOrgProfileDefaults helper
1479
- │ ├── procedures.ts Group 11: Procedure Management (5 tools)
1480
- │ ├── management-review.ts Group 12: Management Review — Clause 9.3 (6 tools)
1481
- │ ├── improvement-plan.ts Group 13: Improvement Plan — Clause 10.1 (4 tools)
1482
- │ ├── evidence-templates.ts Group 14: Evidence Templates (3 tools)
1483
- │ └── template-utils.ts Shared loadTemplate / stripFrontmatter / loadPartials helpers
1484
- ├── resources/
1485
- │ ├── index.ts Registers all 12 MCP Resources
1486
- │ ├── resource-auth.ts Slim auth helper for resource callbacks
1487
- │ ├── controls.ts iso27001-control, iso27001-control-versioned, iso27001-clause
1488
- │ ├── org-profile.ts iso27001-org-profile (static URI)
1489
- │ ├── policies.ts iso27001-policy, iso27001-policy-versioned
1490
- │ ├── procedures.ts iso27001-procedure, iso27001-procedure-versioned
1491
- │ ├── risks.ts iso27001-risk (with nested treatments)
1492
- │ └── assessments.ts iso27001-assessment, iso27001-soa, iso27001-audit
1493
- └── transport/
1494
- └── sse.ts Express SSE server for team/hosted modes
1495
-
1496
- tests/
1497
- ├── fixtures/
1498
- │ ├── mock-db.ts In-memory mock DB for unit tests
1499
- │ └── test-db.ts Real encrypted DB fixture (macOS only)
1500
- ├── unit/
1501
- │ ├── auth/ api-key, rbac
1502
- │ ├── security/ sanitise, rate-limiter
1503
- │ ├── audit/ logger
1504
- │ ├── tools/ One file per handler module
1505
- │ └── resources/ One file per resource module (controls, policies, procedures, risks, assessments)
1506
- └── integration/
1507
- ├── mcp-protocol.test.ts Schema and registration validation
1508
- ├── db-operations.test.ts Migrations, seed counts, FTS5 (macOS only)
1509
- └── business-rules.test.ts All 6 enforced business rules end-to-end
1510
- ```
1511
-
1512
- ---
1513
-
1514
- ## Contributing
1515
-
1516
- Contributions are welcome — bug fixes, new policy/procedure templates, additional integrations, and documentation improvements are all valuable.
1517
-
1518
- **Getting started:**
1519
-
1520
- ```bash
1521
- git clone https://github.com/Sushegaad/MCP-Server-for-ISO27001
1522
- cd MCP-server-for-ISO27001
1523
- npm install
1524
- npm test # should pass before any changes
1525
- npm run typecheck # zero errors required
1526
- ```
1527
-
1528
- **Before opening a PR:**
1529
-
1530
- - Run `npm run typecheck` — zero TypeScript errors required
1531
- - Run `npm test` — all tests must pass
1532
- - Run `npm run lint` — no new lint errors
1533
- - If adding seed data, run `npm run generate-checksums` and commit the updated checksums file
1534
-
1535
- **Areas where help is most needed:**
1536
-
1537
- - Additional policy and procedure templates (currently 12 + 12; ISO 27001 has room for more)
1538
- - More evidence document templates
1539
- - ISO 27001 ↔ other framework mappings (SOC 2, NIST CSF, CIS Controls)
1540
- - Windows and Linux testing (most development is on macOS)
1541
-
1542
- Please open an issue before starting significant work so we can align on direction.
1543
-
1544
- ---
1545
-
1546
- ## Security
1547
-
1548
- For the full security profile — threat model, hardening guide, data flow documentation, supply chain attestation, and audit log integrity verification — see the **[Trust Center](https://github.com/Sushegaad/MCP-Server-for-ISO27001/tree/main/docs/security/)**.
1549
-
1550
- ### API Key Storage
1551
-
1552
- API keys are never stored in plaintext. Only an HMAC-SHA256 hash is persisted in the database. The raw `iso27001_...` key is printed once to stdout at generation time — there is no way to retrieve it afterwards.
1553
-
1554
- ### Database Encryption
1555
-
1556
- The SQLite database (`isms.db`) is encrypted at rest using AES-256 via `better-sqlite3-multiple-ciphers`. The `DB_ENCRYPTION_KEY` is required at every startup and is never written to disk by the server.
1557
-
1558
- ### Tamper-Evident Audit Trail
1559
-
1560
- Every tool call writes a row to `audit_log` with a `row_hash` computed as:
1561
-
1562
- ```
1563
- HMAC-SHA256(HMAC_SECRET, id | timestamp | tool | key_hash | role |
1564
- params_json | outcome | error_message | duration_ms | prev_hash)
1565
- ```
1566
-
1567
- The `prev_hash` field chains each row to its predecessor — insertion, deletion, or reordering of rows is detectable via `verifyRowHash()` and `verifyChain()`. The same events are appended in JSON-L format to `AUDIT_LOG_PATH` for off-database retention and SIEM ingestion. The log path is validated on write to reject paths inside system directories (`/etc`, `/proc`, `/sys`, `/dev`).
1568
-
1569
- ### Production Checklist
293
+ The detailed documentation has been moved to keep this page scannable. Everything below is in **[`docs/REFERENCE.md`](docs/REFERENCE.md)**:
1570
294
 
1571
- - [ ] Set `NODE_ENV=production`
1572
- - [ ] Set `BEHIND_TLS_PROXY=true` (the server logs a loud warning if this is absent in production)
1573
- - [ ] Terminate TLS upstream (nginx, Caddy, AWS ALB, etc.)
1574
- - [ ] Use `--expires` on all API keys especially admin keys
1575
- - [ ] Set `RATE_LIMIT_RPM` appropriate to your team size
1576
- - [ ] Store `DB_ENCRYPTION_KEY` and `HMAC_SECRET` in a secrets manager, not in `.env`
1577
- - [ ] Back up `isms.db` regularly it is the single source of truth for your entire ISMS
295
+ - [Installation](docs/REFERENCE.md#installation) prerequisites, `iso27001-mcp init`, `doctor`, Claude Desktop config
296
+ - [Connecting to Claude](docs/REFERENCE.md#connecting-to-claude) Claude Desktop JSON, Claude Code, API key management
297
+ - [Advanced / Manual Setup](docs/REFERENCE.md#advanced--manual-setup) CI/CD, custom paths, full env var table
298
+ - [Tools Reference](docs/REFERENCE.md#tools-reference) all 63 tools across 14 groups with full parameter tables
299
+ - [MCP Resources](docs/REFERENCE.md#mcp-resources) 12 `iso27001://` URIs, formats, example prompts
300
+ - [Architecture](docs/REFERENCE.md#architecture) 7-step security pipeline, database schema, seed data
301
+ - [Modes](docs/REFERENCE.md#modes)local / CI / team / hosted with SSE endpoint reference
302
+ - [Sample Outputs](docs/REFERENCE.md#sample-outputs) — 9 auditor-ready example files for Acme Financial Services Ltd
303
+ - [Integrations](docs/REFERENCE.md#integrations) — Jira and GitHub issue linking
304
+ - [Development](docs/REFERENCE.md#development) — build, test, typecheck, project structure
305
+ - [Security](docs/REFERENCE.md#security) — API key storage, encryption, audit trail, production checklist
1578
306
 
1579
307
  ---
1580
308