claw-grc-mcp-server 1.0.0

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 ADDED
@@ -0,0 +1,183 @@
1
+ # @claw-grc/mcp-server
2
+
3
+ Official MCP (Model Context Protocol) server for **Claw GRC** — the AI-native Governance, Risk, and Compliance platform.
4
+
5
+ Connect any MCP-compatible AI assistant (Claude, GPT-4, Cursor, etc.) directly to your Claw GRC workspace. Query compliance data, create security findings, manage tickets, and monitor agent trust scores — all from within your AI's context window.
6
+
7
+ [![npm](https://img.shields.io/npm/v/@claw-grc/mcp-server)](https://npmjs.com/package/@claw-grc/mcp-server)
8
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
9
+
10
+ ---
11
+
12
+ ## Quick Start
13
+
14
+ ### 1. Get Your API Key
15
+
16
+ Sign in to [Claw GRC](https://app.clawgrc.com) and generate an API key at **Settings → API Keys**.
17
+
18
+ API keys are prefixed with `cgrc_`.
19
+
20
+ ### 2. Add to Claude Code
21
+
22
+ In your Claude Desktop or Claude Code MCP config:
23
+
24
+ ```json
25
+ {
26
+ "mcpServers": {
27
+ "claw-grc": {
28
+ "command": "npx",
29
+ "args": ["@claw-grc/mcp-server"],
30
+ "env": {
31
+ "CLAW_GRC_API_KEY": "cgrc_your_api_key_here"
32
+ }
33
+ }
34
+ }
35
+ }
36
+ ```
37
+
38
+ **Mac**: `~/Library/Application Support/Claude/claude_desktop_config.json`
39
+ **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
40
+
41
+ ### 3. Start Using It
42
+
43
+ Claude can now access your Claw GRC data directly:
44
+
45
+ ```
46
+ "What's our current SOC 2 compliance score?"
47
+ "List all critical security findings from this month."
48
+ "Create a ticket for the SQL injection finding, priority high, due in 7 days."
49
+ "Which AI agents have trust scores below 0.75?"
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Available Tools
55
+
56
+ | Tool | Description |
57
+ |------|-------------|
58
+ | `grc_list_frameworks` | List active compliance frameworks (SOC 2, ISO 27001, EU AI Act, etc.) |
59
+ | `grc_get_compliance_score` | Get overall and per-framework compliance scores |
60
+ | `grc_get_control_coverage` | Get control implementation statistics |
61
+ | `grc_list_controls` | List controls filtered by framework or status |
62
+ | `grc_list_findings` | List security findings with severity/status filters |
63
+ | `grc_get_findings_summary` | Summary of all findings by severity and status |
64
+ | `grc_create_finding` | Report a new security finding |
65
+ | `grc_create_ticket` | Create a remediation ticket |
66
+ | `grc_list_agents` | List registered AI agents with trust scores |
67
+ | `grc_get_agent_trust_score` | Get detailed trust score breakdown for an agent |
68
+ | `grc_trigger_scan` | Trigger DAST, API, dependency, or cloud config scan |
69
+ | `grc_list_evidence` | List compliance evidence artifacts |
70
+ | `grc_submit_evidence` | Submit new compliance evidence |
71
+ | `grc_list_tickets` | List remediation tickets |
72
+
73
+ ---
74
+
75
+ ## Example Prompts
76
+
77
+ **Security review**:
78
+ ```
79
+ Review this code for OWASP LLM Top 10 vulnerabilities and create findings
80
+ in Claw GRC for anything you find above medium severity.
81
+ ```
82
+
83
+ **Compliance status**:
84
+ ```
85
+ Give me a complete compliance status report for our upcoming SOC 2 audit.
86
+ Focus on controls with stale or missing evidence.
87
+ ```
88
+
89
+ **Agent governance**:
90
+ ```
91
+ Audit our AI agent population. List any agents with trust scores below 0.75
92
+ and explain what's dragging their scores down.
93
+ ```
94
+
95
+ **Remediation planning**:
96
+ ```
97
+ Based on our open critical and high findings, create a prioritized remediation
98
+ plan with realistic timelines. Create tickets for the top 5.
99
+ ```
100
+
101
+ ---
102
+
103
+ ## OpenClaw Integration
104
+
105
+ For OpenClaw agents, this MCP server enables:
106
+ - **Self-reporting**: Agents submit their own compliance evidence
107
+ - **Trust score queries**: Agents check their own and other agents' trust scores
108
+ - **Finding submission**: Agents report security issues they discover
109
+ - **Agent discovery**: Agents find trusted collaborators by capability
110
+
111
+ ```python
112
+ # OpenClaw agent config
113
+ skill install @claw-grc/openclaw-skill
114
+
115
+ # Or via MCP:
116
+ {
117
+ "mcpServers": {
118
+ "claw-grc": {
119
+ "command": "npx",
120
+ "args": ["@claw-grc/mcp-server"],
121
+ "env": {
122
+ "CLAW_GRC_API_KEY": "cgrc_agent_key_here"
123
+ }
124
+ }
125
+ }
126
+ }
127
+ ```
128
+
129
+ ---
130
+
131
+ ## Environment Variables
132
+
133
+ | Variable | Required | Default | Description |
134
+ |----------|----------|---------|-------------|
135
+ | `CLAW_GRC_API_KEY` | **Yes** | — | API key (starts with `cgrc_`) |
136
+ | `CLAW_GRC_API_URL` | No | `https://api.clawgrc.com` | API base URL (for self-hosted) |
137
+
138
+ ---
139
+
140
+ ## Security
141
+
142
+ - All API calls are authenticated via your API key
143
+ - Every MCP tool invocation is logged in Claw GRC's immutable audit trail
144
+ - API keys are scoped to your organization
145
+ - No data is stored or transmitted to any third party by this package
146
+ - Rotate API keys at: `https://app.clawgrc.com/dashboard/settings`
147
+
148
+ ---
149
+
150
+ ## Troubleshooting
151
+
152
+ **"CLAW_GRC_API_KEY environment variable is required"**
153
+ Set the `CLAW_GRC_API_KEY` environment variable. See Quick Start above.
154
+
155
+ **"API 401: Unauthorized"**
156
+ Your API key may have expired or been revoked. Generate a new one at Settings → API Keys.
157
+
158
+ **"API 403: Forbidden"**
159
+ Your API key doesn't have permission for this operation. Check your key's scope.
160
+
161
+ **Claude doesn't show Claw GRC tools**
162
+ 1. Restart Claude after editing the config file
163
+ 2. Verify the config file is valid JSON
164
+ 3. Check Claude's logs for MCP server errors
165
+
166
+ ---
167
+
168
+ ## Links
169
+
170
+ - **Claw GRC**: https://clawgrc.com
171
+ - **Documentation**: https://docs.clawgrc.com/mcp
172
+ - **API Reference**: https://api.clawgrc.com/docs
173
+ - **GitHub**: https://github.com/onefrequency/claw-grc-mcp-server
174
+ - **Issues**: https://github.com/onefrequency/claw-grc-mcp-server/issues
175
+ - **Support**: dev@clawgrc.com
176
+
177
+ ---
178
+
179
+ ## License
180
+
181
+ Apache 2.0 — see [LICENSE](LICENSE) for details.
182
+
183
+ Built with ❤️ by [One Frequency Inc](https://onefrequency.ai) — SDVOSB
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Claw GRC MCP Server
4
+ *
5
+ * An official Model Context Protocol server for Claw GRC.
6
+ * Exposes GRC tools (compliance data, security findings, agent management)
7
+ * to any MCP-compatible AI assistant (Claude, GPT-4, etc.)
8
+ *
9
+ * @see https://clawgrc.com/mcp
10
+ * @see https://modelcontextprotocol.io
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG"}
package/dist/index.js ADDED
@@ -0,0 +1,693 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * Claw GRC MCP Server
5
+ *
6
+ * An official Model Context Protocol server for Claw GRC.
7
+ * Exposes GRC tools (compliance data, security findings, agent management)
8
+ * to any MCP-compatible AI assistant (Claude, GPT-4, etc.)
9
+ *
10
+ * @see https://clawgrc.com/mcp
11
+ * @see https://modelcontextprotocol.io
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
15
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
16
+ const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
17
+ // ---------------------------------------------------------------------------
18
+ // Configuration
19
+ // ---------------------------------------------------------------------------
20
+ const API_URL = process.env.CLAW_GRC_API_URL ?? 'https://api.clawgrc.com';
21
+ const API_KEY = process.env.CLAW_GRC_API_KEY;
22
+ if (!API_KEY) {
23
+ console.error('Error: CLAW_GRC_API_KEY environment variable is required.\n' +
24
+ 'Get your API key at: https://app.clawgrc.com/dashboard/settings\n' +
25
+ 'Usage: CLAW_GRC_API_KEY=cgrc_xxx npx @claw-grc/mcp-server');
26
+ process.exit(1);
27
+ }
28
+ // ---------------------------------------------------------------------------
29
+ // HTTP Client
30
+ // ---------------------------------------------------------------------------
31
+ async function clawGRCRequest(method, path, body, queryParams) {
32
+ const url = new URL(`${API_URL}${path}`);
33
+ if (queryParams) {
34
+ for (const [key, value] of Object.entries(queryParams)) {
35
+ url.searchParams.set(key, value);
36
+ }
37
+ }
38
+ const response = await fetch(url.toString(), {
39
+ method,
40
+ headers: {
41
+ 'Content-Type': 'application/json',
42
+ 'X-API-Key': API_KEY,
43
+ 'User-Agent': `claw-grc-mcp-server/1.0.0`,
44
+ },
45
+ body: body ? JSON.stringify(body) : undefined,
46
+ });
47
+ if (!response.ok) {
48
+ const errorText = await response.text().catch(() => 'Unknown error');
49
+ throw new Error(`Claw GRC API error ${response.status}: ${errorText}`);
50
+ }
51
+ if (response.status === 204) {
52
+ return undefined;
53
+ }
54
+ return response.json();
55
+ }
56
+ // ---------------------------------------------------------------------------
57
+ // Tool Definitions
58
+ // ---------------------------------------------------------------------------
59
+ const TOOLS = [
60
+ {
61
+ name: 'grc_list_frameworks',
62
+ description: 'List all active compliance frameworks in your organization (SOC 2, ISO 27001, EU AI Act, NIST AI RMF, FedRAMP, etc.) with control counts and status.',
63
+ inputSchema: {
64
+ type: 'object',
65
+ properties: {
66
+ page: {
67
+ type: 'number',
68
+ description: 'Page number (default: 1)',
69
+ },
70
+ page_size: {
71
+ type: 'number',
72
+ description: 'Results per page (default: 20, max: 100)',
73
+ },
74
+ },
75
+ },
76
+ },
77
+ {
78
+ name: 'grc_get_compliance_score',
79
+ description: "Get the organization's current compliance score overall and per framework. Returns percentage scores, control counts, and last calculation timestamp.",
80
+ inputSchema: {
81
+ type: 'object',
82
+ properties: {
83
+ framework_id: {
84
+ type: 'string',
85
+ description: 'Optional: Get score for a specific framework only (UUID). If omitted, returns overall score.',
86
+ },
87
+ },
88
+ },
89
+ },
90
+ {
91
+ name: 'grc_get_control_coverage',
92
+ description: 'Get control implementation coverage: how many controls are fully implemented, partially implemented, not implemented, or not applicable.',
93
+ inputSchema: {
94
+ type: 'object',
95
+ properties: {},
96
+ },
97
+ },
98
+ {
99
+ name: 'grc_list_controls',
100
+ description: 'List compliance controls, optionally filtered by framework or implementation status. Use this to see what controls need evidence.',
101
+ inputSchema: {
102
+ type: 'object',
103
+ properties: {
104
+ framework_id: {
105
+ type: 'string',
106
+ description: 'Filter by framework UUID',
107
+ },
108
+ status: {
109
+ type: 'string',
110
+ enum: ['implemented', 'partially_implemented', 'not_implemented', 'not_applicable'],
111
+ description: 'Filter by implementation status',
112
+ },
113
+ page: { type: 'number' },
114
+ page_size: { type: 'number' },
115
+ },
116
+ },
117
+ },
118
+ {
119
+ name: 'grc_list_findings',
120
+ description: 'List security findings with optional filters. Use this to check open vulnerabilities, their severity, and remediation status.',
121
+ inputSchema: {
122
+ type: 'object',
123
+ properties: {
124
+ severity: {
125
+ type: 'string',
126
+ enum: ['critical', 'high', 'medium', 'low', 'info'],
127
+ description: 'Filter by severity level',
128
+ },
129
+ status: {
130
+ type: 'string',
131
+ enum: ['open', 'in_progress', 'resolved', 'accepted', 'false_positive'],
132
+ description: 'Filter by remediation status',
133
+ },
134
+ assessment_id: {
135
+ type: 'string',
136
+ description: 'Filter by security assessment UUID',
137
+ },
138
+ page: { type: 'number' },
139
+ page_size: { type: 'number' },
140
+ },
141
+ },
142
+ },
143
+ {
144
+ name: 'grc_get_findings_summary',
145
+ description: 'Get a summary of all security findings by severity and status. Use this for quick security posture overview.',
146
+ inputSchema: {
147
+ type: 'object',
148
+ properties: {},
149
+ },
150
+ },
151
+ {
152
+ name: 'grc_create_finding',
153
+ description: 'Report a new security finding or vulnerability discovered during code review, penetration testing, or automated scanning.',
154
+ inputSchema: {
155
+ type: 'object',
156
+ properties: {
157
+ title: {
158
+ type: 'string',
159
+ description: 'Clear, specific title of the finding (e.g., "SQL injection in user search API")',
160
+ },
161
+ description: {
162
+ type: 'string',
163
+ description: 'Detailed description of the vulnerability, including affected code/component and potential impact',
164
+ },
165
+ severity: {
166
+ type: 'string',
167
+ enum: ['critical', 'high', 'medium', 'low', 'info'],
168
+ description: 'Severity level based on impact and exploitability',
169
+ },
170
+ assessment_id: {
171
+ type: 'string',
172
+ description: 'UUID of the security assessment this finding belongs to',
173
+ },
174
+ cwe_id: {
175
+ type: 'string',
176
+ description: 'CWE identifier (e.g., "CWE-89" for SQL injection)',
177
+ },
178
+ cve_id: {
179
+ type: 'string',
180
+ description: 'CVE identifier if this is a known vulnerability',
181
+ },
182
+ cvss_score: {
183
+ type: 'number',
184
+ description: 'CVSS 3.1 base score (0.0-10.0)',
185
+ },
186
+ cvss_vector: {
187
+ type: 'string',
188
+ description: 'CVSS 3.1 vector string (e.g., "AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H")',
189
+ },
190
+ remediation: {
191
+ type: 'string',
192
+ description: 'Recommended remediation steps',
193
+ },
194
+ affected_resource: {
195
+ type: 'string',
196
+ description: 'Affected file path, URL endpoint, or infrastructure resource',
197
+ },
198
+ },
199
+ required: ['title', 'severity'],
200
+ },
201
+ },
202
+ {
203
+ name: 'grc_create_ticket',
204
+ description: 'Create a remediation ticket for a security finding or compliance gap. Tickets can be linked to findings and assigned to team members.',
205
+ inputSchema: {
206
+ type: 'object',
207
+ properties: {
208
+ title: {
209
+ type: 'string',
210
+ description: 'Ticket title',
211
+ },
212
+ description: {
213
+ type: 'string',
214
+ description: 'Detailed description of what needs to be done',
215
+ },
216
+ priority: {
217
+ type: 'string',
218
+ enum: ['critical', 'high', 'medium', 'low'],
219
+ description: 'Ticket priority',
220
+ },
221
+ type: {
222
+ type: 'string',
223
+ enum: ['bug', 'compliance_gap', 'security_finding', 'evidence_collection', 'policy_review', 'other'],
224
+ description: 'Type of ticket',
225
+ },
226
+ finding_id: {
227
+ type: 'string',
228
+ description: 'UUID of the security finding to link this ticket to',
229
+ },
230
+ control_id: {
231
+ type: 'string',
232
+ description: 'UUID of the compliance control this ticket addresses',
233
+ },
234
+ due_date: {
235
+ type: 'string',
236
+ description: 'Due date in ISO 8601 format (e.g., "2026-04-01")',
237
+ },
238
+ },
239
+ required: ['title', 'priority'],
240
+ },
241
+ },
242
+ {
243
+ name: 'grc_list_agents',
244
+ description: 'List all registered AI agents in your organization with their trust scores, capabilities, and status.',
245
+ inputSchema: {
246
+ type: 'object',
247
+ properties: {
248
+ page: { type: 'number' },
249
+ page_size: { type: 'number' },
250
+ },
251
+ },
252
+ },
253
+ {
254
+ name: 'grc_get_agent_trust_score',
255
+ description: "Get an AI agent's current trust score with factor breakdown and historical trend. Trust score determines what the agent is allowed to do autonomously.",
256
+ inputSchema: {
257
+ type: 'object',
258
+ properties: {
259
+ agent_id: {
260
+ type: 'string',
261
+ description: 'UUID of the AI agent',
262
+ },
263
+ },
264
+ required: ['agent_id'],
265
+ },
266
+ },
267
+ {
268
+ name: 'grc_trigger_scan',
269
+ description: 'Trigger a security scan (DAST, API security, dependency scan, or cloud configuration audit) against a target.',
270
+ inputSchema: {
271
+ type: 'object',
272
+ properties: {
273
+ target: {
274
+ type: 'string',
275
+ description: 'Target URL, API endpoint, or resource identifier to scan',
276
+ },
277
+ type: {
278
+ type: 'string',
279
+ enum: ['dast', 'api', 'dependency', 'cloud_config', 'secrets'],
280
+ description: 'Type of security scan to run',
281
+ },
282
+ configuration: {
283
+ type: 'object',
284
+ description: 'Optional scan configuration parameters',
285
+ },
286
+ },
287
+ required: ['target', 'type'],
288
+ },
289
+ },
290
+ {
291
+ name: 'grc_list_evidence',
292
+ description: 'List compliance evidence artifacts, optionally filtered by control or status. Use this to check what evidence has been collected and what is stale.',
293
+ inputSchema: {
294
+ type: 'object',
295
+ properties: {
296
+ control_id: {
297
+ type: 'string',
298
+ description: 'Filter evidence by control UUID',
299
+ },
300
+ status: {
301
+ type: 'string',
302
+ enum: ['pending', 'collected', 'validated', 'expired', 'rejected'],
303
+ },
304
+ page: { type: 'number' },
305
+ page_size: { type: 'number' },
306
+ },
307
+ },
308
+ },
309
+ {
310
+ name: 'grc_submit_evidence',
311
+ description: 'Submit a compliance evidence artifact for a specific control. Agents use this to report their compliance status automatically.',
312
+ inputSchema: {
313
+ type: 'object',
314
+ properties: {
315
+ name: {
316
+ type: 'string',
317
+ description: 'Evidence artifact name (e.g., "AWS IAM Policy Export - 2026-03-13")',
318
+ },
319
+ type: {
320
+ type: 'string',
321
+ description: 'Evidence type (policy, screenshot, log_export, test_result, attestation)',
322
+ },
323
+ description: {
324
+ type: 'string',
325
+ description: 'Description of what this evidence demonstrates',
326
+ },
327
+ control_id: {
328
+ type: 'string',
329
+ description: 'UUID of the compliance control this evidence satisfies',
330
+ },
331
+ content: {
332
+ type: 'string',
333
+ description: 'Text content of the evidence (for text-based evidence)',
334
+ },
335
+ url: {
336
+ type: 'string',
337
+ description: 'URL linking to the evidence source or screenshot',
338
+ },
339
+ },
340
+ required: ['name', 'type', 'description'],
341
+ },
342
+ },
343
+ {
344
+ name: 'grc_list_tickets',
345
+ description: 'List remediation tickets with optional filters. Use to check open work items and SLA compliance.',
346
+ inputSchema: {
347
+ type: 'object',
348
+ properties: {
349
+ status: { type: 'string', enum: ['open', 'in_progress', 'resolved', 'closed', 'wont_fix'] },
350
+ priority: { type: 'string', enum: ['critical', 'high', 'medium', 'low'] },
351
+ page: { type: 'number' },
352
+ page_size: { type: 'number' },
353
+ },
354
+ },
355
+ },
356
+ {
357
+ name: 'grc_search',
358
+ description: 'Full-text search across all Claw GRC entities: frameworks, controls, evidence, policies, risks, and tickets. Returns ranked results with highlights.',
359
+ inputSchema: {
360
+ type: 'object',
361
+ properties: {
362
+ query: { type: 'string', description: 'Search query (e.g. "access control", "SOC 2 CC6.1")' },
363
+ types: {
364
+ type: 'array',
365
+ items: { type: 'string', enum: ['framework', 'control', 'evidence', 'policy', 'risk', 'ticket'] },
366
+ description: 'Limit search to specific entity types. Omit to search all.',
367
+ },
368
+ limit: { type: 'number', description: 'Max results (default 30, max 100)' },
369
+ },
370
+ required: ['query'],
371
+ },
372
+ },
373
+ {
374
+ name: 'grc_list_policies',
375
+ description: 'List compliance policies with optional filters. Policies cover access control, incident response, change management, AI governance, and more.',
376
+ inputSchema: {
377
+ type: 'object',
378
+ properties: {
379
+ status: { type: 'string', enum: ['draft', 'in_review', 'approved', 'published', 'archived'] },
380
+ type: { type: 'string', description: 'Policy type (access_control, incident_response, ai_governance, etc.)' },
381
+ page: { type: 'number' },
382
+ page_size: { type: 'number' },
383
+ },
384
+ },
385
+ },
386
+ {
387
+ name: 'grc_create_policy',
388
+ description: 'Create a new compliance policy. Policies start as drafts and go through review → approval → publication.',
389
+ inputSchema: {
390
+ type: 'object',
391
+ properties: {
392
+ name: { type: 'string', description: 'Policy name (e.g. "Access Control Policy v2.1")' },
393
+ type: { type: 'string', description: 'Policy type: access_control|incident_response|change_management|vendor_management|data_classification|acceptable_use|backup_recovery|business_continuity|vulnerability_management|ai_governance|privacy|other' },
394
+ content: { type: 'string', description: 'Full policy text in Markdown' },
395
+ owner: { type: 'string', description: 'Policy owner (email or name)' },
396
+ review_date: { type: 'string', description: 'Review date in ISO 8601 format (YYYY-MM-DD)' },
397
+ },
398
+ required: ['name', 'type'],
399
+ },
400
+ },
401
+ {
402
+ name: 'grc_list_risks',
403
+ description: 'List risks in the AI-aware risk register with AIRSS scoring. Risks are ordered by AIRSS score (highest first).',
404
+ inputSchema: {
405
+ type: 'object',
406
+ properties: {
407
+ category: { type: 'string', enum: ['model', 'data', 'security', 'operational', 'compliance', 'vendor', 'governance'] },
408
+ status: { type: 'string', enum: ['open', 'in_treatment', 'accepted', 'closed'] },
409
+ treatment: { type: 'string', enum: ['accept', 'mitigate', 'transfer', 'avoid'] },
410
+ page: { type: 'number' },
411
+ },
412
+ },
413
+ },
414
+ {
415
+ name: 'grc_create_risk',
416
+ description: 'Add a risk to the risk register with automatic AIRSS scoring based on 5 factors: attack vector, autonomy level, data sensitivity, impact level, and reversibility.',
417
+ inputSchema: {
418
+ type: 'object',
419
+ properties: {
420
+ title: { type: 'string', description: 'Clear risk title (e.g. "LLM prompt injection via user input")' },
421
+ category: { type: 'string', enum: ['model', 'data', 'security', 'operational', 'compliance', 'vendor', 'governance'] },
422
+ description: { type: 'string', description: 'Detailed risk description and failure modes' },
423
+ attack_vector: { type: 'string', enum: ['network', 'adjacent', 'local', 'physical'] },
424
+ autonomy_level: { type: 'string', enum: ['fully_autonomous', 'semi_autonomous', 'human_assisted', 'advisory'] },
425
+ data_sensitivity: { type: 'string', enum: ['pii_phi_financial', 'internal_confidential', 'internal', 'public'] },
426
+ impact_level: { type: 'string', enum: ['critical', 'significant', 'minor', 'negligible'] },
427
+ reversibility: { type: 'string', enum: ['irreversible', 'difficult', 'easily_reversible'] },
428
+ treatment: { type: 'string', enum: ['accept', 'mitigate', 'transfer', 'avoid'] },
429
+ owner: { type: 'string', description: 'Risk owner (email)' },
430
+ due_date: { type: 'string', description: 'Treatment due date (YYYY-MM-DD)' },
431
+ },
432
+ required: ['title', 'category'],
433
+ },
434
+ },
435
+ {
436
+ name: 'grc_score_risk',
437
+ description: 'Calculate an AIRSS (AI Risk Scoring System) score from 5 factors without creating a risk. Use this to evaluate a risk before deciding whether to log it.',
438
+ inputSchema: {
439
+ type: 'object',
440
+ properties: {
441
+ attack_vector: { type: 'string', enum: ['network', 'adjacent', 'local', 'physical'] },
442
+ autonomy_level: { type: 'string', enum: ['fully_autonomous', 'semi_autonomous', 'human_assisted', 'advisory'] },
443
+ data_sensitivity: { type: 'string', enum: ['pii_phi_financial', 'internal_confidential', 'internal', 'public'] },
444
+ impact_level: { type: 'string', enum: ['critical', 'significant', 'minor', 'negligible'] },
445
+ reversibility: { type: 'string', enum: ['irreversible', 'difficult', 'easily_reversible'] },
446
+ },
447
+ required: ['attack_vector', 'autonomy_level', 'data_sensitivity', 'impact_level', 'reversibility'],
448
+ },
449
+ },
450
+ {
451
+ name: 'grc_generate_report',
452
+ description: 'Generate a compliance report. Available types: soc2_readiness, executive_summary, gap_analysis, risk_register, agent_governance, audit_package. Returns download URL.',
453
+ inputSchema: {
454
+ type: 'object',
455
+ properties: {
456
+ name: { type: 'string', description: 'Report name' },
457
+ type: { type: 'string', enum: ['soc2_readiness', 'executive_summary', 'gap_analysis', 'risk_register', 'agent_governance', 'audit_package'] },
458
+ format: { type: 'string', enum: ['pdf', 'json'], description: 'Output format (default: pdf)' },
459
+ framework_id: { type: 'string', description: 'Optional: scope to a specific framework UUID' },
460
+ },
461
+ required: ['name', 'type'],
462
+ },
463
+ },
464
+ ];
465
+ async function handleTool(name, args) {
466
+ const formatResult = (data) => ({
467
+ content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
468
+ });
469
+ const formatError = (error) => ({
470
+ content: [{
471
+ type: 'text',
472
+ text: `Error: ${error instanceof Error ? error.message : String(error)}`,
473
+ }],
474
+ isError: true,
475
+ });
476
+ try {
477
+ switch (name) {
478
+ case 'grc_list_frameworks': {
479
+ const page = args.page ?? 1;
480
+ const pageSize = args.page_size ?? 20;
481
+ const data = await clawGRCRequest('GET', '/api/v1/frameworks', undefined, {
482
+ page: String(page),
483
+ page_size: String(pageSize),
484
+ });
485
+ return formatResult(data);
486
+ }
487
+ case 'grc_get_compliance_score': {
488
+ const params = {};
489
+ if (args.framework_id)
490
+ params.framework_id = String(args.framework_id);
491
+ const data = await clawGRCRequest('GET', '/api/v1/analytics/compliance-score', undefined, params);
492
+ return formatResult(data);
493
+ }
494
+ case 'grc_get_control_coverage': {
495
+ const data = await clawGRCRequest('GET', '/api/v1/analytics/control-coverage');
496
+ return formatResult(data);
497
+ }
498
+ case 'grc_list_controls': {
499
+ const params = {
500
+ page: String(args.page ?? 1),
501
+ page_size: String(args.page_size ?? 50),
502
+ };
503
+ if (args.framework_id)
504
+ params.framework_id = String(args.framework_id);
505
+ if (args.status)
506
+ params.status = String(args.status);
507
+ const data = await clawGRCRequest('GET', '/api/v1/controls', undefined, params);
508
+ return formatResult(data);
509
+ }
510
+ case 'grc_list_findings': {
511
+ const params = {
512
+ page: String(args.page ?? 1),
513
+ page_size: String(args.page_size ?? 20),
514
+ };
515
+ if (args.severity)
516
+ params.severity = String(args.severity);
517
+ if (args.status)
518
+ params.status = String(args.status);
519
+ if (args.assessment_id)
520
+ params.assessment_id = String(args.assessment_id);
521
+ const data = await clawGRCRequest('GET', '/api/v1/findings', undefined, params);
522
+ return formatResult(data);
523
+ }
524
+ case 'grc_get_findings_summary': {
525
+ const data = await clawGRCRequest('GET', '/api/v1/findings/summary');
526
+ return formatResult(data);
527
+ }
528
+ case 'grc_create_finding': {
529
+ const data = await clawGRCRequest('POST', '/api/v1/findings', args);
530
+ return formatResult(data);
531
+ }
532
+ case 'grc_create_ticket': {
533
+ const data = await clawGRCRequest('POST', '/api/v1/tickets', args);
534
+ return formatResult(data);
535
+ }
536
+ case 'grc_list_agents': {
537
+ const params = {
538
+ page: String(args.page ?? 1),
539
+ page_size: String(args.page_size ?? 20),
540
+ };
541
+ const data = await clawGRCRequest('GET', '/api/v1/agents', undefined, params);
542
+ return formatResult(data);
543
+ }
544
+ case 'grc_get_agent_trust_score': {
545
+ if (!args.agent_id)
546
+ throw new Error('agent_id is required');
547
+ const data = await clawGRCRequest('GET', `/api/v1/trust/${args.agent_id}`);
548
+ return formatResult(data);
549
+ }
550
+ case 'grc_trigger_scan': {
551
+ const data = await clawGRCRequest('POST', '/api/v1/scans', {
552
+ target: args.target,
553
+ type: args.type,
554
+ configuration: args.configuration ?? {},
555
+ });
556
+ return formatResult(data);
557
+ }
558
+ case 'grc_list_evidence': {
559
+ const params = {
560
+ page: String(args.page ?? 1),
561
+ page_size: String(args.page_size ?? 20),
562
+ };
563
+ if (args.control_id)
564
+ params.control_id = String(args.control_id);
565
+ if (args.status)
566
+ params.status = String(args.status);
567
+ const data = await clawGRCRequest('GET', '/api/v1/evidence', undefined, params);
568
+ return formatResult(data);
569
+ }
570
+ case 'grc_submit_evidence': {
571
+ const data = await clawGRCRequest('POST', '/api/v1/evidence', args);
572
+ return formatResult(data);
573
+ }
574
+ case 'grc_list_tickets': {
575
+ const params = {
576
+ page: String(args.page ?? 1),
577
+ page_size: String(args.page_size ?? 20),
578
+ };
579
+ if (args.status)
580
+ params.status = String(args.status);
581
+ if (args.priority)
582
+ params.priority = String(args.priority);
583
+ const data = await clawGRCRequest('GET', '/api/v1/tickets', undefined, params);
584
+ return formatResult(data);
585
+ }
586
+ case 'grc_search': {
587
+ if (!args.query)
588
+ throw new Error('query is required');
589
+ const params = {
590
+ q: String(args.query),
591
+ limit: String(args.limit ?? 30),
592
+ };
593
+ if (Array.isArray(args.types) && args.types.length > 0) {
594
+ params.types = args.types.join(',');
595
+ }
596
+ const data = await clawGRCRequest('GET', '/api/v1/search', undefined, params);
597
+ return formatResult(data);
598
+ }
599
+ case 'grc_list_policies': {
600
+ const params = {
601
+ page: String(args.page ?? 1),
602
+ page_size: String(args.page_size ?? 20),
603
+ };
604
+ if (args.status)
605
+ params.status = String(args.status);
606
+ if (args.type)
607
+ params.type = String(args.type);
608
+ const data = await clawGRCRequest('GET', '/api/v1/policies', undefined, params);
609
+ return formatResult(data);
610
+ }
611
+ case 'grc_create_policy': {
612
+ const data = await clawGRCRequest('POST', '/api/v1/policies', args);
613
+ return formatResult(data);
614
+ }
615
+ case 'grc_list_risks': {
616
+ const params = {
617
+ page: String(args.page ?? 1),
618
+ page_size: String(args.page_size ?? 20),
619
+ };
620
+ if (args.category)
621
+ params.category = String(args.category);
622
+ if (args.status)
623
+ params.status = String(args.status);
624
+ if (args.treatment)
625
+ params.treatment = String(args.treatment);
626
+ const data = await clawGRCRequest('GET', '/api/v1/risks', undefined, params);
627
+ return formatResult(data);
628
+ }
629
+ case 'grc_create_risk': {
630
+ const data = await clawGRCRequest('POST', '/api/v1/risks', args);
631
+ return formatResult(data);
632
+ }
633
+ case 'grc_score_risk': {
634
+ const data = await clawGRCRequest('POST', '/api/v1/risks/score', args);
635
+ return formatResult(data);
636
+ }
637
+ case 'grc_generate_report': {
638
+ const reportData = await clawGRCRequest('POST', '/api/v1/reports', {
639
+ name: args.name,
640
+ type: args.type,
641
+ format: args.format ?? 'pdf',
642
+ framework_id: args.framework_id,
643
+ });
644
+ // Construct the PDF download URL
645
+ const downloadUrl = `${API_URL}/api/reports/${reportData.id}/pdf?type=${args.type}`;
646
+ return formatResult({
647
+ ...reportData,
648
+ download_url: downloadUrl,
649
+ message: `Report generated. Download PDF at: ${downloadUrl}`,
650
+ });
651
+ }
652
+ default:
653
+ throw new Error(`Unknown tool: ${name}`);
654
+ }
655
+ }
656
+ catch (error) {
657
+ return formatError(error);
658
+ }
659
+ }
660
+ // ---------------------------------------------------------------------------
661
+ // MCP Server
662
+ // ---------------------------------------------------------------------------
663
+ const server = new index_js_1.Server({
664
+ name: 'claw-grc',
665
+ version: '1.0.0',
666
+ }, {
667
+ capabilities: {
668
+ tools: {},
669
+ },
670
+ });
671
+ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
672
+ tools: TOOLS,
673
+ }));
674
+ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
675
+ const { name, arguments: args = {} } = request.params;
676
+ return handleTool(name, args);
677
+ });
678
+ // ---------------------------------------------------------------------------
679
+ // Startup
680
+ // ---------------------------------------------------------------------------
681
+ async function main() {
682
+ const transport = new stdio_js_1.StdioServerTransport();
683
+ await server.connect(transport);
684
+ // Log to stderr so it doesn't interfere with MCP protocol on stdout
685
+ console.error(`Claw GRC MCP Server v1.0.0 running`);
686
+ console.error(`Connected to: ${API_URL}`);
687
+ console.error(`Tools available: ${TOOLS.length}`);
688
+ }
689
+ main().catch((error) => {
690
+ console.error('Fatal error:', error);
691
+ process.exit(1);
692
+ });
693
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA;;;;;;;;;GASG;;AAEH,wEAAmE;AACnE,wEAAiF;AACjF,iEAI4C;AAE5C,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E;AAE9E,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,y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GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IACtD,OAAO,UAAU,CAAC,IAAI,EAAE,IAA+B,CAAC,CAAC;AAC3D,CAAC,CAAC,CAAC;AAEH,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,oEAAoE;IACpE,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACpD,OAAO,CAAC,KAAK,CAAC,iBAAiB,OAAO,EAAE,CAAC,CAAC;IAC1C,OAAO,CAAC,KAAK,CAAC,oBAAoB,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "claw-grc-mcp-server",
3
+ "version": "1.0.0",
4
+ "description": "Official MCP (Model Context Protocol) server for Claw GRC \u2014 the AI-native GRC platform. Connect any MCP-compatible AI assistant to your compliance data.",
5
+ "keywords": [
6
+ "mcp",
7
+ "model-context-protocol",
8
+ "grc",
9
+ "compliance",
10
+ "soc2",
11
+ "iso27001",
12
+ "ai-governance",
13
+ "security",
14
+ "openai",
15
+ "claude",
16
+ "anthropic"
17
+ ],
18
+ "author": "One Frequency Inc <dev@onefrequency.ai>",
19
+ "license": "Apache-2.0",
20
+ "homepage": "https://clawgrc.com/mcp",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://github.com/onefrequency/claw-grc-mcp-server"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/onefrequency/claw-grc-mcp-server/issues"
27
+ },
28
+ "bin": {
29
+ "claw-grc-mcp": "./dist/index.js"
30
+ },
31
+ "main": "./dist/index.js",
32
+ "types": "./dist/index.d.ts",
33
+ "files": [
34
+ "dist",
35
+ "README.md",
36
+ "LICENSE"
37
+ ],
38
+ "scripts": {
39
+ "build": "tsc",
40
+ "dev": "ts-node src/index.ts",
41
+ "start": "node dist/index.js",
42
+ "test": "vitest run",
43
+ "lint": "eslint src --ext .ts",
44
+ "prepublishOnly": "npm run build"
45
+ },
46
+ "dependencies": {
47
+ "@modelcontextprotocol/sdk": "^1.0.0",
48
+ "node-fetch": "^3.0.0",
49
+ "zod": "^3.22.0"
50
+ },
51
+ "devDependencies": {
52
+ "@types/node": "^20.0.0",
53
+ "typescript": "^5.4.0",
54
+ "vitest": "^1.0.0"
55
+ },
56
+ "engines": {
57
+ "node": ">=18.0.0"
58
+ }
59
+ }