iso27001-mcp 0.7.4 → 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 +224 -63
- package/dist/index.js +1348 -84
- package/dist/seed/procedure-templates/access_provisioning.md +102 -0
- package/dist/seed/procedure-templates/asset_onboarding_offboarding.md +114 -0
- package/dist/seed/procedure-templates/audit_log_review.md +128 -0
- package/dist/seed/procedure-templates/backup_restore.md +99 -0
- package/dist/seed/procedure-templates/bcp_testing.md +115 -0
- package/dist/seed/procedure-templates/change_management.md +108 -0
- package/dist/seed/procedure-templates/cryptographic_key_management.md +114 -0
- package/dist/seed/procedure-templates/data_classification_handling.md +112 -0
- package/dist/seed/procedure-templates/incident_handling.md +105 -0
- package/dist/seed/procedure-templates/secure_development_workflow.md +105 -0
- package/dist/seed/procedure-templates/supplier_onboarding.md +102 -0
- package/dist/seed/procedure-templates/vulnerability_management.md +110 -0
- package/package.json +6 -3
- /package/dist/seed/policy-templates/{policy-templates/acceptable_use.md → acceptable_use.md} +0 -0
- /package/dist/seed/policy-templates/{policy-templates/access_control.md → access_control.md} +0 -0
- /package/dist/seed/policy-templates/{policy-templates/asset_management.md → asset_management.md} +0 -0
- /package/dist/seed/policy-templates/{policy-templates/business_continuity.md → business_continuity.md} +0 -0
- /package/dist/seed/policy-templates/{policy-templates/cryptography.md → cryptography.md} +0 -0
- /package/dist/seed/policy-templates/{policy-templates/data_classification.md → data_classification.md} +0 -0
- /package/dist/seed/policy-templates/{policy-templates/incident_response.md → incident_response.md} +0 -0
- /package/dist/seed/policy-templates/{policy-templates/information_security.md → information_security.md} +0 -0
- /package/dist/seed/policy-templates/{policy-templates/physical_security.md → physical_security.md} +0 -0
- /package/dist/seed/policy-templates/{policy-templates/risk_management.md → risk_management.md} +0 -0
- /package/dist/seed/policy-templates/{policy-templates/secure_development.md → secure_development.md} +0 -0
- /package/dist/seed/policy-templates/{policy-templates/supplier_security.md → supplier_security.md} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# iso27001-mcp
|
|
2
2
|
|
|
3
|
-
[](https://socket.dev/npm/package/iso27001-mcp/overview/0.7.9)
|
|
4
|
+
[](https://npmjs.com/package/iso27001-mcp)
|
|
5
|
+
[](https://sushegaad.github.io/MCP-Server-for-ISO27001/)
|
|
6
|
+
|
|
7
|
+
**[▶ Live Interactive Demo](https://sushegaad.github.io/MCP-Server-for-ISO27001/)**
|
|
4
8
|
|
|
5
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.
|
|
6
10
|
|
|
@@ -11,7 +15,7 @@ Claude ──MCP──► iso27001-mcp ──► encrypted SQLite (isms.db)
|
|
|
11
15
|
├── 114 ISO 27001:2013 controls (seeded)
|
|
12
16
|
├── Gap assessments & remediation roadmaps
|
|
13
17
|
├── Risk register & treatment plans
|
|
14
|
-
├── Policy documents (Mustache templates)
|
|
18
|
+
├── Policy & procedure documents (Mustache templates)
|
|
15
19
|
├── Statement of Applicability
|
|
16
20
|
├── Audit findings & corrective actions
|
|
17
21
|
└── Evidence tracking (+ Jira / GitHub)
|
|
@@ -27,6 +31,7 @@ Claude ──MCP──► iso27001-mcp ──► encrypted SQLite (isms.db)
|
|
|
27
31
|
- [Configuration](#configuration)
|
|
28
32
|
- [Connecting to Claude](#connecting-to-claude)
|
|
29
33
|
- [Tools Reference](#tools-reference)
|
|
34
|
+
- [MCP Resources](#mcp-resources)
|
|
30
35
|
- [Architecture](#architecture)
|
|
31
36
|
- [Modes](#modes)
|
|
32
37
|
- [Integrations](#integrations)
|
|
@@ -37,58 +42,55 @@ Claude ──MCP──► iso27001-mcp ──► encrypted SQLite (isms.db)
|
|
|
37
42
|
|
|
38
43
|
## Quick Start
|
|
39
44
|
|
|
40
|
-
Get the server connected to Claude Desktop in five
|
|
45
|
+
Get the server connected to Claude Desktop in five steps.
|
|
41
46
|
|
|
42
47
|
### Prerequisites
|
|
43
48
|
|
|
44
|
-
- **Node.js
|
|
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)
|
|
45
50
|
|
|
46
51
|
```bash
|
|
47
|
-
node --version # should print v20.x or higher
|
|
52
|
+
node --version # should print v20.x.x or higher
|
|
48
53
|
```
|
|
49
54
|
|
|
50
|
-
- **Build tools** —
|
|
55
|
+
- **Build tools** — required by the encrypted SQLite native module:
|
|
51
56
|
- **macOS:** `xcode-select --install`
|
|
52
57
|
- **Ubuntu/Debian:** `sudo apt-get install build-essential python3`
|
|
53
|
-
- **Windows:**
|
|
58
|
+
- **Windows:** Install [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/) → "Build Tools for Visual Studio" → check "Desktop development with C++"
|
|
54
59
|
|
|
55
|
-
### Step 1 — Install
|
|
60
|
+
### Step 1 — Install
|
|
56
61
|
|
|
57
62
|
```bash
|
|
58
63
|
npm install -g iso27001-mcp
|
|
59
64
|
```
|
|
60
65
|
|
|
61
|
-
This installs the `iso27001-mcp` command globally. The
|
|
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.
|
|
62
67
|
|
|
63
|
-
### Step 2 — Generate secrets
|
|
68
|
+
### Step 2 — Generate your secrets
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
Two secrets are required: one encrypts your database, the other signs API keys. Generate them with `openssl`:
|
|
66
71
|
|
|
67
72
|
```bash
|
|
68
|
-
openssl rand -hex 32 # →
|
|
69
|
-
openssl rand -hex 32 # →
|
|
73
|
+
openssl rand -hex 32 # → save this as your DB_ENCRYPTION_KEY
|
|
74
|
+
openssl rand -hex 32 # → save this as your HMAC_SECRET
|
|
70
75
|
```
|
|
71
76
|
|
|
72
|
-
|
|
77
|
+
Keep these values — you'll need them in Steps 3 and 4.
|
|
73
78
|
|
|
74
|
-
|
|
75
|
-
iso27001-mcp keygen --label "Me" --role admin \
|
|
76
|
-
HMAC_SECRET=<your_hmac_secret> \
|
|
77
|
-
DB_ENCRYPTION_KEY=<your_db_key> \
|
|
78
|
-
DB_PATH=$HOME/.iso27001/isms.db
|
|
79
|
-
```
|
|
79
|
+
### Step 3 — Generate an API key
|
|
80
80
|
|
|
81
|
-
|
|
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:
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
|
-
export HMAC_SECRET
|
|
85
|
-
export DB_ENCRYPTION_KEY
|
|
84
|
+
export HMAC_SECRET=<your_hmac_secret>
|
|
85
|
+
export DB_ENCRYPTION_KEY=<your_db_key>
|
|
86
86
|
export DB_PATH=$HOME/.iso27001/isms.db
|
|
87
87
|
|
|
88
88
|
iso27001-mcp keygen --label "Me" --role admin
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
The raw key (`iso27001_...`) is printed **once**
|
|
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.
|
|
92
94
|
|
|
93
95
|
### Step 4 — Add to Claude Desktop
|
|
94
96
|
|
|
@@ -97,6 +99,8 @@ Open your Claude Desktop config file:
|
|
|
97
99
|
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
98
100
|
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
99
101
|
|
|
102
|
+
Add the following block, substituting your values from Steps 2 and 3:
|
|
103
|
+
|
|
100
104
|
```json
|
|
101
105
|
{
|
|
102
106
|
"mcpServers": {
|
|
@@ -105,7 +109,7 @@ Open your Claude Desktop config file:
|
|
|
105
109
|
"env": {
|
|
106
110
|
"HMAC_SECRET": "your_hmac_secret",
|
|
107
111
|
"DB_ENCRYPTION_KEY": "your_db_encryption_key",
|
|
108
|
-
"MCP_API_KEY": "
|
|
112
|
+
"MCP_API_KEY": "iso27001_your_api_key_here",
|
|
109
113
|
"DB_PATH": "/Users/you/.iso27001/isms.db"
|
|
110
114
|
}
|
|
111
115
|
}
|
|
@@ -113,21 +117,26 @@ Open your Claude Desktop config file:
|
|
|
113
117
|
}
|
|
114
118
|
```
|
|
115
119
|
|
|
120
|
+
> **Tip:** Store `isms.db` in a stable location like `~/.iso27001/isms.db` so it persists across package upgrades.
|
|
121
|
+
|
|
116
122
|
### Step 5 — Restart Claude Desktop and verify
|
|
117
123
|
|
|
118
|
-
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:
|
|
119
125
|
|
|
120
126
|
> *"Use get_server_info to check the server is running."*
|
|
121
127
|
|
|
122
|
-
|
|
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.
|
|
123
129
|
|
|
124
130
|
### First things to try
|
|
125
131
|
|
|
126
132
|
```
|
|
127
133
|
"Create a gap assessment for Acme Ltd covering all ISO 27001:2022 controls."
|
|
128
|
-
"Show me the gap summary
|
|
129
|
-
"
|
|
130
|
-
"
|
|
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."
|
|
131
140
|
```
|
|
132
141
|
|
|
133
142
|
---
|
|
@@ -162,16 +171,24 @@ Risk scores are computed automatically (likelihood × impact) and reflected in s
|
|
|
162
171
|
|
|
163
172
|
---
|
|
164
173
|
|
|
165
|
-
### 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."*
|
|
166
179
|
|
|
167
|
-
Generate
|
|
180
|
+
> *"Generate an information security policy. Owner: CISO. Effective from 1 June 2026."*
|
|
168
181
|
|
|
169
|
-
> *"
|
|
182
|
+
> *"Create an Incident Handling Procedure linked to our Information Security Policy."*
|
|
170
183
|
|
|
171
|
-
Policies are rendered from Mustache templates with automatic ISO clause and control mappings.
|
|
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.
|
|
172
185
|
|
|
186
|
+
**12 policy types:**
|
|
173
187
|
`information_security` · `access_control` · `risk_management` · `asset_management` · `incident_response` · `business_continuity` · `supplier_security` · `cryptography` · `physical_security` · `acceptable_use` · `data_classification` · `secure_development`
|
|
174
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
|
+
|
|
175
192
|
---
|
|
176
193
|
|
|
177
194
|
### 4 — Produce a Statement of Applicability
|
|
@@ -227,7 +244,7 @@ Every tool call is logged in a tamper-evident audit trail. Admins can query it a
|
|
|
227
244
|
- **Build tools** for the native SQLite module:
|
|
228
245
|
- macOS: `xcode-select --install`
|
|
229
246
|
- Ubuntu/Debian: `sudo apt-get install build-essential python3`
|
|
230
|
-
- Windows:
|
|
247
|
+
- Windows: Install [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/) → "Build Tools for Visual Studio" → check "Desktop development with C++"
|
|
231
248
|
|
|
232
249
|
### Step 1 — Install
|
|
233
250
|
|
|
@@ -287,13 +304,13 @@ Full variable reference:
|
|
|
287
304
|
The server requires an API key on every tool call. Generate one for yourself:
|
|
288
305
|
|
|
289
306
|
```bash
|
|
290
|
-
# Viewer — read-only access to
|
|
307
|
+
# Viewer — read-only access to 25 tools
|
|
291
308
|
iso27001-mcp keygen --label "Alice" --role viewer
|
|
292
309
|
|
|
293
|
-
# Analyst — read + write for gap/risk/policy/evidence tools (
|
|
310
|
+
# Analyst — read + write for gap/risk/policy/procedure/evidence tools (40 tools)
|
|
294
311
|
iso27001-mcp keygen --label "Bob" --role analyst --expires 90d
|
|
295
312
|
|
|
296
|
-
# Admin — all
|
|
313
|
+
# Admin — all 50 tools including audit log and key management
|
|
297
314
|
iso27001-mcp keygen --label "CISO" --role admin --expires 1y
|
|
298
315
|
```
|
|
299
316
|
|
|
@@ -358,7 +375,7 @@ export DB_PATH=$HOME/.iso27001/isms.db
|
|
|
358
375
|
|
|
359
376
|
## Tools Reference
|
|
360
377
|
|
|
361
|
-
The server exposes **
|
|
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.
|
|
362
379
|
|
|
363
380
|
---
|
|
364
381
|
|
|
@@ -594,8 +611,8 @@ Render a policy from a Mustache template with org-specific variables.
|
|
|
594
611
|
| Parameter | Req | Type | Values / Notes |
|
|
595
612
|
|-----------|-----|------|----------------|
|
|
596
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` |
|
|
597
|
-
| `organisation_name` |
|
|
598
|
-
| `scope` |
|
|
614
|
+
| `organisation_name` | — | string | Auto-injected from org profile if set |
|
|
615
|
+
| `scope` | — | string | Auto-injected from org profile if set |
|
|
599
616
|
| `owner` | ✅ | string | |
|
|
600
617
|
| `approver` | — | string | |
|
|
601
618
|
| `review_cycle_months` | — | integer | 1–36, default: `12` |
|
|
@@ -815,14 +832,143 @@ Immediately revoke a key by label.
|
|
|
815
832
|
|
|
816
833
|
---
|
|
817
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
|
+
|
|
818
963
|
## Architecture
|
|
819
964
|
|
|
820
965
|
```
|
|
821
966
|
┌─────────────────────────────────────────────────────────┐
|
|
822
967
|
│ Claude (LLM) │
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
968
|
+
└──────────┬───────────────────────────────┬──────────────┘
|
|
969
|
+
│ MCP Tools (read/write) │ MCP Resources (read-only)
|
|
970
|
+
│ 50 tools, RBAC enforced │ 12 iso27001:// URIs
|
|
971
|
+
┌──────────▼───────────────────────────────▼──────────────┐
|
|
826
972
|
│ iso27001-mcp server │
|
|
827
973
|
│ │
|
|
828
974
|
│ ┌─────────────────────────────────────────────────┐ │
|
|
@@ -840,14 +986,14 @@ Immediately revoke a key by label.
|
|
|
840
986
|
│ └─────────────────────────────────────────────────┘ │
|
|
841
987
|
│ │
|
|
842
988
|
│ ┌─────────────┐ ┌──────────┐ ┌────────────────────┐ │
|
|
843
|
-
│ │ Controls │ │ Risks │ │
|
|
844
|
-
│ │ Gap Assess │ │ Register │ │
|
|
845
|
-
│ │ SoA │ │ Treatmts │ │
|
|
989
|
+
│ │ Controls │ │ Risks │ │ Policies & │ │
|
|
990
|
+
│ │ Gap Assess │ │ Register │ │ Procedures │ │
|
|
991
|
+
│ │ SoA │ │ Treatmts │ │ (Mustache tmpl) │ │
|
|
846
992
|
│ └─────────────┘ └──────────┘ └────────────────────┘ │
|
|
847
993
|
│ ┌─────────────┐ ┌──────────┐ ┌────────────────────┐ │
|
|
848
|
-
│ │ Audits │ │ Evidence │ │
|
|
849
|
-
│ │ Findings │ │ Jira/GH │ │
|
|
850
|
-
│ │ CARs │ │ Gaps │ │
|
|
994
|
+
│ │ Audits │ │ Evidence │ │ Org Profile & │ │
|
|
995
|
+
│ │ Findings │ │ Jira/GH │ │ Audit Log │ │
|
|
996
|
+
│ │ CARs │ │ Gaps │ │ (tamper-evident) │ │
|
|
851
997
|
│ └─────────────┘ └──────────┘ └────────────────────┘ │
|
|
852
998
|
│ │
|
|
853
999
|
│ ┌─────────────────────────────────────────────────┐ │
|
|
@@ -860,10 +1006,11 @@ Immediately revoke a key by label.
|
|
|
860
1006
|
|
|
861
1007
|
### Database
|
|
862
1008
|
|
|
863
|
-
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
|
|
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:
|
|
864
1010
|
|
|
865
1011
|
- `0001_initial.sql` — 17 tables covering every ISMS domain (controls, gap assessments, risks, policies, audits, evidence, API keys, audit log, and more)
|
|
866
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
|
|
867
1014
|
|
|
868
1015
|
### Seed Data
|
|
869
1016
|
|
|
@@ -897,9 +1044,9 @@ Three roles with strict hierarchy. A key can only call tools at or below its ass
|
|
|
897
1044
|
|
|
898
1045
|
| Role | Tools available | Typical user |
|
|
899
1046
|
|------|----------------|--------------|
|
|
900
|
-
| `viewer` |
|
|
901
|
-
| `analyst` |
|
|
902
|
-
| `admin` |
|
|
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 |
|
|
903
1050
|
|
|
904
1051
|
---
|
|
905
1052
|
|
|
@@ -976,7 +1123,7 @@ npm run typecheck
|
|
|
976
1123
|
# Build dist/
|
|
977
1124
|
npm run build
|
|
978
1125
|
|
|
979
|
-
# Run all tests (
|
|
1126
|
+
# Run all tests (404 unit + integration tests)
|
|
980
1127
|
npm test
|
|
981
1128
|
|
|
982
1129
|
# Watch mode
|
|
@@ -997,28 +1144,29 @@ npm run dev
|
|
|
997
1144
|
```
|
|
998
1145
|
src/
|
|
999
1146
|
├── index.ts CLI entry (keygen, keys, server startup)
|
|
1000
|
-
├── server.ts McpServer factory
|
|
1147
|
+
├── server.ts McpServer factory — registers tools + resources
|
|
1001
1148
|
├── auth/
|
|
1002
1149
|
│ ├── api-key.ts Key generation, HMAC validation, expiry, revocation
|
|
1003
|
-
│ └── rbac.ts Permission matrix (
|
|
1150
|
+
│ └── rbac.ts Permission matrix (50 tools × 3 roles)
|
|
1004
1151
|
├── security/
|
|
1005
1152
|
│ ├── sanitise.ts Prompt-injection stripping for free-text fields
|
|
1006
1153
|
│ ├── rate-limiter.ts Sliding-window RPM counter per key hash
|
|
1007
1154
|
│ ├── secrets.ts Env var validation (fail-fast on startup)
|
|
1008
|
-
│ └── validate.ts Zod schemas for all
|
|
1155
|
+
│ └── validate.ts Zod schemas for all 50 tool inputs
|
|
1009
1156
|
├── audit/
|
|
1010
1157
|
│ └── logger.ts Tamper-evident audit event writer
|
|
1011
1158
|
├── db/
|
|
1012
1159
|
│ ├── connection.ts Encrypted SQLite open/close/migrate
|
|
1013
|
-
│ ├── dal.ts Shared helpers: newId, now, toJson, computeEvidenceStatus
|
|
1014
|
-
│ └── 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
|
|
1015
1162
|
├── seed/
|
|
1016
1163
|
│ ├── seeder.ts Idempotent seed runner with checksum verification
|
|
1017
1164
|
│ ├── controls-2022.json 93 ISO 27001:2022 Annex A controls
|
|
1018
1165
|
│ ├── controls-2013.json 114 ISO 27001:2013 controls
|
|
1019
1166
|
│ ├── version-mapping.json 125 cross-version mappings
|
|
1020
1167
|
│ ├── clause-requirements.json 41 clause requirements (clauses 4–10)
|
|
1021
|
-
│
|
|
1168
|
+
│ ├── policy-templates/ 12 Mustache .md policy templates
|
|
1169
|
+
│ └── procedure-templates/ 12 Mustache .md procedure templates
|
|
1022
1170
|
├── tools/
|
|
1023
1171
|
│ ├── index.ts Tool registry and security pipeline
|
|
1024
1172
|
│ ├── controls.ts Group 1: Control Registry (7 tools)
|
|
@@ -1028,7 +1176,19 @@ src/
|
|
|
1028
1176
|
│ ├── soa.ts Group 5: Statement of Applicability (3 tools)
|
|
1029
1177
|
│ ├── audit-management.ts Group 6: Audit Management (5 tools)
|
|
1030
1178
|
│ ├── evidence-tracking.ts Group 7: Evidence Tracking (5 tools)
|
|
1031
|
-
│
|
|
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
|
|
1032
1192
|
└── transport/
|
|
1033
1193
|
└── sse.ts Express SSE server for team/hosted modes
|
|
1034
1194
|
|
|
@@ -1040,7 +1200,8 @@ tests/
|
|
|
1040
1200
|
│ ├── auth/ api-key, rbac
|
|
1041
1201
|
│ ├── security/ sanitise, rate-limiter
|
|
1042
1202
|
│ ├── audit/ logger
|
|
1043
|
-
│
|
|
1203
|
+
│ ├── tools/ One file per handler module
|
|
1204
|
+
│ └── resources/ One file per resource module (controls, policies, procedures, risks, assessments)
|
|
1044
1205
|
└── integration/
|
|
1045
1206
|
├── mcp-protocol.test.ts Schema and registration validation
|
|
1046
1207
|
├── db-operations.test.ts Migrations, seed counts, FTS5 (macOS only)
|