@vapi-network/mcp 0.7.0 → 0.8.0
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 +11 -1
- package/dist/actions/accounts.d.ts +53 -0
- package/dist/actions/call-read.d.ts +28 -0
- package/dist/actions/call.d.ts +12 -7
- package/dist/actions/context.d.ts +47 -1
- package/dist/actions/register.d.ts +579 -6
- package/dist/actions/swarm-agent.d.ts +178 -0
- package/dist/actions/swarm.d.ts +1586 -0
- package/dist/agent/deps.d.ts +11 -1
- package/dist/agent/run.d.ts +43 -3
- package/dist/agent/runtime.d.ts +154 -0
- package/dist/agent/swarm-run.d.ts +94 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +7997 -1569
- package/dist/index.js.map +3 -3
- package/dist/server.d.ts +6 -1
- package/dist/tools/accounts.d.ts +4 -7
- package/dist/tools/call.d.ts +6 -1
- package/dist/tools/status.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The stdio MCP server behind `vapi mcp`: namespaced tools that let an agent
|
|
4
4
|
search the vAPI catalogue, read a listing's request contract, pay an x402 API
|
|
5
|
-
from a local wallet, and read balances, receipts and the status screen
|
|
5
|
+
from a local wallet, read paid origins during an agent run, and read balances, receipts and the status screen
|
|
6
6
|
(`vapi.status`, `vapi.accounts`, `vapi.siblings`). It can derive an account and lower its caps,
|
|
7
7
|
but it never renames, removes, backs up or exports one, and no tool returns a
|
|
8
8
|
recovery phrase, private key or passphrase.
|
|
@@ -19,6 +19,7 @@ One entry point, `@vapi-network/mcp`, exporting `createVapiServer`,
|
|
|
19
19
|
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
|
|
20
20
|
| `buildSIWxProof` | function (args: { signer: SIWxSigner; challenge: SIWxChallenge; responseUrl: string; }): unknown | 0.5.0 or earlier |
|
|
21
21
|
| `callService` | function (args: CallServiceArgs): Promise<CallToolResult> | 0.5.0 or earlier |
|
|
22
|
+
| `callRead` | action `call.read`: GET an HTTPS URL from an origin paid in the current agent run; SIWX sign-in is allowed, but it never pays | 0.8.0 |
|
|
22
23
|
| `createAgentRunDeps` | function (input: { profile: AgentProfile; config: VapiConfig; home: string; account: VapiPaymentAccount; wallet: WalletName; spendCaps: SpendCaps; chat: (req: ChatRequest) => Promise<ChatResult>; approve: RunAgentDeps["approve"]; onEvent?: (event: AgentEven... | 0.5.0 or earlier |
|
|
23
24
|
| `createVapiServer` | function (options: VapiServerOptions): unknown | 0.5.0 or earlier |
|
|
24
25
|
| `decidePayment` | function (input: { ref: string; priceUsd: number \| null; verification: string; seenRefs: ReadonlySet<string>; verifiedOnly: boolean; approveAboveUsd: number; maxPerCallUsd: number; }): PayDecision | 0.5.0 or earlier |
|
|
@@ -26,6 +27,7 @@ One entry point, `@vapi-network/mcp`, exporting `createVapiServer`,
|
|
|
26
27
|
| `inspectService` | function (input: InspectToolInput, config: VapiConfig, fetchImpl?: typeof fetch): Promise<InspectToolResult> | 0.5.0 or earlier |
|
|
27
28
|
| `loadServerConfig` | function (): unknown | 0.5.0 or earlier |
|
|
28
29
|
| `parseSIWxResponse` | function (response: Response, configuredNetworks: VapiConfig["networks"], responseUrl: string, requiredNetwork?: string): Promise<SIWxChallenge \| null> | 0.5.0 or earlier |
|
|
30
|
+
| `readPaidOrigin` | function (args: { url; paidOrigins; account; config; fetchImpl?; lookup?; timeoutMs? }): Promise<CallReadOutput> | 0.8.0 |
|
|
29
31
|
| `resolveServiceEndpoint` | function (id: string, config: VapiRegistryConfig, fetchImpl?: Fetch, endpointName?: string): Promise<DiscoveryEndpoint> | 0.5.0 or earlier |
|
|
30
32
|
| `resolveServiceListing` | function (id: string, config: VapiRegistryConfig, fetchImpl?: Fetch, endpointName?: string): Promise<ResolvedListing> | 0.5.0 or earlier |
|
|
31
33
|
| `runAgent` | function (task: string, deps: RunAgentDeps): Promise<RunAgentResult> | 0.5.0 or earlier |
|
|
@@ -42,6 +44,8 @@ One entry point, `@vapi-network/mcp`, exporting `createVapiServer`,
|
|
|
42
44
|
| `AgentEvent` | type AgentEvent = \| { type: "step"; n: number } \| { type: "tool"; name: string; summary: string } \| { type: "paid"; ref: string; amountUsd: number; network: string } \| { type: "declined"; ref: string; reason: string } \| { type: "stopped"; reason: "finished"... | 0.5.0 or earlier |
|
|
43
45
|
| `CallToolInput` | type CallToolInput = { id?: string; url?: string; method?: string; endpoint?: string; body?: unknown; maxPriceUsd?: number \| string; network?: string; expectedPayTo?: string; contentType?: string; } | 0.5.0 or earlier |
|
|
44
46
|
| `CallToolResult` | type CallToolResult = { status: number; body: unknown; verification?: ListingVerification; outcome?: "signed_in"; payment: null \| { network: string; amountAtomic: string; amountUsd: string; asset: string; payTo: string; settlement: unknown \| null; proof: st... | 0.5.0 or earlier |
|
|
47
|
+
| `CallReadInput` | type CallReadInput = { url: string } | 0.8.0 |
|
|
48
|
+
| `CallReadOutput` | type CallReadOutput = { status: number; contentType: string \| null; body: unknown } | 0.8.0 |
|
|
45
49
|
| `InspectToolInput` | type InspectToolInput = { id: string; endpoint?: string; } | 0.5.0 or earlier |
|
|
46
50
|
| `InspectToolResult` | type InspectToolResult = Omit< Pick< DiscoveryEndpoint, \| "name" \| "method" \| "url" \| "price" \| "description" \| "operationId" \| "requestContentType" \| "requestSchema" \| "responseContentType" >, "method" > & { method: string \| null; network?: string; group?:... | 0.5.0 or earlier |
|
|
47
51
|
| `MarketplaceSearchInput` | type MarketplaceSearchInput = { query?: string; kinds?: MarketplaceKind[]; network?: string; limit?: number; cursor?: string; includeUnverified?: boolean; } | 0.5.0 or earlier |
|
|
@@ -56,3 +60,9 @@ One entry point, `@vapi-network/mcp`, exporting `createVapiServer`,
|
|
|
56
60
|
| `WalletSessionOptions` | type WalletSessionOptions = { account: VapiPaymentAccount; store?: WalletStore \| undefined; wallet?: string \| undefined; env?: NodeJS.ProcessEnv \| undefined; passphrase?: (() => string \| Promise<string>) \| undefined; secretStore?: SecretStore \| undefined; n... | 0.5.0 or earlier |
|
|
57
61
|
|
|
58
62
|
See the [root README](https://github.com/vAPI-Network/vapi-network/blob/main/docs/mcp.md) for the editor configuration, the full tool table and the deprecated aliases.
|
|
63
|
+
|
|
64
|
+
`call.read` is available to agent runs with the `read` grant. It only sends
|
|
65
|
+
GET requests to HTTPS origins that the same agent paid in the current run,
|
|
66
|
+
follows guarded redirects, and never makes another payment. A 402 may be
|
|
67
|
+
retried once with a SIWX sign-in proof bound to that origin. The MCP surface
|
|
68
|
+
lists the tool for schema alignment, but calls outside an agent run are refused.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const accountsSendInputSchema: z.ZodObject<{
|
|
3
|
+
from: z.ZodString;
|
|
4
|
+
to: z.ZodString;
|
|
5
|
+
amountUsd: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
6
|
+
network: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
base: "base";
|
|
8
|
+
arc: "arc";
|
|
9
|
+
}>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type AccountsSendInput = z.infer<typeof accountsSendInputSchema>;
|
|
12
|
+
export declare const accountsSendOutputSchema: z.ZodObject<{
|
|
13
|
+
status: z.ZodEnum<{
|
|
14
|
+
unknown: "unknown";
|
|
15
|
+
sent: "sent";
|
|
16
|
+
}>;
|
|
17
|
+
from: z.ZodString;
|
|
18
|
+
to: z.ZodString;
|
|
19
|
+
toName: z.ZodString;
|
|
20
|
+
toKind: z.ZodEnum<{
|
|
21
|
+
account: "account";
|
|
22
|
+
owner: "owner";
|
|
23
|
+
}>;
|
|
24
|
+
amountUsd: z.ZodString;
|
|
25
|
+
amountAtomic: z.ZodString;
|
|
26
|
+
network: z.ZodEnum<{
|
|
27
|
+
"eip155:8453": "eip155:8453";
|
|
28
|
+
"eip155:5042": "eip155:5042";
|
|
29
|
+
}>;
|
|
30
|
+
txHash: z.ZodNullable<z.ZodString>;
|
|
31
|
+
nonce: z.ZodString;
|
|
32
|
+
replayed: z.ZodBoolean;
|
|
33
|
+
message: z.ZodString;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export declare const accountsSend: import("./define.js").Action<{
|
|
36
|
+
from: string;
|
|
37
|
+
to: string;
|
|
38
|
+
amountUsd: string | number;
|
|
39
|
+
network?: "base" | "arc" | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
status: "unknown" | "sent";
|
|
42
|
+
from: string;
|
|
43
|
+
to: string;
|
|
44
|
+
toName: string;
|
|
45
|
+
toKind: "account" | "owner";
|
|
46
|
+
amountUsd: string;
|
|
47
|
+
amountAtomic: string;
|
|
48
|
+
network: "eip155:8453" | "eip155:5042";
|
|
49
|
+
txHash: string | null;
|
|
50
|
+
nonce: string;
|
|
51
|
+
replayed: boolean;
|
|
52
|
+
message: string;
|
|
53
|
+
}>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type LookupFn, type VapiConfig, type VapiPaymentAccount } from "@vapi-network/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export declare const callReadInputSchema: z.ZodObject<{
|
|
4
|
+
url: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const callReadOutputSchema: z.ZodObject<{
|
|
7
|
+
status: z.ZodNumber;
|
|
8
|
+
contentType: z.ZodNullable<z.ZodString>;
|
|
9
|
+
body: z.ZodUnknown;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type CallReadInput = z.infer<typeof callReadInputSchema>;
|
|
12
|
+
export type CallReadOutput = z.infer<typeof callReadOutputSchema>;
|
|
13
|
+
export declare const callRead: import("./define.js").Action<{
|
|
14
|
+
url: string;
|
|
15
|
+
}, {
|
|
16
|
+
status: number;
|
|
17
|
+
contentType: string | null;
|
|
18
|
+
body: unknown;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function readPaidOrigin(args: {
|
|
21
|
+
url: string;
|
|
22
|
+
paidOrigins: ReadonlySet<string>;
|
|
23
|
+
account: VapiPaymentAccount;
|
|
24
|
+
config: VapiConfig;
|
|
25
|
+
fetchImpl?: typeof fetch;
|
|
26
|
+
lookup?: LookupFn;
|
|
27
|
+
timeoutMs?: number;
|
|
28
|
+
}): Promise<CallReadOutput>;
|
package/dist/actions/call.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CeilingSweepHook, type SpendCaps, type VapiConfig, type VapiPaymentAccount } from "@vapi-network/core";
|
|
1
|
+
import { type CeilingSweepHook, type RunBudget, type RunRef, type SpendCaps, type VapiConfig, type VapiPaymentAccount } from "@vapi-network/core";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { type CallToolResult } from "../tools/call.js";
|
|
4
4
|
import { type CallPort } from "./context.js";
|
|
@@ -10,6 +10,7 @@ export declare const callToolResultSchema: z.ZodObject<{
|
|
|
10
10
|
wallet: z.ZodString;
|
|
11
11
|
status: z.ZodNumber;
|
|
12
12
|
body: z.ZodUnknown;
|
|
13
|
+
resourceUrl: z.ZodOptional<z.ZodURL>;
|
|
13
14
|
verification: z.ZodOptional<z.ZodEnum<{
|
|
14
15
|
none: "none";
|
|
15
16
|
requested: "requested";
|
|
@@ -42,10 +43,10 @@ export declare const inspectToolResultSchema: z.ZodObject<{
|
|
|
42
43
|
responseContentType: z.ZodOptional<z.ZodString>;
|
|
43
44
|
network: z.ZodOptional<z.ZodString>;
|
|
44
45
|
group: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
external: "external";
|
|
45
47
|
vapi: "vapi";
|
|
46
48
|
partner: "partner";
|
|
47
49
|
added: "added";
|
|
48
|
-
external: "external";
|
|
49
50
|
}>>;
|
|
50
51
|
fee: z.ZodOptional<z.ZodObject<{
|
|
51
52
|
bps: z.ZodNumber;
|
|
@@ -157,7 +158,7 @@ export declare const callSearch: import("./define.js").Action<{
|
|
|
157
158
|
byline?: string | undefined;
|
|
158
159
|
bylineHref?: string | undefined;
|
|
159
160
|
};
|
|
160
|
-
group?: "partner" | "
|
|
161
|
+
group?: "partner" | "external" | "vapi" | "added" | undefined;
|
|
161
162
|
fee?: {
|
|
162
163
|
[x: string]: unknown;
|
|
163
164
|
bps: number;
|
|
@@ -221,7 +222,7 @@ export declare const callSearch: import("./define.js").Action<{
|
|
|
221
222
|
byline?: string | undefined;
|
|
222
223
|
bylineHref?: string | undefined;
|
|
223
224
|
};
|
|
224
|
-
group?: "partner" | "
|
|
225
|
+
group?: "partner" | "external" | "vapi" | "added" | undefined;
|
|
225
226
|
fee?: {
|
|
226
227
|
[x: string]: unknown;
|
|
227
228
|
bps: number;
|
|
@@ -277,7 +278,7 @@ export declare const callSearch: import("./define.js").Action<{
|
|
|
277
278
|
byline?: string | undefined;
|
|
278
279
|
bylineHref?: string | undefined;
|
|
279
280
|
};
|
|
280
|
-
group?: "partner" | "
|
|
281
|
+
group?: "partner" | "external" | "vapi" | "added" | undefined;
|
|
281
282
|
fee?: {
|
|
282
283
|
[x: string]: unknown;
|
|
283
284
|
bps: number;
|
|
@@ -333,7 +334,7 @@ export declare const callSearch: import("./define.js").Action<{
|
|
|
333
334
|
byline?: string | undefined;
|
|
334
335
|
bylineHref?: string | undefined;
|
|
335
336
|
};
|
|
336
|
-
group?: "partner" | "
|
|
337
|
+
group?: "partner" | "external" | "vapi" | "added" | undefined;
|
|
337
338
|
fee?: {
|
|
338
339
|
[x: string]: unknown;
|
|
339
340
|
bps: number;
|
|
@@ -389,7 +390,7 @@ export declare const callInspect: import("./define.js").Action<{
|
|
|
389
390
|
requestSchema?: unknown;
|
|
390
391
|
responseContentType?: string | undefined;
|
|
391
392
|
network?: string | undefined;
|
|
392
|
-
group?: "partner" | "
|
|
393
|
+
group?: "partner" | "external" | "vapi" | "added" | undefined;
|
|
393
394
|
fee?: {
|
|
394
395
|
[x: string]: unknown;
|
|
395
396
|
bps: number;
|
|
@@ -436,11 +437,15 @@ export declare const callPay: import("./define.js").Action<{
|
|
|
436
437
|
export type PaymentResolution = {
|
|
437
438
|
account: VapiPaymentAccount;
|
|
438
439
|
wallet: string;
|
|
440
|
+
runBudget?: RunBudget;
|
|
441
|
+
run?: RunRef;
|
|
439
442
|
spendCaps?: SpendCaps;
|
|
440
443
|
ledgerPath: string;
|
|
441
444
|
receiptsPath: string;
|
|
442
445
|
fetchImpl?: typeof fetch;
|
|
443
446
|
ceilingSweep?: CeilingSweepHook | false;
|
|
447
|
+
now?: Date;
|
|
448
|
+
allowanceExpiresAt?: Date;
|
|
444
449
|
};
|
|
445
450
|
export type CreateCallPortOptions = {
|
|
446
451
|
config: VapiConfig;
|
|
@@ -1,9 +1,34 @@
|
|
|
1
|
-
import type { AgentProfile, MarketplaceDiscoveryPage, VapiConfig } from "@vapi-network/core";
|
|
1
|
+
import type { AgentProfile, MarketplaceDiscoveryPage, RunBudget, RunRef, TransferResult, VapiConfig } from "@vapi-network/core";
|
|
2
2
|
import type { CallToolInput, CallToolResult } from "../tools/call.js";
|
|
3
3
|
import type { InspectToolInput, InspectToolResult } from "../tools/inspect.js";
|
|
4
4
|
import type { MarketplaceSearchInput } from "../tools/search.js";
|
|
5
|
+
import type { SwarmRunInput, SwarmRunResult } from "../agent/swarm-run.js";
|
|
6
|
+
import type { DetachedRunSummary, DetachedSwarmRunResult } from "../agent/runtime.js";
|
|
7
|
+
import type { AccountsSendInput } from "./accounts.js";
|
|
8
|
+
import type { CallReadInput, CallReadOutput } from "./call-read.js";
|
|
9
|
+
import type { SwarmAddInput, SwarmDissolveInput, SwarmDissolveOutput, SwarmFundInput, SwarmFundOutput, SwarmLeaveInput, SwarmLeaveOutput, SwarmRebalanceInput, SwarmRebalanceOutput, SwarmSetupInput, SwarmSetupOutput, SwarmStatusInput, SwarmStatusOutput } from "./swarm.js";
|
|
5
10
|
export type ActionSurface = "cli" | "mcp" | "agent";
|
|
11
|
+
export type SwarmRunScope = {
|
|
12
|
+
name: string;
|
|
13
|
+
treasury: string;
|
|
14
|
+
member: string;
|
|
15
|
+
depth: 0 | 1;
|
|
16
|
+
draw: RunBudget;
|
|
17
|
+
};
|
|
18
|
+
export type SwarmRunActionInput = SwarmRunInput & {
|
|
19
|
+
detach?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type SwarmRunActionResult = SwarmRunResult | DetachedSwarmRunResult;
|
|
22
|
+
export type SwarmRunsInput = {
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
25
|
+
export type SwarmRunsResult = {
|
|
26
|
+
swarm: string;
|
|
27
|
+
runs: DetachedRunSummary[];
|
|
28
|
+
};
|
|
6
29
|
export type ActionRunState = {
|
|
30
|
+
ref?: RunRef;
|
|
31
|
+
swarm?: SwarmRunScope;
|
|
7
32
|
searchedRefs: Set<string>;
|
|
8
33
|
inspected: Map<string, InspectToolResult>;
|
|
9
34
|
paidOrigins: Set<string>;
|
|
@@ -18,12 +43,33 @@ export type CallPort = {
|
|
|
18
43
|
}): Promise<{
|
|
19
44
|
wallet: string;
|
|
20
45
|
} & CallToolResult>;
|
|
46
|
+
read?(input: CallReadInput): Promise<CallReadOutput>;
|
|
47
|
+
};
|
|
48
|
+
export type AccountsPort = {
|
|
49
|
+
send(input: AccountsSendInput): Promise<TransferResult>;
|
|
50
|
+
};
|
|
51
|
+
export type SwarmPort = {
|
|
52
|
+
setup(input: SwarmSetupInput): Promise<SwarmSetupOutput>;
|
|
53
|
+
add(input: SwarmAddInput): Promise<SwarmSetupOutput>;
|
|
54
|
+
leave(input: SwarmLeaveInput): Promise<SwarmLeaveOutput>;
|
|
55
|
+
fund(input: SwarmFundInput): Promise<SwarmFundOutput>;
|
|
56
|
+
rebalance(input: SwarmRebalanceInput): Promise<SwarmRebalanceOutput>;
|
|
57
|
+
status(input: SwarmStatusInput): Promise<SwarmStatusOutput>;
|
|
58
|
+
dissolve(input: SwarmDissolveInput): Promise<SwarmDissolveOutput>;
|
|
21
59
|
};
|
|
22
60
|
export type ActionContext = {
|
|
23
61
|
config: VapiConfig;
|
|
24
62
|
fetch?: typeof fetch;
|
|
25
63
|
clock: () => Date;
|
|
26
64
|
call: CallPort;
|
|
65
|
+
accounts?: AccountsPort;
|
|
66
|
+
swarm?: SwarmPort;
|
|
67
|
+
swarmRun?: {
|
|
68
|
+
run(input: SwarmRunActionInput): Promise<SwarmRunActionResult>;
|
|
69
|
+
};
|
|
70
|
+
swarmRuns?: {
|
|
71
|
+
list(input: SwarmRunsInput): Promise<SwarmRunsResult>;
|
|
72
|
+
};
|
|
27
73
|
caps?: {
|
|
28
74
|
perCallUsd: number;
|
|
29
75
|
};
|