@vettly/mcp 0.1.4 → 0.1.5
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 +198 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
# @vettly/mcp
|
|
2
2
|
|
|
3
|
-
MCP server for Vettly decision infrastructure. Enables AI assistants to make governed, auditable decisions
|
|
3
|
+
MCP server for Vettly decision infrastructure. Enables AI assistants to make policy-governed, auditable content decisions.
|
|
4
|
+
|
|
5
|
+
## Why MCP for Content Decisions?
|
|
6
|
+
|
|
7
|
+
AI assistants are increasingly used in content creation and moderation workflows. With the Vettly MCP server:
|
|
8
|
+
|
|
9
|
+
- **Governed decisions** - AI assistants check content against your explicit policies
|
|
10
|
+
- **Audit trail** - Every decision made by AI is recorded with a decision ID
|
|
11
|
+
- **Policy access** - Assistants can view and validate your policy configurations
|
|
12
|
+
- **Usage visibility** - Check usage stats and recent decisions
|
|
4
13
|
|
|
5
14
|
## Installation
|
|
6
15
|
|
|
7
16
|
```bash
|
|
8
|
-
npm install @vettly/mcp
|
|
9
|
-
# or
|
|
17
|
+
npm install -g @vettly/mcp
|
|
18
|
+
# or run directly
|
|
10
19
|
npx @vettly/mcp
|
|
11
20
|
```
|
|
12
21
|
|
|
@@ -16,6 +25,9 @@ npx @vettly/mcp
|
|
|
16
25
|
|
|
17
26
|
Add to your `claude_desktop_config.json`:
|
|
18
27
|
|
|
28
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
29
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
30
|
+
|
|
19
31
|
```json
|
|
20
32
|
{
|
|
21
33
|
"mcpServers": {
|
|
@@ -23,7 +35,7 @@ Add to your `claude_desktop_config.json`:
|
|
|
23
35
|
"command": "npx",
|
|
24
36
|
"args": ["-y", "@vettly/mcp"],
|
|
25
37
|
"env": {
|
|
26
|
-
"VETTLY_API_KEY": "
|
|
38
|
+
"VETTLY_API_KEY": "sk_live_xxx"
|
|
27
39
|
}
|
|
28
40
|
}
|
|
29
41
|
}
|
|
@@ -32,33 +44,55 @@ Add to your `claude_desktop_config.json`:
|
|
|
32
44
|
|
|
33
45
|
### Environment Variables
|
|
34
46
|
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
| Variable | Required | Description |
|
|
48
|
+
|----------|----------|-------------|
|
|
49
|
+
| `VETTLY_API_KEY` | Yes | Your Vettly API key |
|
|
50
|
+
| `VETTLY_API_URL` | No | Custom API URL (default: `https://api.vettly.dev`) |
|
|
51
|
+
|
|
52
|
+
---
|
|
37
53
|
|
|
38
54
|
## Available Tools
|
|
39
55
|
|
|
40
56
|
### `moderate_content`
|
|
41
57
|
|
|
42
|
-
Check content against a Vettly decision
|
|
58
|
+
Check content against a Vettly policy. Returns a decision with full audit trail.
|
|
43
59
|
|
|
44
60
|
**Parameters:**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
| Name | Type | Required | Description |
|
|
62
|
+
|------|------|----------|-------------|
|
|
63
|
+
| `content` | string | Yes | The content to check |
|
|
64
|
+
| `policyId` | string | Yes | Policy ID to apply |
|
|
65
|
+
| `contentType` | string | No | `text`, `image`, or `video` (default: `text`) |
|
|
48
66
|
|
|
49
|
-
**Example:**
|
|
67
|
+
**Example prompts:**
|
|
50
68
|
```
|
|
51
|
-
|
|
69
|
+
Check if this text is safe: "Hello world" using the "community-safe" policy
|
|
70
|
+
|
|
71
|
+
Moderate this user comment using my default-policy:
|
|
72
|
+
"This product is terrible and the company should be ashamed"
|
|
73
|
+
|
|
74
|
+
Is this image appropriate for my platform? Use the strict policy.
|
|
75
|
+
[image URL]
|
|
52
76
|
```
|
|
53
77
|
|
|
78
|
+
**Response includes:**
|
|
79
|
+
- `decisionId` - Unique ID for audit trail
|
|
80
|
+
- `action` - `allow`, `warn`, `flag`, or `block`
|
|
81
|
+
- `categories` - Array of category scores and thresholds
|
|
82
|
+
- `safe` / `flagged` - Boolean indicators
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
54
86
|
### `validate_policy`
|
|
55
87
|
|
|
56
|
-
Validate a policy YAML without saving it.
|
|
88
|
+
Validate a policy YAML without saving it. Useful for testing policy changes.
|
|
57
89
|
|
|
58
90
|
**Parameters:**
|
|
59
|
-
|
|
91
|
+
| Name | Type | Required | Description |
|
|
92
|
+
|------|------|----------|-------------|
|
|
93
|
+
| `yamlContent` | string | Yes | The YAML policy content |
|
|
60
94
|
|
|
61
|
-
**Example:**
|
|
95
|
+
**Example prompts:**
|
|
62
96
|
```
|
|
63
97
|
Validate this policy YAML:
|
|
64
98
|
name: my-policy
|
|
@@ -66,57 +100,188 @@ rules:
|
|
|
66
100
|
- category: hate_speech
|
|
67
101
|
threshold: 0.7
|
|
68
102
|
action: block
|
|
103
|
+
|
|
104
|
+
Check if this policy configuration is valid:
|
|
105
|
+
[paste YAML]
|
|
69
106
|
```
|
|
70
107
|
|
|
108
|
+
**Response includes:**
|
|
109
|
+
- `valid` - Boolean indicating if policy is valid
|
|
110
|
+
- `errors` - Array of validation errors (if any)
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
71
114
|
### `list_policies`
|
|
72
115
|
|
|
73
|
-
List all available
|
|
116
|
+
List all available policies in your account.
|
|
74
117
|
|
|
75
118
|
**Parameters:** None
|
|
76
119
|
|
|
120
|
+
**Example prompts:**
|
|
121
|
+
```
|
|
122
|
+
What policies do I have configured?
|
|
123
|
+
|
|
124
|
+
List my Vettly policies
|
|
125
|
+
|
|
126
|
+
Show me all available moderation policies
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Response includes:**
|
|
130
|
+
- Array of policies with `id`, `name`, `version`, `updatedAt`
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
77
134
|
### `get_usage_stats`
|
|
78
135
|
|
|
79
|
-
Get usage statistics
|
|
136
|
+
Get usage statistics for your account.
|
|
80
137
|
|
|
81
138
|
**Parameters:**
|
|
82
|
-
|
|
139
|
+
| Name | Type | Required | Description |
|
|
140
|
+
|------|------|----------|-------------|
|
|
141
|
+
| `days` | number | No | Days to include (1-365, default: 30) |
|
|
142
|
+
|
|
143
|
+
**Example prompts:**
|
|
144
|
+
```
|
|
145
|
+
How many moderation requests have I made this month?
|
|
146
|
+
|
|
147
|
+
Show my Vettly usage for the last 7 days
|
|
148
|
+
|
|
149
|
+
What's my content moderation cost so far?
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Response includes:**
|
|
153
|
+
- Request counts by content type
|
|
154
|
+
- Cost breakdown
|
|
155
|
+
- Decision outcome distribution
|
|
156
|
+
|
|
157
|
+
---
|
|
83
158
|
|
|
84
159
|
### `get_recent_decisions`
|
|
85
160
|
|
|
86
|
-
Get recent decisions with optional filtering.
|
|
161
|
+
Get recent moderation decisions with optional filtering.
|
|
87
162
|
|
|
88
163
|
**Parameters:**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
164
|
+
| Name | Type | Required | Description |
|
|
165
|
+
|------|------|----------|-------------|
|
|
166
|
+
| `limit` | number | No | Results to return (1-50, default: 10) |
|
|
167
|
+
| `flagged` | boolean | No | Filter by flagged status |
|
|
168
|
+
| `policyId` | string | No | Filter by policy ID |
|
|
169
|
+
| `contentType` | string | No | Filter by content type |
|
|
170
|
+
|
|
171
|
+
**Example prompts:**
|
|
172
|
+
```
|
|
173
|
+
Show me the last 10 blocked content decisions
|
|
174
|
+
|
|
175
|
+
What content was flagged recently?
|
|
176
|
+
|
|
177
|
+
List recent moderation decisions for the community-safe policy
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**Response includes:**
|
|
181
|
+
- Array of decisions with `id`, `action`, `categories`, `createdAt`
|
|
182
|
+
|
|
183
|
+
---
|
|
93
184
|
|
|
94
185
|
## Resources
|
|
95
186
|
|
|
187
|
+
The MCP server exposes read-only resources for policy inspection.
|
|
188
|
+
|
|
96
189
|
### `vettly://policies`
|
|
97
190
|
|
|
98
|
-
|
|
191
|
+
List of all available policies.
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
Access the vettly://policies resource to see all policies
|
|
195
|
+
```
|
|
99
196
|
|
|
100
197
|
### `vettly://policies/{policyId}`
|
|
101
198
|
|
|
102
|
-
|
|
199
|
+
Specific policy YAML configuration.
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
Show me the YAML for my community-safe policy
|
|
203
|
+
|
|
204
|
+
What are the thresholds configured in default-policy?
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
103
208
|
|
|
104
209
|
## Programmatic Usage
|
|
105
210
|
|
|
211
|
+
Use the server in your own MCP applications:
|
|
212
|
+
|
|
106
213
|
```typescript
|
|
107
|
-
import { createVettlyMcpServer } from '@vettly/mcp'
|
|
214
|
+
import { createVettlyMcpServer } from '@vettly/mcp'
|
|
215
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
108
216
|
|
|
109
217
|
const server = createVettlyMcpServer({
|
|
110
218
|
apiKey: process.env.VETTLY_API_KEY!,
|
|
111
|
-
apiUrl: 'https://api.vettly.dev'
|
|
112
|
-
})
|
|
219
|
+
apiUrl: 'https://api.vettly.dev' // optional
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
// Connect to stdio transport (for Claude Desktop)
|
|
223
|
+
const transport = new StdioServerTransport()
|
|
224
|
+
await server.connect(transport)
|
|
113
225
|
|
|
114
|
-
//
|
|
115
|
-
server.connect(
|
|
226
|
+
// Or use with other transports
|
|
227
|
+
// server.connect(yourCustomTransport)
|
|
116
228
|
```
|
|
117
229
|
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Use Cases
|
|
233
|
+
|
|
234
|
+
### Content Review Assistance
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
I'm reviewing user-submitted content for our platform. Can you check these
|
|
238
|
+
submissions against our community-safe policy and tell me which ones
|
|
239
|
+
need manual review?
|
|
240
|
+
|
|
241
|
+
1. "Great product, highly recommend!"
|
|
242
|
+
2. "This is garbage, you people are idiots"
|
|
243
|
+
3. "Love the new features in this update"
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Policy Development
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
I want to create a new policy for our support chat. Can you help me
|
|
250
|
+
write the YAML and then validate it?
|
|
251
|
+
|
|
252
|
+
Requirements:
|
|
253
|
+
- Block hate speech with threshold 0.6
|
|
254
|
+
- Flag harassment for review at 0.7
|
|
255
|
+
- Allow profanity up to 0.8
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Usage Monitoring
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
Can you check our moderation usage this week and let me know if we're
|
|
262
|
+
on track for our monthly budget?
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Decision Audit
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
A user is appealing a content decision. Can you look up decision ID
|
|
269
|
+
abc-123 and explain why their content was blocked?
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Security
|
|
275
|
+
|
|
276
|
+
- API keys are passed via environment variables, not in config files
|
|
277
|
+
- The MCP server only has read access to policies (cannot create/modify)
|
|
278
|
+
- Decision IDs can be used for audit trails but don't expose content
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
118
282
|
## Links
|
|
119
283
|
|
|
120
|
-
- [
|
|
121
|
-
- [
|
|
122
|
-
- [MCP Specification](https://modelcontextprotocol.io)
|
|
284
|
+
- [vettly.dev](https://vettly.dev) - Sign up
|
|
285
|
+
- [docs.vettly.dev](https://docs.vettly.dev) - Documentation
|
|
286
|
+
- [MCP Specification](https://modelcontextprotocol.io) - MCP docs
|
|
287
|
+
- [@vettly/sdk](https://www.npmjs.com/package/@vettly/sdk) - Core SDK
|
package/package.json
CHANGED