@vibecheckai/mcp-server 1.0.0 → 1.0.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 +335 -0
- package/dist/index.js +60517 -11068
- package/dist/index.js.map +1 -1
- package/package.json +70 -70
package/README.md
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://vibecheckai.dev/logo.png" alt="VibeCheck Logo" width="120" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">VibeCheck MCP Server</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Model Context Protocol server for hallucination prevention</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/@vibecheckai/mcp-server"><img src="https://img.shields.io/npm/v/@vibecheckai/mcp-server.svg?style=flat-square&color=blue" alt="npm version" /></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/@vibecheckai/mcp-server"><img src="https://img.shields.io/npm/dm/@vibecheckai/mcp-server.svg?style=flat-square&color=green" alt="npm downloads" /></a>
|
|
14
|
+
<a href="https://github.com/vibecheckai/vibecheck/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="license" /></a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<a href="https://vibecheckai.dev">Website</a> •
|
|
19
|
+
<a href="https://vibecheckai.dev/docs/mcp">Documentation</a> •
|
|
20
|
+
<a href="https://vibecheckai.dev/discord">Discord</a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## What is this?
|
|
26
|
+
|
|
27
|
+
The VibeCheck MCP Server brings **hallucination prevention** directly into AI-powered IDEs like [Cursor](https://cursor.sh). It implements the [Model Context Protocol](https://modelcontextprotocol.io) to give AI assistants access to your project's verified truth layer.
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
31
|
+
│ Cursor IDE │
|
|
32
|
+
│ ┌───────────────────────────────────────────────────────┐ │
|
|
33
|
+
│ │ Claude AI │ │
|
|
34
|
+
│ │ │ │
|
|
35
|
+
│ │ "Let me check the truthpack for the correct │ │
|
|
36
|
+
│ │ API endpoint..." │ │
|
|
37
|
+
│ │ │ │
|
|
38
|
+
│ │ → vibecheck_truthpack_get { section: "routes" } │ │
|
|
39
|
+
│ │ │ │
|
|
40
|
+
│ └───────────────────────────────────────────────────────┘ │
|
|
41
|
+
│ │ │
|
|
42
|
+
│ ▼ │
|
|
43
|
+
│ ┌───────────────────────────────────────────────────────┐ │
|
|
44
|
+
│ │ VibeCheck MCP Server │ │
|
|
45
|
+
│ │ │ │
|
|
46
|
+
│ │ Returns verified facts from your codebase │ │
|
|
47
|
+
│ └───────────────────────────────────────────────────────┘ │
|
|
48
|
+
└─────────────────────────────────────────────────────────────┘
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
### Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install -g @vibecheckai/mcp-server
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Configure Cursor
|
|
60
|
+
|
|
61
|
+
Add to your Cursor settings (`~/.cursor/mcp.json` or via Settings → MCP):
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"mcpServers": {
|
|
66
|
+
"vibecheck": {
|
|
67
|
+
"command": "vibecheck-mcp"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Restart Cursor, and the AI assistant now has access to VibeCheck tools!
|
|
74
|
+
|
|
75
|
+
### Initialize Your Project
|
|
76
|
+
|
|
77
|
+
Before using the MCP server, initialize VibeCheck in your project:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
cd your-project
|
|
81
|
+
npx vibecheck-ai init
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
This creates a `.vibecheck/` directory with your project's truthpack.
|
|
85
|
+
|
|
86
|
+
## Available Tools
|
|
87
|
+
|
|
88
|
+
The MCP server exposes these tools to AI assistants:
|
|
89
|
+
|
|
90
|
+
### Truthpack Tools
|
|
91
|
+
|
|
92
|
+
| Tool | Description |
|
|
93
|
+
|------|-------------|
|
|
94
|
+
| `vibecheck_truthpack_get` | Get truthpack data (routes, env, auth, etc.) |
|
|
95
|
+
| `vibecheck_truthpack_search` | Search truthpack for specific information |
|
|
96
|
+
| `vibecheck_truthpack_validate` | Validate a claim against the truthpack |
|
|
97
|
+
|
|
98
|
+
### Context Tools
|
|
99
|
+
|
|
100
|
+
| Tool | Description |
|
|
101
|
+
|------|-------------|
|
|
102
|
+
| `vibecheck_context_gather` | Gather relevant context for a task |
|
|
103
|
+
| `vibecheck_context_files` | Get file contents with metadata |
|
|
104
|
+
| `vibecheck_context_dependencies` | Get dependency information |
|
|
105
|
+
|
|
106
|
+
### Validation Tools
|
|
107
|
+
|
|
108
|
+
| Tool | Description |
|
|
109
|
+
|------|-------------|
|
|
110
|
+
| `vibecheck_validate_code` | Validate code for hallucinations |
|
|
111
|
+
| `vibecheck_validate_claim` | Verify a specific claim |
|
|
112
|
+
| `vibecheck_validate_diff` | Check a diff for issues |
|
|
113
|
+
|
|
114
|
+
### Firewall Tools
|
|
115
|
+
|
|
116
|
+
| Tool | Description |
|
|
117
|
+
|------|-------------|
|
|
118
|
+
| `vibecheck_firewall_check` | Check if a file is protected |
|
|
119
|
+
| `vibecheck_firewall_status` | Get firewall status for paths |
|
|
120
|
+
|
|
121
|
+
### Forge Tools
|
|
122
|
+
|
|
123
|
+
| Tool | Description |
|
|
124
|
+
|------|-------------|
|
|
125
|
+
| `vibecheck_forge_run` | Generate/update truthpack |
|
|
126
|
+
| `vibecheck_forge_status` | Check forge status |
|
|
127
|
+
|
|
128
|
+
## How AI Uses These Tools
|
|
129
|
+
|
|
130
|
+
When you ask Claude in Cursor to help with your code, it can now:
|
|
131
|
+
|
|
132
|
+
### 1. Check Facts Before Answering
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
User: "Add a new API endpoint for user profiles"
|
|
136
|
+
|
|
137
|
+
Claude (internally):
|
|
138
|
+
→ vibecheck_truthpack_get { section: "routes" }
|
|
139
|
+
→ vibecheck_truthpack_get { section: "auth" }
|
|
140
|
+
|
|
141
|
+
Claude: "Based on your existing routes, I'll add the endpoint
|
|
142
|
+
following your pattern of using /api/v1/ prefix with JWT auth..."
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 2. Validate Its Own Output
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
Claude (internally):
|
|
149
|
+
→ vibecheck_validate_code { code: "..." }
|
|
150
|
+
|
|
151
|
+
Claude: "I've validated this against your truthpack.
|
|
152
|
+
The code correctly uses your existing patterns."
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### 3. Respect Protected Files
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
Claude (internally):
|
|
159
|
+
→ vibecheck_firewall_check { path: ".env" }
|
|
160
|
+
|
|
161
|
+
Claude: "I notice .env is protected by the firewall.
|
|
162
|
+
I'll suggest changes without modifying it directly."
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Transport Options
|
|
166
|
+
|
|
167
|
+
The MCP server supports multiple transport modes:
|
|
168
|
+
|
|
169
|
+
### Stdio (Default)
|
|
170
|
+
|
|
171
|
+
Used by Cursor and other MCP clients:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
vibecheck-mcp
|
|
175
|
+
# or
|
|
176
|
+
vibecheck-mcp --stdio
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### HTTP
|
|
180
|
+
|
|
181
|
+
For cloud deployments or custom integrations:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
vibecheck-mcp --http --port 3001
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### WebSocket
|
|
188
|
+
|
|
189
|
+
For real-time bidirectional communication:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
vibecheck-mcp --websocket --port 3002
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Configuration
|
|
196
|
+
|
|
197
|
+
### Environment Variables
|
|
198
|
+
|
|
199
|
+
| Variable | Description | Default |
|
|
200
|
+
|----------|-------------|---------|
|
|
201
|
+
| `VIBECHECK_MODE` | Operation mode: `local`, `cloud`, `hybrid` | `local` |
|
|
202
|
+
| `VIBECHECK_TRANSPORT` | Transport: `stdio`, `http`, `websocket` | `stdio` |
|
|
203
|
+
| `VIBECHECK_PORT` | Port for HTTP/WebSocket | `3001` |
|
|
204
|
+
| `VIBECHECK_HOST` | Host for HTTP/WebSocket | `localhost` |
|
|
205
|
+
|
|
206
|
+
### Project Configuration
|
|
207
|
+
|
|
208
|
+
The MCP server reads your project's `vibecheck.config.mjs`:
|
|
209
|
+
|
|
210
|
+
```javascript
|
|
211
|
+
/** @type {import('vibecheck-ai').VibeCheckConfig} */
|
|
212
|
+
export default {
|
|
213
|
+
// Truthpack settings
|
|
214
|
+
truthpack: {
|
|
215
|
+
sections: ['routes', 'env', 'auth', 'database'],
|
|
216
|
+
autoRefresh: true,
|
|
217
|
+
},
|
|
218
|
+
|
|
219
|
+
// Firewall settings
|
|
220
|
+
firewall: {
|
|
221
|
+
locked: ['.env*', 'src/core/**'],
|
|
222
|
+
warn: ['package.json'],
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
// Analysis settings
|
|
226
|
+
analysis: {
|
|
227
|
+
strictness: 'standard',
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Security
|
|
233
|
+
|
|
234
|
+
The MCP server is designed with security in mind:
|
|
235
|
+
|
|
236
|
+
- **Read-only by default** — Tools only read from your codebase
|
|
237
|
+
- **Path validation** — All file access is validated and sandboxed
|
|
238
|
+
- **Rate limiting** — Built-in protection against abuse
|
|
239
|
+
- **No network calls** — Local mode never phones home
|
|
240
|
+
|
|
241
|
+
## Comparison
|
|
242
|
+
|
|
243
|
+
| Feature | Without VibeCheck | With VibeCheck MCP |
|
|
244
|
+
|---------|-------------------|---------------------|
|
|
245
|
+
| AI knowledge of your code | General patterns | Your exact implementation |
|
|
246
|
+
| API endpoint accuracy | Often guessed | Verified from truthpack |
|
|
247
|
+
| Environment variables | Frequently invented | Checked against schema |
|
|
248
|
+
| Protected files | Can be modified | Firewall enforced |
|
|
249
|
+
| Code patterns | Generic suggestions | Your project's patterns |
|
|
250
|
+
|
|
251
|
+
## Example Session
|
|
252
|
+
|
|
253
|
+
Here's what happens when you work with Claude in Cursor with VibeCheck:
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
You: "I need to add rate limiting to the /api/users endpoint"
|
|
257
|
+
|
|
258
|
+
Claude:
|
|
259
|
+
[Calling vibecheck_truthpack_get with section: "routes"]
|
|
260
|
+
|
|
261
|
+
I found your /api/users endpoint in the truthpack. It's currently
|
|
262
|
+
defined in src/routes/users.ts using Express with JWT authentication.
|
|
263
|
+
|
|
264
|
+
[Calling vibecheck_context_files with path: "src/routes/users.ts"]
|
|
265
|
+
|
|
266
|
+
Looking at your existing code, I see you're using express-rate-limit
|
|
267
|
+
in other routes. Here's how to add it consistently:
|
|
268
|
+
|
|
269
|
+
```typescript
|
|
270
|
+
import rateLimit from 'express-rate-limit';
|
|
271
|
+
|
|
272
|
+
const userRateLimit = rateLimit({
|
|
273
|
+
windowMs: 15 * 60 * 1000, // matches your existing config
|
|
274
|
+
max: 100,
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
router.get('/api/users', userRateLimit, authenticate, getUsers);
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
[Calling vibecheck_validate_code]
|
|
281
|
+
|
|
282
|
+
✓ Validated against truthpack - uses correct patterns
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## Troubleshooting
|
|
286
|
+
|
|
287
|
+
### Server Not Starting
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
# Check if another instance is running
|
|
291
|
+
ps aux | grep vibecheck-mcp
|
|
292
|
+
|
|
293
|
+
# Run with verbose logging
|
|
294
|
+
DEBUG=vibecheck:* vibecheck-mcp
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Cursor Not Connecting
|
|
298
|
+
|
|
299
|
+
1. Restart Cursor after adding MCP configuration
|
|
300
|
+
2. Check MCP server status in Cursor settings
|
|
301
|
+
3. Verify the command path: `which vibecheck-mcp`
|
|
302
|
+
|
|
303
|
+
### Truthpack Not Found
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
# Initialize VibeCheck in your project
|
|
307
|
+
cd your-project
|
|
308
|
+
npx vibecheck-ai init
|
|
309
|
+
|
|
310
|
+
# Verify .vibecheck directory exists
|
|
311
|
+
ls -la .vibecheck/
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## Related Packages
|
|
315
|
+
|
|
316
|
+
- **[vibecheck-ai](https://npmjs.com/package/vibecheck-ai)** — CLI for VibeCheck
|
|
317
|
+
- **[VibeCheck VS Code Extension](https://marketplace.visualstudio.com/items?itemName=vibecheckai.vibecheck)** — VS Code integration
|
|
318
|
+
|
|
319
|
+
## Contributing
|
|
320
|
+
|
|
321
|
+
We welcome contributions! See [CONTRIBUTING.md](https://github.com/vibecheckai/vibecheck/blob/main/CONTRIBUTING.md).
|
|
322
|
+
|
|
323
|
+
## License
|
|
324
|
+
|
|
325
|
+
MIT © [VibeCheck AI](https://vibecheckai.dev)
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
<p align="center">
|
|
330
|
+
<strong>Give your AI the context it needs.</strong>
|
|
331
|
+
</p>
|
|
332
|
+
|
|
333
|
+
<p align="center">
|
|
334
|
+
<a href="https://vibecheckai.dev/docs/mcp">Read the Docs →</a>
|
|
335
|
+
</p>
|