vanta-auditor-api-mcp 0.1.0 → 0.1.2
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 +77 -20
- package/bin/mcp-server.js +665 -216
- package/bin/mcp-server.js.map +70 -69
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -9,8 +9,8 @@ people and assets. If you allow it, they can also comment, update information
|
|
|
9
9
|
requests, review evidence and assess controls.
|
|
10
10
|
|
|
11
11
|
Vanta checks your firm's permissions and audit access on every call. The server
|
|
12
|
-
gets and renews its own access token, and
|
|
13
|
-
|
|
12
|
+
gets and renews its own access token, and keeps your client secret and that
|
|
13
|
+
token out of its own error messages.
|
|
14
14
|
|
|
15
15
|
> **⚠️ Important disclaimer:** This server is experimental. You may encounter
|
|
16
16
|
> bugs, errors or unexpected results. Always verify the accuracy and
|
|
@@ -147,6 +147,9 @@ The examples use the server name `vanta-auditor`. Tool names in your client then
|
|
|
147
147
|
start with that name, for example `mcp__vanta-auditor__audits-list-audits` in
|
|
148
148
|
Claude Code.
|
|
149
149
|
|
|
150
|
+
Most clients load MCP servers when a session starts. After you add or change
|
|
151
|
+
the server, start a new session.
|
|
152
|
+
|
|
150
153
|
### Claude Code
|
|
151
154
|
|
|
152
155
|
Add `.mcp.json` to your project. Claude Code expands `${VAR}` from the
|
|
@@ -192,10 +195,10 @@ of `command`, `args` and `env_vars`. Run `codex mcp list` to check the
|
|
|
192
195
|
configuration. In `codex exec`, set `default_tools_approval_mode = "approve"`
|
|
193
196
|
on the server if the agent must call tools without asking.
|
|
194
197
|
|
|
195
|
-
###
|
|
198
|
+
### Cursor
|
|
196
199
|
|
|
197
|
-
|
|
198
|
-
|
|
200
|
+
Add the server to `.cursor/mcp.json` in your project, or to `~/.cursor/mcp.json`
|
|
201
|
+
for every project. Cursor expands `${env:NAME}`:
|
|
199
202
|
|
|
200
203
|
```json
|
|
201
204
|
{
|
|
@@ -204,16 +207,26 @@ the client after you change the file.
|
|
|
204
207
|
"command": "npx",
|
|
205
208
|
"args": ["-y", "vanta-auditor-api-mcp@<version>", "start", "--scope", "read"],
|
|
206
209
|
"env": {
|
|
207
|
-
"VANTA_CLIENT_ID": "${VANTA_CLIENT_ID}",
|
|
208
|
-
"VANTA_CLIENT_SECRET": "${VANTA_CLIENT_SECRET}"
|
|
210
|
+
"VANTA_CLIENT_ID": "${env:VANTA_CLIENT_ID}",
|
|
211
|
+
"VANTA_CLIENT_SECRET": "${env:VANTA_CLIENT_SECRET}"
|
|
209
212
|
}
|
|
210
213
|
}
|
|
211
214
|
}
|
|
212
215
|
}
|
|
213
216
|
```
|
|
214
217
|
|
|
215
|
-
|
|
216
|
-
|
|
218
|
+
### Claude Desktop and other clients
|
|
219
|
+
|
|
220
|
+
Clients that use an `mcpServers` JSON file accept the same configuration with
|
|
221
|
+
`command`, `args` and `env`. Restart the client after you change the file.
|
|
222
|
+
|
|
223
|
+
Check your client's documentation for how it expands environment variables. If
|
|
224
|
+
it can't, don't write the secret into the file. Start the client from a
|
|
225
|
+
launcher that injects the variables from your secret manager. A client that
|
|
226
|
+
runs on your network can instead use a
|
|
227
|
+
[private service](#run-as-a-private-service-streamable-http) URL. Claude
|
|
228
|
+
Desktop's remote connectors connect from Anthropic's cloud, so they can't reach
|
|
229
|
+
a private network.
|
|
217
230
|
|
|
218
231
|
To install the package once instead of with `npx` at every start, run
|
|
219
232
|
`npm install -g vanta-auditor-api-mcp@<version>`, then use
|
|
@@ -221,8 +234,10 @@ To install the package once instead of with `npx` at every start, run
|
|
|
221
234
|
|
|
222
235
|
### Claude Agent SDK (Python)
|
|
223
236
|
|
|
224
|
-
Install the SDK with `pip install claude-agent-sdk`. It needs
|
|
225
|
-
Anthropic credentials
|
|
237
|
+
Install the SDK with `pip install claude-agent-sdk`. It needs Python 3.10 or
|
|
238
|
+
later and Anthropic credentials. Packages built for your platform include the
|
|
239
|
+
Claude Code CLI; if pip builds the SDK from source, install Claude Code too.
|
|
240
|
+
See the
|
|
226
241
|
[Agent SDK documentation](https://code.claude.com/docs/en/agent-sdk).
|
|
227
242
|
|
|
228
243
|
```python
|
|
@@ -292,9 +307,14 @@ private service, import `MCPServerStreamableHttp` from `agents.mcp` and use
|
|
|
292
307
|
A connection alone doesn't prove that the credentials work, because the server
|
|
293
308
|
requests a token only on the first tool call. After setup:
|
|
294
309
|
|
|
295
|
-
1. **List the tools.** `audits-list-audits` is present.
|
|
296
|
-
every tool has the annotation
|
|
297
|
-
|
|
310
|
+
1. **List the tools.** `audits-list-audits` is present. Without `--mode dynamic`
|
|
311
|
+
and with `--scope read`, every tool has the annotation
|
|
312
|
+
`readOnlyHint: true`. With `--mode dynamic`,
|
|
313
|
+
call `list_tools` instead, and check that the result includes
|
|
314
|
+
`audits-list-audits`.
|
|
315
|
+
2. **Call `audits-list-audits`** with `{}` (with `--mode dynamic`, call
|
|
316
|
+
`execute_tool` with `{"name": "audits-list-audits", "arguments": {}}`). The
|
|
317
|
+
call succeeds, and the JSON
|
|
298
318
|
text of the result has `results.data` with audits assigned to your firm.
|
|
299
319
|
The list has pages; see [Use the tools](#use-the-tools).
|
|
300
320
|
|
|
@@ -302,7 +322,8 @@ If the call succeeds but returns no audits, check that your firm has an active
|
|
|
302
322
|
audit in Vanta. If it fails, see [Troubleshooting](#troubleshooting).
|
|
303
323
|
|
|
304
324
|
To check from code before you give the tools to a model, call the server
|
|
305
|
-
directly. With the OpenAI Agents SDK
|
|
325
|
+
directly. With the OpenAI Agents SDK and without `--mode dynamic`, inside the
|
|
326
|
+
`async with` block:
|
|
306
327
|
|
|
307
328
|
```python
|
|
308
329
|
import json
|
|
@@ -493,6 +514,24 @@ Calling conventions:
|
|
|
493
514
|
`audits-list-information-requests` for that audit, then
|
|
494
515
|
`audits-list-information-request-evidence` for a request.
|
|
495
516
|
- **Some tools work only for classic audits.** Their descriptions say so.
|
|
517
|
+
- **Failed API calls return the HTTP status.** When Vanta answers with an error,
|
|
518
|
+
the tool result is
|
|
519
|
+
`{"status": <HTTP status>, "retryAfter": "<Retry-After header>", "error": <Vanta's response>}`.
|
|
520
|
+
`retryAfter` appears only when Vanta sends it, in seconds or as an HTTP date.
|
|
521
|
+
Input, token and connection errors return a plain message instead.
|
|
522
|
+
- **Rate limits and transient failures are retried for you.** Each tool's
|
|
523
|
+
description gives its rate limit; many allow 10 requests a minute. Read tools
|
|
524
|
+
retry 429, 502, 503 and 504 responses and connection errors. Write tools retry
|
|
525
|
+
only 429 responses, because Vanta didn't process those, and a retried 5xx
|
|
526
|
+
could repeat a write. Retries honor `Retry-After`, wait at most 10 seconds
|
|
527
|
+
between attempts, and don't start after 25 seconds, so a call usually returns
|
|
528
|
+
within about 40 seconds. If a call still returns status 429, wait as long as
|
|
529
|
+
`retryAfter` says before you call that tool again.
|
|
530
|
+
- **For bulk operations, use a script.** To create or update many records,
|
|
531
|
+
call the tools from code with an MCP client library, as in
|
|
532
|
+
[Check that it works](#check-that-it-works), or use the
|
|
533
|
+
[`vanta-auditor-api-sdk`](https://www.npmjs.com/package/vanta-auditor-api-sdk)
|
|
534
|
+
package directly, rather than one model turn per record.
|
|
496
535
|
|
|
497
536
|
Example requests that you can give an agent:
|
|
498
537
|
|
|
@@ -588,7 +627,7 @@ for the full list.
|
|
|
588
627
|
| `--tool <name>` | Lists only the named tools. Repeat it for more than one. |
|
|
589
628
|
| `--port <port>` | `serve`: the HTTP port. Default: `2718`. |
|
|
590
629
|
| `--disable-static-auth` | `serve`: each caller must send its own token in a `bearer-auth` header, and the server never uses its own credentials. The caller must replace that token before it expires. |
|
|
591
|
-
| `--log-level <level>` | `debug`, `info` (default), `warning` or `error`.
|
|
630
|
+
| `--log-level <level>` | `debug`, `info` (default), `warning` or `error`. Server logs go to stderr; debug request logs go to stdout. |
|
|
592
631
|
|
|
593
632
|
**Don't put secrets in command-line options.** Other processes on the host can
|
|
594
633
|
read them. Use environment variables instead of `--bearer-auth` or
|
|
@@ -601,8 +640,11 @@ bodies. Over stdio, it can also corrupt the connection to the client.
|
|
|
601
640
|
## Security and data
|
|
602
641
|
|
|
603
642
|
- **Credentials.** The server sends the client secret only to `/oauth/token`
|
|
604
|
-
on the API host that `--server-url` sets, which is Vanta's by default.
|
|
605
|
-
|
|
643
|
+
on the API host that `--server-url` sets, which is Vanta's by default. Its
|
|
644
|
+
own error messages, such as failed token requests, contain neither the secret
|
|
645
|
+
nor the tokens it obtains. A failed API call returns Vanta's response body
|
|
646
|
+
unchanged. If you supply `VANTA_BEARER_AUTH`, check its value: a malformed
|
|
647
|
+
token can appear in an error.
|
|
606
648
|
- **Audit data reaches the model.** Tool results contain your customers' audit
|
|
607
649
|
data. Check that your model provider's data handling meets your firm's
|
|
608
650
|
requirements.
|
|
@@ -634,7 +676,8 @@ history on npm for what changed.
|
|
|
634
676
|
**No tools appear, or write tools are missing**
|
|
635
677
|
|
|
636
678
|
- Check the `--scope` options. `--scope read` lists only read tools.
|
|
637
|
-
-
|
|
679
|
+
- Start a new session after a configuration change. Most clients load MCP
|
|
680
|
+
servers only when a session starts.
|
|
638
681
|
|
|
639
682
|
**The first tool call fails**
|
|
640
683
|
|
|
@@ -659,7 +702,21 @@ history on npm for what changed.
|
|
|
659
702
|
**A call fails with 403, or an audit you expect is missing**
|
|
660
703
|
|
|
661
704
|
The token lacks the scope that the tool needs, or your firm can't access that
|
|
662
|
-
audit. Check the audit's assignment in Vanta
|
|
705
|
+
audit or that data. Check the audit's assignment in Vanta, and whether the
|
|
706
|
+
customer restricts what auditors can see or hasn't shared the data yet.
|
|
707
|
+
|
|
708
|
+
**A call fails with status 429**
|
|
709
|
+
|
|
710
|
+
The tool's rate limit was still exceeded after about 25 seconds of retries.
|
|
711
|
+
Wait as long as `retryAfter` in the result says, and space out calls to that
|
|
712
|
+
tool. For
|
|
713
|
+
many calls, see the bulk-operations note in [Use the tools](#use-the-tools).
|
|
714
|
+
|
|
715
|
+
**`audits-duplicate` fails with status 404**
|
|
716
|
+
|
|
717
|
+
Check that the source audit exists and is an IRL audit. If it is, audit
|
|
718
|
+
duplication may not be enabled for your firm; contact your Vanta
|
|
719
|
+
representative.
|
|
663
720
|
|
|
664
721
|
## Get help
|
|
665
722
|
|