vantage-peers-mcp 2.0.0 → 2.0.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.
- package/README.md +65 -0
- package/dist/api.d.ts +1366 -0
- package/dist/api.js +3 -0
- package/dist/server.js +20 -7
- package/package.json +12 -1
package/README.md
CHANGED
|
@@ -109,6 +109,71 @@ The server also reads `CONVEX_URL` from `.env.local` in the parent directory if
|
|
|
109
109
|
### Session (1)
|
|
110
110
|
`set_summary`
|
|
111
111
|
|
|
112
|
+
## Programmatic API (TypeScript)
|
|
113
|
+
|
|
114
|
+
For external services that need type-safe access to VantagePeers functions:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npm install vantage-peers-mcp convex
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
import { fetchQuery, fetchMutation } from "convex/nextjs";
|
|
122
|
+
import { api } from "vantage-peers-mcp/api";
|
|
123
|
+
|
|
124
|
+
// Query memories with full type safety
|
|
125
|
+
const memories = await fetchQuery(
|
|
126
|
+
api.memories.listMemories,
|
|
127
|
+
{ namespace: "global", limit: 10 },
|
|
128
|
+
{ url: process.env.CONVEX_URL }
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
// Send a message
|
|
132
|
+
await fetchMutation(
|
|
133
|
+
api.messages.sendMessage,
|
|
134
|
+
{ from: "pi", channel: "broadcast", content: "Hello from Studio" },
|
|
135
|
+
{ url: process.env.CONVEX_URL }
|
|
136
|
+
);
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Requires `convex` as a peer dependency. Only public functions are exported.
|
|
140
|
+
|
|
141
|
+
### Authentication with Deploy Keys
|
|
142
|
+
|
|
143
|
+
For server-to-server access, use a Convex deploy key:
|
|
144
|
+
|
|
145
|
+
1. Go to your [Convex dashboard](https://dashboard.convex.dev) > Settings > Deploy Keys
|
|
146
|
+
2. Generate a new deploy key for your deployment
|
|
147
|
+
3. Set it as an environment variable:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
CONVEX_DEPLOY_KEY=prod:your-deploy-key-here
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
4. Use it with the Convex client:
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
import { ConvexHttpClient } from "convex/browser";
|
|
157
|
+
import { api } from "vantage-peers-mcp/api";
|
|
158
|
+
|
|
159
|
+
const client = new ConvexHttpClient(process.env.CONVEX_URL!);
|
|
160
|
+
|
|
161
|
+
// Query with type safety
|
|
162
|
+
const memories = await client.query(api.memories.listMemories, {
|
|
163
|
+
namespace: "global",
|
|
164
|
+
limit: 10,
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// Mutate with type safety
|
|
168
|
+
await client.mutation(api.messages.sendMessage, {
|
|
169
|
+
from: "studio",
|
|
170
|
+
channel: "sigma",
|
|
171
|
+
content: "Task completed",
|
|
172
|
+
});
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Security:** Never commit deploy keys to git. Use environment variables or a secrets manager.
|
|
176
|
+
|
|
112
177
|
## Requirements
|
|
113
178
|
|
|
114
179
|
- Node.js >= 18
|