iso27001-mcp 0.7.8 → 0.7.9

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.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # iso27001-mcp
2
2
 
3
- [![Socket Badge](https://badge.socket.dev/npm/package/iso27001-mcp/0.7.8)](https://socket.dev/npm/package/iso27001-mcp/overview/0.7.8)
3
+ [![Socket Badge](https://badge.socket.dev/npm/package/iso27001-mcp/0.7.9)](https://socket.dev/npm/package/iso27001-mcp/overview/0.7.9)
4
4
  [![npm version](https://img.shields.io/npm/v/iso27001-mcp.svg)](https://npmjs.com/package/iso27001-mcp)
5
- [![Live Demo](https://img.shields.io/badge/demo-live-blue)](https://sushegaad.github.io/MCP-server-for-ISO27001/)
5
+ [![Live Demo](https://img.shields.io/badge/demo-live-blue)](https://sushegaad.github.io/MCP-Server-for-ISO27001/)
6
6
 
7
- **[▶ Live Interactive Demo](https://sushegaad.github.io/MCP-server-for-ISO27001/)**
7
+ **[▶ Live Interactive Demo](https://sushegaad.github.io/MCP-Server-for-ISO27001/)**
8
8
 
9
9
  A stateful [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server that gives Claude a complete ISO 27001:2022 Information Security Management System (ISMS). Ask Claude to run gap assessments, manage risks, generate policies, track evidence, and run audits — all backed by an encrypted SQLite database on your own machine.
10
10
 
@@ -15,7 +15,7 @@ Claude ──MCP──► iso27001-mcp ──► encrypted SQLite (isms.db)
15
15
  ├── 114 ISO 27001:2013 controls (seeded)
16
16
  ├── Gap assessments & remediation roadmaps
17
17
  ├── Risk register & treatment plans
18
- ├── Policy documents (Mustache templates)
18
+ ├── Policy & procedure documents (Mustache templates)
19
19
  ├── Statement of Applicability
20
20
  ├── Audit findings & corrective actions
21
21
  └── Evidence tracking (+ Jira / GitHub)
@@ -31,6 +31,7 @@ Claude ──MCP──► iso27001-mcp ──► encrypted SQLite (isms.db)
31
31
  - [Configuration](#configuration)
32
32
  - [Connecting to Claude](#connecting-to-claude)
33
33
  - [Tools Reference](#tools-reference)
34
+ - [MCP Resources](#mcp-resources)
34
35
  - [Architecture](#architecture)
35
36
  - [Modes](#modes)
36
37
  - [Integrations](#integrations)
@@ -41,43 +42,43 @@ Claude ──MCP──► iso27001-mcp ──► encrypted SQLite (isms.db)
41
42
 
42
43
  ## Quick Start
43
44
 
44
- Get the server connected to Claude Desktop in five minutes.
45
+ Get the server connected to Claude Desktop in five steps.
45
46
 
46
47
  ### Prerequisites
47
48
 
48
- - **Node.js 20.11.0** — use [nvm](https://github.com/nvm-sh/nvm) or [Volta](https://volta.sh)
49
+ - **Node.js 20.11.0 or later** — download from [nodejs.org](https://nodejs.org) or use [nvm](https://github.com/nvm-sh/nvm) / [Volta](https://volta.sh)
49
50
 
50
51
  ```bash
51
- node --version # must be v20.x LTS — do not publish from Node 22/24
52
+ node --version # should print v20.x.x or higher
52
53
  ```
53
54
 
54
- > ⚠️ **Always publish from Node 20.** The native `better-sqlite3-multiple-ciphers` module is compiled against a specific Node ABI. Publishing from Node 24 produces a binary that may fail to load for users on Node 20.
55
-
56
- - **Build tools** — needed by the encrypted SQLite native module:
55
+ - **Build tools** required by the encrypted SQLite native module:
57
56
  - **macOS:** `xcode-select --install`
58
57
  - **Ubuntu/Debian:** `sudo apt-get install build-essential python3`
59
58
  - **Windows:** Install [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/) → "Build Tools for Visual Studio" → check "Desktop development with C++"
60
59
 
61
- ### Step 1 — Install from npm
60
+ ### Step 1 — Install
62
61
 
63
62
  ```bash
64
63
  npm install -g iso27001-mcp
65
64
  ```
66
65
 
67
- This installs the `iso27001-mcp` command globally. The native SQLite module downloads a prebuilt binary automatically on macOS and Linux x64; it compiles from source on other platforms.
66
+ This installs the `iso27001-mcp` command globally. The encrypted SQLite module downloads a prebuilt binary on macOS and Linux x64 automatically; it compiles from source on other platforms.
68
67
 
69
- ### Step 2 — Generate secrets
68
+ ### Step 2 — Generate your secrets
70
69
 
71
- Generate two random 32-byte secrets these encrypt your database and sign your API keys:
70
+ Two secrets are required: one encrypts your database, the other signs API keys. Generate them with `openssl`:
72
71
 
73
72
  ```bash
74
- openssl rand -hex 32 # → copy as HMAC_SECRET
75
- openssl rand -hex 32 # → copy as DB_ENCRYPTION_KEY
73
+ openssl rand -hex 32 # → save this as your DB_ENCRYPTION_KEY
74
+ openssl rand -hex 32 # → save this as your HMAC_SECRET
76
75
  ```
77
76
 
77
+ Keep these values — you'll need them in Steps 3 and 4.
78
+
78
79
  ### Step 3 — Generate an API key
79
80
 
80
- Set the environment variables first, then run keygen:
81
+ The server uses API keys to authenticate and authorise every tool call. Set your secrets as environment variables first, then run the keygen command:
81
82
 
82
83
  ```bash
83
84
  export HMAC_SECRET=<your_hmac_secret>
@@ -87,7 +88,9 @@ export DB_PATH=$HOME/.iso27001/isms.db
87
88
  iso27001-mcp keygen --label "Me" --role admin
88
89
  ```
89
90
 
90
- The raw key (`iso27001_...`) is printed **once** copy it immediately, it cannot be retrieved again.
91
+ The raw key (`iso27001_...`) is printed **once** and never stored in plaintext. Copy it immediately.
92
+
93
+ > Three roles are available: `viewer` (25 read-only tools), `analyst` (40 tools), `admin` (all 50 tools). Use `admin` for your personal key.
91
94
 
92
95
  ### Step 4 — Add to Claude Desktop
93
96
 
@@ -96,6 +99,8 @@ Open your Claude Desktop config file:
96
99
  - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
97
100
  - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
98
101
 
102
+ Add the following block, substituting your values from Steps 2 and 3:
103
+
99
104
  ```json
100
105
  {
101
106
  "mcpServers": {
@@ -104,7 +109,7 @@ Open your Claude Desktop config file:
104
109
  "env": {
105
110
  "HMAC_SECRET": "your_hmac_secret",
106
111
  "DB_ENCRYPTION_KEY": "your_db_encryption_key",
107
- "MCP_API_KEY": "iso27001_your_key_here",
112
+ "MCP_API_KEY": "iso27001_your_api_key_here",
108
113
  "DB_PATH": "/Users/you/.iso27001/isms.db"
109
114
  }
110
115
  }
@@ -112,21 +117,26 @@ Open your Claude Desktop config file:
112
117
  }
113
118
  ```
114
119
 
120
+ > **Tip:** Store `isms.db` in a stable location like `~/.iso27001/isms.db` so it persists across package upgrades.
121
+
115
122
  ### Step 5 — Restart Claude Desktop and verify
116
123
 
117
- Fully quit and reopen Claude Desktop. Then ask:
124
+ Fully quit and reopen Claude Desktop. You should see 50 tools in the MCP tools panel (hammer icon). Then ask Claude:
118
125
 
119
126
  > *"Use get_server_info to check the server is running."*
120
127
 
121
- You should get back version, uptime, and database stats confirming all 93 + 114 controls are seeded.
128
+ Claude will call `get_server_info` and return the version, uptime, and database stats confirming all 93 ISO 27001:2022 and 114 ISO 27001:2013 controls are seeded and ready.
122
129
 
123
130
  ### First things to try
124
131
 
125
132
  ```
126
133
  "Create a gap assessment for Acme Ltd covering all ISO 27001:2022 controls."
127
- "Show me the gap summary for that assessment."
128
- "Generate a remediation roadmap with a 26-week timeline."
129
- "Create an information security policy for Acme Ltd. Owner: CISO. Effective from today."
134
+ "Show me the gap summary and generate a remediation roadmap with a 26-week timeline."
135
+ "Register a new risk: our customer database is exposed to SQL injection — likelihood 4, impact 5."
136
+ "Set our organisation profile: Acme Ltd, scope: all cloud-hosted systems and remote employees."
137
+ "Generate an Access Control Policy for Acme Ltd. Owner: CISO. Effective from 1 July 2026."
138
+ "Create an Incident Handling Procedure linked to our Information Security Policy."
139
+ "Create an internal audit for Q3 covering clause 9.1 — Performance Evaluation."
130
140
  ```
131
141
 
132
142
  ---
@@ -161,16 +171,24 @@ Risk scores are computed automatically (likelihood × impact) and reflected in s
161
171
 
162
172
  ---
163
173
 
164
- ### 3 — Generate ISMS Policies
174
+ ### 3 — Generate ISMS Policies and Procedures
175
+
176
+ Generate a full suite of ISO 27001-aligned policy and procedure documents in seconds.
177
+
178
+ > *"Set our organisation profile: Acme Ltd. ISMS scope: all cloud-hosted systems and remote employees."*
165
179
 
166
- Generate a full suite of ISO 27001-aligned policy documents in seconds.
180
+ > *"Generate an information security policy. Owner: CISO. Effective from 1 June 2026."*
167
181
 
168
- > *"Generate an information security policy for Acme Ltd. Scope: all cloud-hosted systems and remote employees. Owner: CISO. Effective from 1 June 2026."*
182
+ > *"Create an Incident Handling Procedure linked to our Information Security Policy."*
169
183
 
170
- Policies are rendered from Mustache templates with automatic ISO clause and control mappings. Twelve policy types are included out of the box:
184
+ Policies and procedures are rendered from Mustache templates with automatic ISO clause and control mappings. Once the organisation profile is set, `organisation_name` and `scope` are injected automatically no need to repeat them on every call.
171
185
 
186
+ **12 policy types:**
172
187
  `information_security` · `access_control` · `risk_management` · `asset_management` · `incident_response` · `business_continuity` · `supplier_security` · `cryptography` · `physical_security` · `acceptable_use` · `data_classification` · `secure_development`
173
188
 
189
+ **12 procedure types:**
190
+ `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`
191
+
174
192
  ---
175
193
 
176
194
  ### 4 — Produce a Statement of Applicability
@@ -286,13 +304,13 @@ Full variable reference:
286
304
  The server requires an API key on every tool call. Generate one for yourself:
287
305
 
288
306
  ```bash
289
- # Viewer — read-only access to 22 tools
307
+ # Viewer — read-only access to 25 tools
290
308
  iso27001-mcp keygen --label "Alice" --role viewer
291
309
 
292
- # Analyst — read + write for gap/risk/policy/evidence tools (35 tools)
310
+ # Analyst — read + write for gap/risk/policy/procedure/evidence tools (40 tools)
293
311
  iso27001-mcp keygen --label "Bob" --role analyst --expires 90d
294
312
 
295
- # Admin — all 43 tools including audit log and key management
313
+ # Admin — all 50 tools including audit log and key management
296
314
  iso27001-mcp keygen --label "CISO" --role admin --expires 1y
297
315
  ```
298
316
 
@@ -357,7 +375,7 @@ export DB_PATH=$HOME/.iso27001/isms.db
357
375
 
358
376
  ## Tools Reference
359
377
 
360
- The server exposes **43 tools** across 9 groups. All tools require a valid API key. The minimum role required is noted per group; `✅` marks required parameters, `—` marks optional ones.
378
+ The server exposes **50 tools** across 11 groups. All tools require a valid API key. The minimum role required is noted per group; `✅` marks required parameters, `—` marks optional ones.
361
379
 
362
380
  ---
363
381
 
@@ -593,8 +611,8 @@ Render a policy from a Mustache template with org-specific variables.
593
611
  | Parameter | Req | Type | Values / Notes |
594
612
  |-----------|-----|------|----------------|
595
613
  | `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` |
596
- | `organisation_name` | | string | |
597
- | `scope` | | string | |
614
+ | `organisation_name` | | string | Auto-injected from org profile if set |
615
+ | `scope` | | string | Auto-injected from org profile if set |
598
616
  | `owner` | ✅ | string | |
599
617
  | `approver` | — | string | |
600
618
  | `review_cycle_months` | — | integer | 1–36, default: `12` |
@@ -814,14 +832,143 @@ Immediately revoke a key by label.
814
832
 
815
833
  ---
816
834
 
835
+ ### Group 10 — Organisation Profile *(minimum role: admin for writes, viewer for reads)*
836
+
837
+ #### `set_organization_profile`
838
+ Upsert the singleton organisation profile. Used to auto-inject `organisation_name` and `scope` into `create_policy` and `create_procedure`.
839
+
840
+ | Parameter | Req | Type | Values / Notes |
841
+ |-----------|-----|------|----------------|
842
+ | `legal_entity_name` | ✅ | string | Registered legal name |
843
+ | `registered_jurisdiction` | ✅ | string | e.g. `England and Wales` |
844
+ | `in_scope_activities` | ✅ | string | Activities within ISMS scope |
845
+ | `isms_scope_statement` | ✅ | string | Formal scope statement (used as `scope` default) |
846
+ | `regulatory_licences` | — | array | Applicable licences or regulations |
847
+ | `declared_exclusions` | — | string | Out-of-scope exclusions and justifications |
848
+ | `raci_roles` | — | object | Keys: `ciso`, `dpo`, `data_owner`, `isms_manager`, `internal_auditor` |
849
+ | `review_cadence_months` | — | integer | Default: `12` |
850
+
851
+ #### `get_organization_profile`
852
+ Retrieve the singleton organisation profile. Returns `{ profile: null }` if not yet set. No parameters.
853
+
854
+ ---
855
+
856
+ ### Group 11 — Procedure Management *(reads: viewer+, create/export: analyst+, update: admin)*
857
+
858
+ #### `create_procedure`
859
+ Render a procedure from a Mustache template and store it in the database.
860
+
861
+ | Parameter | Req | Type | Values / Notes |
862
+ |-----------|-----|------|----------------|
863
+ | `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` |
864
+ | `owner` | ✅ | string | |
865
+ | `effective_date` | ✅ | string | `YYYY-MM-DD` |
866
+ | `organisation_name` | — | string | Auto-injected from org profile if set |
867
+ | `scope` | — | string | Auto-injected from org profile if set |
868
+ | `approver` | — | string | Defaults to `TBD` |
869
+ | `policy_id` | — | string (UUID) | Link to a parent policy (must be active) |
870
+ | `related_controls` | — | array | Control IDs |
871
+ | `review_cycle_months` | — | integer | 1–36, default: `12` |
872
+
873
+ #### `get_procedure`
874
+ Fetch a procedure by ID, optionally including archived version history.
875
+
876
+ | Parameter | Req | Type | Values / Notes |
877
+ |-----------|-----|------|----------------|
878
+ | `procedure_id` | ✅ | string (UUID) | |
879
+ | `include_versions` | — | boolean | Default: `false` |
880
+
881
+ #### `list_procedures`
882
+ List procedures with optional filters, sorted by upcoming review date.
883
+
884
+ | Parameter | Req | Type | Values / Notes |
885
+ |-----------|-----|------|----------------|
886
+ | `procedure_type` | — | enum | Any of the 12 procedure types above |
887
+ | `status` | — | enum | `draft` \| `active` \| `archived` |
888
+ | `policy_id` | — | string (UUID) | Filter to procedures linked to a specific policy |
889
+ | `overdue_only` | — | boolean | Filter to active procedures past their review date — default: `false` |
890
+ | `limit` | — | integer | Default: `50`, max `100` |
891
+ | `offset` | — | integer | Default: `0` |
892
+
893
+ #### `update_procedure`
894
+ Archive the current version and re-render with updated fields. Admin only.
895
+
896
+ | Parameter | Req | Type | Values / Notes |
897
+ |-----------|-----|------|----------------|
898
+ | `procedure_id` | ✅ | string (UUID) | |
899
+ | `reviewed_by` | ✅ | string | |
900
+ | `change_summary` | ✅ | string | |
901
+ | `scope` | — | string | |
902
+ | `owner` | — | string | |
903
+ | `approver` | — | string | |
904
+ | `related_controls` | — | array | Control IDs |
905
+
906
+ #### `export_procedure`
907
+ Export a procedure as Markdown or JSON.
908
+
909
+ | Parameter | Req | Type | Values / Notes |
910
+ |-----------|-----|------|----------------|
911
+ | `procedure_id` | ✅ | string (UUID) | |
912
+ | `format` | ✅ | enum | `markdown` \| `json` |
913
+
914
+ ---
915
+
916
+ ## MCP Resources
917
+
918
+ 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.
919
+
920
+ Resources are read-only. Write operations always go through tools (which enforce the security pipeline and audit log).
921
+
922
+ ### Resource URI Scheme
923
+
924
+ | Resource | URI pattern | Auth |
925
+ |----------|-------------|------|
926
+ | `iso27001-control` | `iso27001://control/{control_id}` | Public |
927
+ | `iso27001-control-versioned` | `iso27001://control/{control_id}/version/{version}` | Public |
928
+ | `iso27001-clause` | `iso27001://clause/{clause_id}` | Public |
929
+ | `iso27001-org-profile` | `iso27001://org/profile` | Viewer |
930
+ | `iso27001-policy` | `iso27001://policy/{policy_id}` | Viewer |
931
+ | `iso27001-policy-versioned` | `iso27001://policy/{policy_id}/version/{n}` | Viewer |
932
+ | `iso27001-procedure` | `iso27001://procedure/{procedure_id}` | Viewer |
933
+ | `iso27001-procedure-versioned` | `iso27001://procedure/{procedure_id}/version/{n}` | Viewer |
934
+ | `iso27001-risk` | `iso27001://risk/{risk_id}` | Viewer |
935
+ | `iso27001-assessment` | `iso27001://assessment/{assessment_id}` | Viewer |
936
+ | `iso27001-soa` | `iso27001://soa/{soa_id}` | Viewer |
937
+ | `iso27001-audit` | `iso27001://audit/{audit_id}` | Viewer |
938
+
939
+ ### Resource Formats
940
+
941
+ **Controls and clauses** (`application/json`) — full control record including `control_type`, `attributes`, `related_controls`, and ISO clause refs.
942
+
943
+ **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.
944
+
945
+ **Risks** (`application/json`) — risk record with nested `treatments` array.
946
+
947
+ **Assessments** (`application/json`) — assessment record with `control_status_summary` (counts by status).
948
+
949
+ **Statement of Applicability** (`application/json`) — SoA record with nested `entries` array (boolean `included` field).
950
+
951
+ **Audits** (`application/json`) — audit record with nested `findings` array, each containing its `corrective_actions`.
952
+
953
+ ### Example
954
+
955
+ ```
956
+ "Read iso27001://policy/pol-abc123 and compare it against control 5.1."
957
+ "List all open risks from iso27001://risk and summarise which controls are most often cited."
958
+ "Review the SoA at iso27001://soa/soa-xyz789 and identify excluded controls."
959
+ ```
960
+
961
+ ---
962
+
817
963
  ## Architecture
818
964
 
819
965
  ```
820
966
  ┌─────────────────────────────────────────────────────────┐
821
967
  │ Claude (LLM) │
822
- └──────────────────────────┬──────────────────────────────┘
823
- │ MCP (stdio or SSE)
824
- ┌──────────────────────────▼──────────────────────────────┐
968
+ └──────────┬───────────────────────────────┬──────────────┘
969
+ │ MCP Tools (read/write) │ MCP Resources (read-only)
970
+ │ 50 tools, RBAC enforced │ 12 iso27001:// URIs
971
+ ┌──────────▼───────────────────────────────▼──────────────┐
825
972
  │ iso27001-mcp server │
826
973
  │ │
827
974
  │ ┌─────────────────────────────────────────────────┐ │
@@ -839,14 +986,14 @@ Immediately revoke a key by label.
839
986
  │ └─────────────────────────────────────────────────┘ │
840
987
  │ │
841
988
  │ ┌─────────────┐ ┌──────────┐ ┌────────────────────┐ │
842
- │ │ Controls │ │ Risks │ │ Policies │ │
843
- │ │ Gap Assess │ │ Register │ │ (Mustache tmpl) │ │
844
- │ │ SoA │ │ Treatmts │ │ Version history │ │
989
+ │ │ Controls │ │ Risks │ │ Policies & │ │
990
+ │ │ Gap Assess │ │ Register │ │ Procedures │ │
991
+ │ │ SoA │ │ Treatmts │ │ (Mustache tmpl) │ │
845
992
  │ └─────────────┘ └──────────┘ └────────────────────┘ │
846
993
  │ ┌─────────────┐ ┌──────────┐ ┌────────────────────┐ │
847
- │ │ Audits │ │ Evidence │ │ Audit Log │ │
848
- │ │ Findings │ │ Jira/GH │ │ (tamper-evident) │ │
849
- │ │ CARs │ │ Gaps │ │ │ │
994
+ │ │ Audits │ │ Evidence │ │ Org Profile & │ │
995
+ │ │ Findings │ │ Jira/GH │ │ Audit Log │ │
996
+ │ │ CARs │ │ Gaps │ │ (tamper-evident) │ │
850
997
  │ └─────────────┘ └──────────┘ └────────────────────┘ │
851
998
  │ │
852
999
  │ ┌─────────────────────────────────────────────────┐ │
@@ -859,10 +1006,11 @@ Immediately revoke a key by label.
859
1006
 
860
1007
  ### Database
861
1008
 
862
- 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 two SQL migrations applied automatically on first startup:
1009
+ 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 three SQL migrations applied automatically on first startup:
863
1010
 
864
1011
  - `0001_initial.sql` — 17 tables covering every ISMS domain (controls, gap assessments, risks, policies, audits, evidence, API keys, audit log, and more)
865
1012
  - `0002_fts_index.sql` — FTS5 full-text search index on controls, plus 12 performance indexes
1013
+ - `0003_org_profile_procedures.sql` — `organization_profile` singleton table, `procedures` table, and `procedure_versions` history table
866
1014
 
867
1015
  ### Seed Data
868
1016
 
@@ -896,9 +1044,9 @@ Three roles with strict hierarchy. A key can only call tools at or below its ass
896
1044
 
897
1045
  | Role | Tools available | Typical user |
898
1046
  |------|----------------|--------------|
899
- | `viewer` | 22 (all read-only tools) | Auditor, stakeholder |
900
- | `analyst` | 35 (reads + gap/risk/policy/evidence writes) | ISMS practitioner, consultant |
901
- | `admin` | 43 (all tools, including audit log and key management) | CISO, ISMS owner |
1047
+ | `viewer` | 25 (all read-only tools) | Auditor, stakeholder |
1048
+ | `analyst` | 40 (reads + gap/risk/policy/procedure/evidence writes) | ISMS practitioner, consultant |
1049
+ | `admin` | 50 (all tools, including org profile, audit log and key management) | CISO, ISMS owner |
902
1050
 
903
1051
  ---
904
1052
 
@@ -975,7 +1123,7 @@ npm run typecheck
975
1123
  # Build dist/
976
1124
  npm run build
977
1125
 
978
- # Run all tests (183 unit + integration tests)
1126
+ # Run all tests (404 unit + integration tests)
979
1127
  npm test
980
1128
 
981
1129
  # Watch mode
@@ -996,28 +1144,29 @@ npm run dev
996
1144
  ```
997
1145
  src/
998
1146
  ├── index.ts CLI entry (keygen, keys, server startup)
999
- ├── server.ts McpServer factory
1147
+ ├── server.ts McpServer factory — registers tools + resources
1000
1148
  ├── auth/
1001
1149
  │ ├── api-key.ts Key generation, HMAC validation, expiry, revocation
1002
- │ └── rbac.ts Permission matrix (43 tools × 3 roles)
1150
+ │ └── rbac.ts Permission matrix (50 tools × 3 roles)
1003
1151
  ├── security/
1004
1152
  │ ├── sanitise.ts Prompt-injection stripping for free-text fields
1005
1153
  │ ├── rate-limiter.ts Sliding-window RPM counter per key hash
1006
1154
  │ ├── secrets.ts Env var validation (fail-fast on startup)
1007
- │ └── validate.ts Zod schemas for all 43 tool inputs
1155
+ │ └── validate.ts Zod schemas for all 50 tool inputs
1008
1156
  ├── audit/
1009
1157
  │ └── logger.ts Tamper-evident audit event writer
1010
1158
  ├── db/
1011
1159
  │ ├── connection.ts Encrypted SQLite open/close/migrate
1012
- │ ├── dal.ts Shared helpers: newId, now, toJson, computeEvidenceStatus
1013
- │ └── migrations/ 0001_initial.sql, 0002_fts_index.sql
1160
+ │ ├── dal.ts Shared helpers: newId, now, toJson, fromJsonArray, computeEvidenceStatus
1161
+ │ └── migrations/ 0001_initial.sql, 0002_fts_index.sql, 0003_org_profile_procedures.sql
1014
1162
  ├── seed/
1015
1163
  │ ├── seeder.ts Idempotent seed runner with checksum verification
1016
1164
  │ ├── controls-2022.json 93 ISO 27001:2022 Annex A controls
1017
1165
  │ ├── controls-2013.json 114 ISO 27001:2013 controls
1018
1166
  │ ├── version-mapping.json 125 cross-version mappings
1019
1167
  │ ├── clause-requirements.json 41 clause requirements (clauses 4–10)
1020
- └── policy-templates/ 12 Mustache .md policy templates
1168
+ ├── policy-templates/ 12 Mustache .md policy templates
1169
+ │ └── procedure-templates/ 12 Mustache .md procedure templates
1021
1170
  ├── tools/
1022
1171
  │ ├── index.ts Tool registry and security pipeline
1023
1172
  │ ├── controls.ts Group 1: Control Registry (7 tools)
@@ -1027,7 +1176,19 @@ src/
1027
1176
  │ ├── soa.ts Group 5: Statement of Applicability (3 tools)
1028
1177
  │ ├── audit-management.ts Group 6: Audit Management (5 tools)
1029
1178
  │ ├── evidence-tracking.ts Group 7: Evidence Tracking (5 tools)
1030
- └── server-info.ts Group 8: Server Info (1 tool)
1179
+ ├── server-info.ts Group 8: Server Info (1 tool)
1180
+ │ ├── org-profile.ts Group 10: Organisation Profile (2 tools) + loadOrgProfileDefaults helper
1181
+ │ ├── procedures.ts Group 11: Procedure Management (5 tools)
1182
+ │ └── template-utils.ts Shared loadTemplate / stripFrontmatter helpers
1183
+ ├── resources/
1184
+ │ ├── index.ts Registers all 12 MCP Resources
1185
+ │ ├── resource-auth.ts Slim auth helper for resource callbacks
1186
+ │ ├── controls.ts iso27001-control, iso27001-control-versioned, iso27001-clause
1187
+ │ ├── org-profile.ts iso27001-org-profile (static URI)
1188
+ │ ├── policies.ts iso27001-policy, iso27001-policy-versioned
1189
+ │ ├── procedures.ts iso27001-procedure, iso27001-procedure-versioned
1190
+ │ ├── risks.ts iso27001-risk (with nested treatments)
1191
+ │ └── assessments.ts iso27001-assessment, iso27001-soa, iso27001-audit
1031
1192
  └── transport/
1032
1193
  └── sse.ts Express SSE server for team/hosted modes
1033
1194
 
@@ -1039,7 +1200,8 @@ tests/
1039
1200
  │ ├── auth/ api-key, rbac
1040
1201
  │ ├── security/ sanitise, rate-limiter
1041
1202
  │ ├── audit/ logger
1042
- └── tools/ One file per handler module
1203
+ ├── tools/ One file per handler module
1204
+ │ └── resources/ One file per resource module (controls, policies, procedures, risks, assessments)
1043
1205
  └── integration/
1044
1206
  ├── mcp-protocol.test.ts Schema and registration validation
1045
1207
  ├── db-operations.test.ts Migrations, seed counts, FTS5 (macOS only)