@lindblad/complai-mcp 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +87 -232
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,227 +1,69 @@
1
1
  # COMPLAI MCP Server
2
2
 
3
- An MCP (Model Context Protocol) server that provides compliance overview data to AI assistants.
3
+ An MCP (Model Context Protocol) server that provides COMPLAI compliance data to AI assistants like Cursor and Claude Desktop.
4
4
 
5
5
  **Package:** `@lindblad/complai-mcp`
6
6
 
7
- ## Features
7
+ ## Quick Start
8
8
 
9
- - **Compliance overview**: `complai_compliance_brief` - Get organization-wide compliance status
10
- - **User authentication**: Log in with your COMPLAI credentials via browser (no secrets needed)
11
- - **M2M authentication**: Alternative machine-to-machine auth for automation
12
- - **AI-optimized responses**: Structured data with human-readable alerts
13
- - **Mock mode**: Test without API credentials
14
- - **Persistent sessions**: Login is saved locally - no need to re-authenticate
15
-
16
- ## Installation
17
-
18
- ### From npm (Recommended)
19
-
20
- ```bash
21
- # Install globally
22
- npm install -g @lindblad/complai-mcp
23
-
24
- # Or run directly with npx
25
- npx @lindblad/complai-mcp
26
- ```
27
-
28
- ### From Source
29
-
30
- ```bash
31
- git clone <repo-url>
32
- cd mcps/complai-brief
33
- npm install
34
- npm run build
35
- ```
36
-
37
- ## Quick Start with Cursor/Claude Desktop
38
-
39
- ### Using npx (Easiest)
40
-
41
- Add to your MCP configuration (`.cursor/mcp.json` or `claude_desktop_config.json`):
9
+ Add to your Cursor config (`.cursor/mcp.json`):
42
10
 
43
11
  ```json
44
12
  {
45
13
  "mcpServers": {
46
14
  "complai": {
47
15
  "command": "npx",
48
- "args": ["@lindblad/complai-mcp"],
49
- "env": {
50
- "COMPLAI_API_URL": "https://api.complai.com",
51
- "COMPLAI_AUTH0_DOMAIN": "lindcon.eu.auth0.com",
52
- "COMPLAI_AUTH0_CLIENT_ID": "your-client-id",
53
- "COMPLAI_AUTH0_AUDIENCE": "https://api.complai.com",
54
- "COMPLAI_ORGANIZATION_ID": "org_xxxxx"
55
- }
16
+ "args": ["-y", "@lindblad/complai-mcp"]
56
17
  }
57
18
  }
58
19
  }
59
20
  ```
60
21
 
61
- ### Using Global Install
62
-
63
- ```json
64
- {
65
- "mcpServers": {
66
- "complai": {
67
- "command": "complai-mcp",
68
- "env": {
69
- "COMPLAI_API_URL": "https://api.complai.com",
70
- "COMPLAI_AUTH0_DOMAIN": "lindcon.eu.auth0.com",
71
- "COMPLAI_AUTH0_CLIENT_ID": "your-client-id",
72
- "COMPLAI_AUTH0_AUDIENCE": "https://api.complai.com",
73
- "COMPLAI_ORGANIZATION_ID": "org_xxxxx"
74
- }
75
- }
76
- }
77
- }
78
- ```
79
-
80
- ## Authentication Modes
81
-
82
- ### User Authentication (Recommended)
22
+ That's it! No configuration needed.
83
23
 
84
- No client secret required. Users authenticate via browser using their COMPLAI credentials.
85
-
86
- 1. Configure without `COMPLAI_AUTH0_CLIENT_SECRET`:
87
-
88
- ```json
89
- {
90
- "mcpServers": {
91
- "complai": {
92
- "command": "npx",
93
- "args": ["@lindblad/complai-mcp"],
94
- "env": {
95
- "COMPLAI_API_URL": "https://api.complai.com",
96
- "COMPLAI_AUTH0_DOMAIN": "lindcon.eu.auth0.com",
97
- "COMPLAI_AUTH0_CLIENT_ID": "your-client-id",
98
- "COMPLAI_AUTH0_AUDIENCE": "https://api.complai.com",
99
- "COMPLAI_ORGANIZATION_ID": "org_xxxxx"
100
- }
101
- }
102
- }
103
- }
104
- ```
105
-
106
- 2. When you first use a COMPLAI tool, use `complai_login`:
107
- - You'll get a URL and code
108
- - Open the URL in your browser
109
- - Enter the code and log in with your COMPLAI credentials
110
- - Done! Your session is saved to `~/.complai/`
111
-
112
- ### M2M Authentication (For Automation)
113
-
114
- For scripts, CI/CD, or shared environments. Requires a client secret.
115
-
116
- ```json
117
- {
118
- "mcpServers": {
119
- "complai": {
120
- "command": "npx",
121
- "args": ["@lindblad/complai-mcp"],
122
- "env": {
123
- "COMPLAI_API_URL": "https://api.complai.com",
124
- "COMPLAI_AUTH0_DOMAIN": "lindcon.eu.auth0.com",
125
- "COMPLAI_AUTH0_CLIENT_ID": "your-m2m-client-id",
126
- "COMPLAI_AUTH0_CLIENT_SECRET": "your-m2m-client-secret",
127
- "COMPLAI_AUTH0_AUDIENCE": "https://api.complai.com",
128
- "COMPLAI_ORGANIZATION_ID": "org_xxxxx"
129
- }
130
- }
131
- }
132
- }
133
- ```
134
-
135
- ### Mock Mode
136
-
137
- For testing without any API connection:
138
-
139
- ```json
140
- {
141
- "mcpServers": {
142
- "complai": {
143
- "command": "npx",
144
- "args": ["@lindblad/complai-mcp"],
145
- "env": {
146
- "COMPLAI_MOCK_MODE": "true"
147
- }
148
- }
149
- }
150
- }
151
- ```
24
+ ## Available Tools
152
25
 
153
- ## Authentication Flow
26
+ | Tool | Description |
27
+ |------|-------------|
28
+ | `complai_login` | Authenticate with COMPLAI (opens browser) |
29
+ | `complai_auth_status` | Check authentication status |
30
+ | `complai_list_organizations` | List organizations you have access to |
31
+ | `complai_compliance_brief` | Get compliance overview (risk, tasks, alerts) |
32
+ | `complai_audit_rooms` | Get detailed audit room data with status |
154
33
 
155
- ### First Time Setup (User Auth Mode)
34
+ ## Usage
156
35
 
157
- When you start the server for the first time, it will prompt for authentication:
36
+ Just ask your AI assistant:
158
37
 
159
- ```
160
- COMPLAI MCP Server v0.1.0
161
- ─────────────────────────
162
- API: https://api.test.complai.com
163
- Auth: User (Device Flow)
164
-
165
- Authentication required. Starting device authorization flow...
166
-
167
- ┌─────────────────────────────────────────────────────────────┐
168
- │ Please complete authentication in your browser: │
169
- │ │
170
- │ 1. Open: https://complai-test.eu.auth0.com/activate │
171
- │ 2. Enter: ABCD-EFGH │
172
- │ │
173
- │ Waiting for authentication... │
174
- └─────────────────────────────────────────────────────────────┘
175
-
176
- ✓ Authentication successful!
177
-
178
- Starting server...
179
- ✓ Server ready
180
- ```
38
+ - *"What's my compliance status?"*
39
+ - *"Show me all audit rooms with their risk ratings"*
40
+ - *"Which audit rooms have overdue tasks?"*
41
+ - *"Give me a compliance summary for my board meeting"*
181
42
 
182
- After logging in once, your session is saved to `~/.complai/` and you won't need to log in again.
43
+ ### First Time Authentication
183
44
 
184
- ### Logging Out
45
+ On first use, you'll need to authenticate:
185
46
 
186
- To log out, delete the stored credentials:
187
- ```bash
188
- rm -rf ~/.complai/.credentials.enc
189
- ```
47
+ 1. The AI will call `complai_login`
48
+ 2. A browser window opens for you to log in with your COMPLAI credentials
49
+ 3. Done! Your session is saved locally
190
50
 
191
- ## Available Tools
192
-
193
- ### `complai_list_organizations`
194
-
195
- List all COMPLAI organizations the user has access to.
51
+ ### Multi-Organization Support
196
52
 
197
- **Parameters:** None
198
-
199
- **Response:**
200
- ```json
201
- {
202
- "organizations": [
203
- { "id": "org_xxx", "name": "Acme Corp" },
204
- { "id": "org_yyy", "name": "Beta Inc" }
205
- ],
206
- "message": "User has access to 2 organizations. Ask which one to check."
207
- }
208
- ```
53
+ If you have access to multiple organizations:
209
54
 
210
- ### `complai_compliance_brief`
55
+ 1. Call `complai_list_organizations` to see available orgs
56
+ 2. Call `complai_login` with the `organizationId` to switch orgs
57
+ 3. Then use `complai_compliance_brief` or `complai_audit_rooms`
211
58
 
212
- Get compliance status overview for a specific organization.
59
+ ## Example Output
213
60
 
214
- **Parameters:**
215
- | Parameter | Type | Required | Description |
216
- |-----------|------|----------|-------------|
217
- | `organizationId` | string | Yes | The organization ID (from `complai_list_organizations`) |
218
- | `workspaceId` | string | No | Filter results to a specific workspace |
61
+ ### Compliance Brief
219
62
 
220
- **Response:**
221
63
  ```json
222
64
  {
223
65
  "summary": {
224
- "description": "Compliance overview as of 2026-01-15",
66
+ "description": "Compliance overview as of 2026-02-04",
225
67
  "dataRooms": 24,
226
68
  "assets": 156,
227
69
  "manufacturers": 42,
@@ -246,58 +88,71 @@ Get compliance status overview for a specific organization.
246
88
  }
247
89
  ```
248
90
 
249
- ## Development
250
-
251
- ### Testing with MCP Inspector
91
+ ### Audit Rooms
252
92
 
253
- ```bash
254
- npm run inspector
93
+ ```json
94
+ {
95
+ "pagination": { "page": 1, "pageSize": 20, "totalCount": 24 },
96
+ "rooms": [
97
+ {
98
+ "name": "Supplier ABC Audit",
99
+ "riskRating": "Medium",
100
+ "engagement": "In Progress",
101
+ "assetsCount": 5,
102
+ "manufacturer": "ABC Corp",
103
+ "taskCompletion": [
104
+ { "template": "ISO 27001", "status": "Completed" },
105
+ { "template": "GDPR", "status": "In Progress" }
106
+ ]
107
+ }
108
+ ]
109
+ }
255
110
  ```
256
111
 
257
- ### Project Structure
112
+ ## Configuration (Optional)
258
113
 
259
- ```
260
- complai-brief/
261
- ├── src/
262
- │ ├── index.ts # MCP server entry point
263
- │ ├── types.ts # TypeScript interfaces
264
- │ ├── tools/
265
- │ │ └── compliance-brief.ts # Tool implementation
266
- │ ├── auth/
267
- │ │ ├── token-manager.ts # Unified token management
268
- │ │ └── device-auth.ts # Device authorization flow
269
- │ ├── api/
270
- │ │ └── complai-client.ts # API client
271
- │ └── config/
272
- │ └── config-loader.ts # Configuration loading
273
- ├── package.json
274
- ├── tsconfig.json
275
- └── README.md
276
- ```
114
+ Defaults connect to COMPLAI test environment. Override with environment variables:
277
115
 
278
- ## Error Handling
116
+ | Variable | Description |
117
+ |----------|-------------|
118
+ | `COMPLAI_API_URL` | API base URL |
119
+ | `COMPLAI_AUTH0_DOMAIN` | Auth0 domain |
120
+ | `COMPLAI_AUTH0_CLIENT_ID` | Auth0 client ID |
121
+ | `COMPLAI_AUTH0_AUDIENCE` | Auth0 audience |
122
+ | `COMPLAI_ORGANIZATION_ID` | Default organization ID |
279
123
 
280
- The server returns AI-friendly error messages:
124
+ Example with custom config:
281
125
 
282
- | Error | Message |
283
- |-------|---------|
284
- | Authentication failed | "Authentication failed. Check your client credentials." |
285
- | Network error | "Cannot reach COMPLAI API. Check your network connection." |
286
- | Rate limited | "Rate limit exceeded. Try again in X seconds." |
287
- | Permission denied | "You don't have access to this organization." |
126
+ ```json
127
+ {
128
+ "mcpServers": {
129
+ "complai": {
130
+ "command": "npx",
131
+ "args": ["-y", "@lindblad/complai-mcp"],
132
+ "env": {
133
+ "COMPLAI_API_URL": "https://api.complai.com",
134
+ "COMPLAI_AUTH0_DOMAIN": "login.complai.com"
135
+ }
136
+ }
137
+ }
138
+ }
139
+ ```
288
140
 
289
141
  ## Security
290
142
 
291
- - **User auth mode**: Refresh tokens are stored encrypted in `~/.complai/` with AES-256-GCM
292
- - **M2M mode**: Client secrets should be stored securely (environment variables recommended)
293
- - Encryption keys are stored with restrictive permissions (600)
294
- - Access tokens are cached in memory only (not persisted)
143
+ - Credentials are stored encrypted in `~/.complai/` (AES-256-GCM)
144
+ - Access tokens are cached in memory only
295
145
  - All API calls use HTTPS
296
- - MCP respects the same permissions as the COMPLAI web UI
146
+ - Permissions match the COMPLAI web UI
147
+
148
+ ## Troubleshooting
149
+
150
+ **"Not authenticated"** - Run `complai_login` first
151
+
152
+ **"No organizations found"** - Your COMPLAI account may not have any org memberships
153
+
154
+ **"Access denied"** - You don't have permission for that organization
297
155
 
298
- ### Stored Files (User Auth Mode)
156
+ ## License
299
157
 
300
- | File | Purpose |
301
- |------|---------|
302
- | `~/.complai/.credentials.enc` | Encrypted refresh token |
303
- | `~/.complai/.key` | Encryption key (600 permissions) |
158
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lindblad/complai-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "MCP server providing COMPLAI compliance overview tools for AI assistants",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",