@vinaystwt/xmpp-mcp 0.1.0 → 0.2.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 +51 -5
- package/dist/apps/mcp-server/src/server.js +4 -4
- package/dist/packages/contract-runtime/src/index.d.ts +1 -1
- package/dist/packages/contract-runtime/src/index.js +2 -2
- package/dist/packages/http-interceptor/src/agents.d.ts +1 -1
- package/dist/packages/http-interceptor/src/agents.js +1 -1
- package/dist/packages/http-interceptor/src/idempotency.d.ts +6 -6
- package/dist/packages/http-interceptor/src/index.d.ts +1 -1
- package/dist/packages/http-interceptor/src/index.js +6 -6
- package/dist/packages/http-interceptor/src/state.d.ts +1 -1
- package/dist/packages/http-interceptor/src/state.js +2 -2
- package/dist/packages/payment-adapters/src/index.d.ts +1 -1
- package/dist/packages/payment-adapters/src/index.js +2 -2
- package/dist/packages/policy-engine/src/index.d.ts +1 -1
- package/dist/packages/policy-engine/src/index.js +1 -1
- package/dist/packages/router/src/index.d.ts +1 -1
- package/dist/packages/wallet/src/index.d.ts +1 -1
- package/dist/packages/wallet/src/index.js +1 -1
- package/package.json +7 -11
package/README.md
CHANGED
|
@@ -1,10 +1,56 @@
|
|
|
1
1
|
# @vinaystwt/xmpp-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
xMPP MCP is the public MCP server package for payment-aware agent workflows on Stellar.
|
|
4
4
|
|
|
5
|
-
It exposes
|
|
5
|
+
It exposes the same route, policy, receipt, and operator surfaces used by the full xMPP stack, but packaged for MCP-compatible clients over stdio.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This is the recommended starting point when your agent client already speaks MCP.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
## What It Does
|
|
10
|
+
|
|
11
|
+
- fetches paid resources through xMPP
|
|
12
|
+
- previews route and policy decisions before payment
|
|
13
|
+
- explains route scoring and workflow estimates
|
|
14
|
+
- lists reusable sessions
|
|
15
|
+
- verifies signed receipts
|
|
16
|
+
- exposes wallet and operator state to the client
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @vinaystwt/xmpp-mcp
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Tool Surface
|
|
25
|
+
|
|
26
|
+
The package exposes:
|
|
27
|
+
|
|
28
|
+
- `xmpp_fetch`
|
|
29
|
+
- `xmpp_policy_preview`
|
|
30
|
+
- `xmpp_explain`
|
|
31
|
+
- `xmpp_estimate_workflow`
|
|
32
|
+
- `xmpp_session_list`
|
|
33
|
+
- `xmpp_receipt_verify`
|
|
34
|
+
- `xmpp_wallet_info`
|
|
35
|
+
- `xmpp_agent_profiles`
|
|
36
|
+
|
|
37
|
+
## Use Case
|
|
38
|
+
|
|
39
|
+
Use `@vinaystwt/xmpp-mcp` when you want an agent client to:
|
|
40
|
+
|
|
41
|
+
- call paid APIs through one MCP server
|
|
42
|
+
- get route-aware payment execution
|
|
43
|
+
- keep receipt and policy state visible
|
|
44
|
+
- work with x402, MPP charge, and MPP session flows without embedding that logic directly in the agent
|
|
45
|
+
|
|
46
|
+
## Related Package
|
|
47
|
+
|
|
48
|
+
- `@vinaystwt/xmpp-core`
|
|
49
|
+
- SDK and local helper package for direct integration outside MCP
|
|
50
|
+
|
|
51
|
+
## Docs
|
|
52
|
+
|
|
53
|
+
- repo:
|
|
54
|
+
- https://github.com/Vinaystwt/xMPP
|
|
55
|
+
- SDK docs:
|
|
56
|
+
- https://github.com/Vinaystwt/xMPP/blob/main/docs/sdk.md
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
3
|
import * as z from 'zod/v4';
|
|
4
|
-
import { listAgentPolicySnapshots, listAgentSessions } from '
|
|
5
|
-
import { getXmppMetadata, getXmppOperatorState, listLocalSessions, listEffectiveXmppAgentProfiles, xmppFetch, } from '
|
|
6
|
-
import { createRouter } from '
|
|
7
|
-
import { getWalletInfo, verifyXmppReceipt } from '
|
|
4
|
+
import { listAgentPolicySnapshots, listAgentSessions } from '../../../packages/contract-runtime/src/index.js';
|
|
5
|
+
import { getXmppMetadata, getXmppOperatorState, listLocalSessions, listEffectiveXmppAgentProfiles, xmppFetch, } from '../../../packages/http-interceptor/src/index.js';
|
|
6
|
+
import { createRouter } from '../../../packages/router/src/index.js';
|
|
7
|
+
import { getWalletInfo, verifyXmppReceipt } from '../../../packages/wallet/src/index.js';
|
|
8
8
|
const router = createRouter();
|
|
9
9
|
const signedReceiptSchema = z.object({
|
|
10
10
|
receiptId: z.string(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RouteKind, XmppAgentPolicySnapshot, XmppContractAgentTreasuryState, XmppContractTreasurySnapshot, XmppSessionRecord } from '
|
|
1
|
+
import type { RouteKind, XmppAgentPolicySnapshot, XmppContractAgentTreasuryState, XmppContractTreasurySnapshot, XmppSessionRecord } from '../../types/src/index.js';
|
|
2
2
|
export type PolicyRuntimeSnapshot = {
|
|
3
3
|
source: 'local' | 'contract' | 'fallback';
|
|
4
4
|
pauseFlag: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Keypair } from '@stellar/stellar-sdk';
|
|
2
2
|
import { Client, basicNodeSigner } from '@stellar/stellar-sdk/contract';
|
|
3
|
-
import { config } from '
|
|
4
|
-
import { logger } from '
|
|
3
|
+
import { config } from '../../config/src/index.js';
|
|
4
|
+
import { logger } from '../../logger/src/index.js';
|
|
5
5
|
let policyClientPromise;
|
|
6
6
|
let sessionRegistryClientPromise;
|
|
7
7
|
let policyClientDisabled = false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { XmppAgentPolicySnapshot, XmppAgentProfile } from '
|
|
1
|
+
import type { XmppAgentPolicySnapshot, XmppAgentProfile } from '../../types/src/index.js';
|
|
2
2
|
export declare function listXmppAgentProfiles(): XmppAgentProfile[];
|
|
3
3
|
export declare function getXmppAgentProfile(agentId?: string): XmppAgentProfile;
|
|
4
4
|
export declare function applyAgentPolicy(profile: XmppAgentProfile, policy: XmppAgentPolicySnapshot | null | undefined): XmppAgentProfile;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { XmppFetchMetadata, XmppFetchOptions } from '
|
|
1
|
+
import type { XmppFetchMetadata, XmppFetchOptions } from '../../types/src/index.js';
|
|
2
2
|
type IdempotencySnapshot = {
|
|
3
3
|
fingerprint: string;
|
|
4
4
|
storedAt: number;
|
|
@@ -56,12 +56,12 @@ export declare function buildIdempotentReplay(snapshot: IdempotencySnapshot['res
|
|
|
56
56
|
response: Response;
|
|
57
57
|
metadata: {
|
|
58
58
|
idempotentReplay: boolean;
|
|
59
|
-
route: import("
|
|
60
|
-
challenge?: import("
|
|
59
|
+
route: import("../../types/src/index.js").RouteKind;
|
|
60
|
+
challenge?: import("../../types/src/index.js").PaymentChallenge;
|
|
61
61
|
retried: boolean;
|
|
62
|
-
execution?: import("
|
|
63
|
-
policy?: import("
|
|
64
|
-
budget?: import("
|
|
62
|
+
execution?: import("../../types/src/index.js").PaymentExecutionMetadata;
|
|
63
|
+
policy?: import("../../types/src/index.js").PolicyDecision;
|
|
64
|
+
budget?: import("../../types/src/index.js").XmppBudgetSnapshot;
|
|
65
65
|
};
|
|
66
66
|
} | null;
|
|
67
67
|
export declare function resetIdempotencyCache(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { XmppAgentProfile, XmppFetchMetadata, XmppFetchOptions } from '
|
|
1
|
+
import type { XmppAgentProfile, XmppFetchMetadata, XmppFetchOptions } from '../../types/src/index.js';
|
|
2
2
|
import { getXmppOperatorState, listLocalSessions } from './state.js';
|
|
3
3
|
import { listXmppAgentProfiles } from './agents.js';
|
|
4
4
|
export declare function getXmppMetadata(resp: Response): XmppFetchMetadata | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createRouter, estimateRouteCost } from '
|
|
2
|
-
import { getAgentTreasuryState, getAgentPolicySnapshot, getTreasurySnapshot, listAgentPolicySnapshots, getPolicyRuntimeSnapshot, recordTreasurySpend, recordSessionRouteEvent, } from '
|
|
3
|
-
import { executePaymentRoute, preparePaymentExecution } from '
|
|
4
|
-
import { config } from '
|
|
5
|
-
import { evaluatePolicyForRequest } from '
|
|
6
|
-
import { signXmppReceipt } from '
|
|
1
|
+
import { createRouter, estimateRouteCost } from '../../router/src/index.js';
|
|
2
|
+
import { getAgentTreasuryState, getAgentPolicySnapshot, getTreasurySnapshot, listAgentPolicySnapshots, getPolicyRuntimeSnapshot, recordTreasurySpend, recordSessionRouteEvent, } from '../../contract-runtime/src/index.js';
|
|
3
|
+
import { executePaymentRoute, preparePaymentExecution } from '../../payment-adapters/src/index.js';
|
|
4
|
+
import { config } from '../../config/src/index.js';
|
|
5
|
+
import { evaluatePolicyForRequest } from '../../policy-engine/src/index.js';
|
|
6
|
+
import { signXmppReceipt } from '../../wallet/src/index.js';
|
|
7
7
|
import { buildIdempotentReplay, clearIdempotentReservation, inspectIdempotency, storeIdempotentResponse, } from './idempotency.js';
|
|
8
8
|
import { buildBudgetSnapshot, getXmppOperatorState, listLocalSessions, recordXmppEvent, resetXmppOperatorState, upsertLocalSession, } from './state.js';
|
|
9
9
|
import { applyAgentPolicy, getXmppAgentProfile, listXmppAgentProfiles, mergeAgentPolicies, } from './agents.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { XmppAgentProfile, RouteKind, XmppAgentStateSummary, XmppBudgetSnapshot, XmppOperatorState, XmppRouteEvent, XmppSessionRecord } from '
|
|
1
|
+
import type { XmppAgentProfile, RouteKind, XmppAgentStateSummary, XmppBudgetSnapshot, XmppOperatorState, XmppRouteEvent, XmppSessionRecord } from '../../types/src/index.js';
|
|
2
2
|
export declare function recordXmppEvent(input: Omit<XmppRouteEvent, 'id' | 'timestamp'>): XmppRouteEvent;
|
|
3
3
|
export declare function upsertLocalSession(sessionId: string, serviceId: string, callCount: number): void;
|
|
4
4
|
export declare function listLocalSessions(): Pick<XmppSessionRecord, "serviceId" | "sessionId" | "callCount">[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { config } from '
|
|
2
|
-
import { createRouter, estimateRouteCost, resolveCatalogEntry } from '
|
|
1
|
+
import { config } from '../../config/src/index.js';
|
|
2
|
+
import { createRouter, estimateRouteCost, resolveCatalogEntry } from '../../router/src/index.js';
|
|
3
3
|
import { getXmppAgentProfile, listXmppAgentProfiles } from './agents.js';
|
|
4
4
|
const router = createRouter();
|
|
5
5
|
const recentEvents = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Keypair, xdr } from '@stellar/stellar-sdk';
|
|
2
|
-
import type { PaymentChallenge, PaymentExecutionMetadata, PaymentExecutionResult, RouteKind } from '
|
|
2
|
+
import type { PaymentChallenge, PaymentExecutionMetadata, PaymentExecutionResult, RouteKind } from '../../types/src/index.js';
|
|
3
3
|
import { XLM_SAC_TESTNET } from '@stellar/mpp';
|
|
4
4
|
declare function createClassicSignatureScVal(keypair: Keypair, payload: Buffer): xdr.ScVal;
|
|
5
5
|
declare function createDelegatedSignerScVal(publicKey: string): xdr.ScVal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { config } from '
|
|
1
|
+
import { config } from '../../config/src/index.js';
|
|
2
2
|
import * as StellarSdk from '@stellar/stellar-sdk';
|
|
3
3
|
import { contract, hash, Keypair, nativeToScVal, rpc, TransactionBuilder, xdr } from '@stellar/stellar-sdk';
|
|
4
4
|
import { basicNodeSigner } from '@stellar/stellar-sdk/contract';
|
|
@@ -8,7 +8,7 @@ import { wrapFetchWithPaymentFromConfig } from '@x402/fetch';
|
|
|
8
8
|
import { createEd25519Signer } from '@x402/stellar';
|
|
9
9
|
import { ExactStellarScheme } from '@x402/stellar/exact/client';
|
|
10
10
|
import { XLM_SAC_TESTNET } from '@stellar/mpp';
|
|
11
|
-
import { getRouteExecutionPlan } from '
|
|
11
|
+
import { getRouteExecutionPlan } from '../../wallet/src/index.js';
|
|
12
12
|
const stellarNetwork = config.network;
|
|
13
13
|
const liveFetchCache = new Map();
|
|
14
14
|
const DEFAULT_LEDGER_CLOSE_SECONDS = 5;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PolicyDecision } from '
|
|
1
|
+
import type { PolicyDecision } from '../../types/src/index.js';
|
|
2
2
|
export declare function isAllowedDomain(url: string): boolean;
|
|
3
3
|
export declare function evaluatePolicy(url: string): PolicyDecision;
|
|
4
4
|
export declare function evaluatePolicyForRequest(input: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPolicyRuntimeSnapshot } from '
|
|
1
|
+
import { getPolicyRuntimeSnapshot } from '../../contract-runtime/src/index.js';
|
|
2
2
|
const allowedHosts = new Set(['localhost', '127.0.0.1']);
|
|
3
3
|
const blockedPathPrefixes = ['/admin', '/internal', '/unsafe'];
|
|
4
4
|
export function isAllowedDomain(url) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PaymentChallenge, RouteContext, RouteDecision, RouteKind, ServiceCatalogEntry, WorkflowEstimateResult, WorkflowEstimateStep } from '
|
|
1
|
+
import type { PaymentChallenge, RouteContext, RouteDecision, RouteKind, ServiceCatalogEntry, WorkflowEstimateResult, WorkflowEstimateStep } from '../../types/src/index.js';
|
|
2
2
|
export declare function resolveCatalogEntry(input: RouteContext): ServiceCatalogEntry;
|
|
3
3
|
export declare function estimateRouteCost(input: {
|
|
4
4
|
route: RouteKind;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PaymentExecutionMetadata, RouteKind, XmppReceiptVerificationResult, XmppSignedReceipt, XmppSmartAccountExecution, XmppWalletInfo } from '
|
|
1
|
+
import type { PaymentExecutionMetadata, RouteKind, XmppReceiptVerificationResult, XmppSignedReceipt, XmppSmartAccountExecution, XmppWalletInfo } from '../../types/src/index.js';
|
|
2
2
|
export declare const SMART_ACCOUNT_MIN_TRANSACTION_FEE_STROOPS = 2000000;
|
|
3
3
|
export declare function signXmppReceipt(input: Omit<XmppSignedReceipt, 'signature' | 'agent' | 'issuedAt' | 'network'> & {
|
|
4
4
|
issuedAt?: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vinaystwt/xmpp-mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Public xMPP MCP server for payment-aware agent workflows on Stellar, with fetch, preview, explain, session, and receipt tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/apps/mcp-server/src/server.js",
|
|
@@ -21,12 +21,14 @@
|
|
|
21
21
|
"url": "https://github.com/Vinaystwt/xMPP/issues"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
|
-
"xmpp",
|
|
25
|
-
"mcp",
|
|
26
24
|
"stellar",
|
|
27
25
|
"x402",
|
|
28
26
|
"mpp",
|
|
29
|
-
"
|
|
27
|
+
"mcp",
|
|
28
|
+
"agents",
|
|
29
|
+
"payments",
|
|
30
|
+
"server",
|
|
31
|
+
"xmpp"
|
|
30
32
|
],
|
|
31
33
|
"exports": {
|
|
32
34
|
".": {
|
|
@@ -55,12 +57,6 @@
|
|
|
55
57
|
},
|
|
56
58
|
"dependencies": {
|
|
57
59
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
58
|
-
"@vinaystwt/xmpp-config": "0.1.0",
|
|
59
|
-
"@vinaystwt/xmpp-contract-runtime": "0.1.0",
|
|
60
|
-
"@vinaystwt/xmpp-http-interceptor": "0.1.0",
|
|
61
|
-
"@vinaystwt/xmpp-router": "0.1.0",
|
|
62
|
-
"@vinaystwt/xmpp-types": "0.1.0",
|
|
63
|
-
"@vinaystwt/xmpp-wallet": "0.1.0",
|
|
64
60
|
"zod": "^4.3.6"
|
|
65
61
|
},
|
|
66
62
|
"devDependencies": {
|