@quidli/connect-mcp 0.5.9 → 0.6.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 +13 -7
- package/dist/mount.d.ts +2 -1
- package/dist/mount.js +30 -0
- package/dist/schemas.d.ts +3 -3
- package/dist/schemas.js +23 -6
- package/dist/tools/register.js +9 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -34,23 +34,23 @@ See [Choose how to connect](#choose-how-to-connect) below for API keys, x402 wal
|
|
|
34
34
|
|
|
35
35
|
Then ask your agent:
|
|
36
36
|
|
|
37
|
-
> Resolve the
|
|
37
|
+
> Resolve the GitHub handle `justinquidli` to a wallet.
|
|
38
38
|
|
|
39
39
|
```json
|
|
40
40
|
{
|
|
41
41
|
"status": "completed",
|
|
42
42
|
"results": [
|
|
43
43
|
{
|
|
44
|
-
"type": "
|
|
45
|
-
"value": "
|
|
46
|
-
"ethWalletAddress": "
|
|
44
|
+
"type": "github",
|
|
45
|
+
"value": "justinquidli",
|
|
46
|
+
"ethWalletAddress": "0x6a48ADE3bE3F9f0b8B4c9af61Bb654A219311699",
|
|
47
47
|
"solWalletAddress": "9DD2CqPKZJoo7ZRgCXxJNMjhzfgVihSKtkZpn8qnEWK9"
|
|
48
48
|
}
|
|
49
49
|
]
|
|
50
50
|
}
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
Resolves across
|
|
53
|
+
Resolves across GitHub, X, Telegram, Discord, LinkedIn, Farcaster, email and phone — and generates a wallet for people who have never used Quidli.
|
|
54
54
|
|
|
55
55
|
Lookup, scores, and price run without a key under a shared anonymous quota. Add a [Connect API key](https://connect.quid.li) for higher limits, your own profile (`connect_me`), and Smart Send.
|
|
56
56
|
|
|
@@ -371,8 +371,14 @@ mistake.
|
|
|
371
371
|
| `connect_scores_by_account` | Scores for one linked account |
|
|
372
372
|
| `connect_scores_by_username` | Scores by Connect username |
|
|
373
373
|
| `connect_me` | API key owner profile, scores, and linked accounts — **API key only** |
|
|
374
|
-
| `connect_drop` | Smart Send (batch
|
|
374
|
+
| `connect_drop` | Smart Send (EVM batch or Solana SOL/SPL) — **API key only** |
|
|
375
375
|
| `connect_drop_balance` | Smart Send wallet balances on a chain — **API key only** |
|
|
376
376
|
|
|
377
377
|
|
|
378
|
-
Ask your client to use these tools when you need Connect data or actions.
|
|
378
|
+
Ask your client to use these tools when you need Connect data or actions.
|
|
379
|
+
|
|
380
|
+
## Contributing
|
|
381
|
+
|
|
382
|
+
This repository is a read-only mirror, regenerated on every release — changes
|
|
383
|
+
committed here are overwritten. Please open an issue rather than a pull request.
|
|
384
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
package/dist/mount.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IRouter } from 'express';
|
|
1
|
+
import type { IRouter, Request } from 'express';
|
|
2
2
|
import { AnonymousToolQuota } from './anonymous-quota.js';
|
|
3
3
|
export { resolveRequestHost } from './request-host.js';
|
|
4
4
|
export interface ConnectMcpMountOptions {
|
|
@@ -8,4 +8,5 @@ export interface ConnectMcpMountOptions {
|
|
|
8
8
|
}
|
|
9
9
|
export declare function resolveEmbeddedApiBaseUrl(port: number, env?: NodeJS.ProcessEnv): string;
|
|
10
10
|
export declare function isConnectMcpHost(hostname: string, env?: NodeJS.ProcessEnv): boolean;
|
|
11
|
+
export declare function normalizeAcceptHeader(req: Pick<Request, 'headers'>): void;
|
|
11
12
|
export declare function mountConnectMcpHttp(router: IRouter, options: ConnectMcpMountOptions): void;
|
package/dist/mount.js
CHANGED
|
@@ -39,6 +39,35 @@ export function isConnectMcpHost(hostname, env = process.env) {
|
|
|
39
39
|
normalized === 'mcp.staging.connect.quid.li' ||
|
|
40
40
|
normalized.endsWith('.mcp.connect.quid.li'));
|
|
41
41
|
}
|
|
42
|
+
// The MCP SDK's StreamableHTTPServerTransport requires the Accept header to
|
|
43
|
+
// name BOTH application/json and text/event-stream literally, and rejects
|
|
44
|
+
// anything else with 406. That is stricter than HTTP content negotiation: a
|
|
45
|
+
// wildcard Accept (the default for curl, fetch and most HTTP libraries, and
|
|
46
|
+
// for clients that omit the header entirely) does accept both, but is still
|
|
47
|
+
// refused. Directory health checkers and plain HTTP integrators hit this.
|
|
48
|
+
//
|
|
49
|
+
// So rewrite the header to the canonical form whenever the client's own Accept
|
|
50
|
+
// already permits both types (absent, wildcard, or the relevant type
|
|
51
|
+
// wildcards). A client that genuinely accepts neither is left alone and still
|
|
52
|
+
// gets its 406.
|
|
53
|
+
const CANONICAL_ACCEPT = 'application/json, text/event-stream';
|
|
54
|
+
export function normalizeAcceptHeader(req) {
|
|
55
|
+
const raw = req.headers.accept;
|
|
56
|
+
const value = Array.isArray(raw) ? raw.join(',') : (raw ?? '');
|
|
57
|
+
// No Accept header means "anything" per RFC 9110.
|
|
58
|
+
if (!value.trim()) {
|
|
59
|
+
req.headers.accept = CANONICAL_ACCEPT;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const types = value
|
|
63
|
+
.split(',')
|
|
64
|
+
.map((part) => part.split(';')[0].trim().toLowerCase())
|
|
65
|
+
.filter(Boolean);
|
|
66
|
+
const permits = (type) => types.includes(type) || types.includes('*/*') || types.includes(`${type.split('/')[0]}/*`);
|
|
67
|
+
if (permits('application/json') && permits('text/event-stream')) {
|
|
68
|
+
req.headers.accept = CANONICAL_ACCEPT;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
42
71
|
export function mountConnectMcpHttp(router, options) {
|
|
43
72
|
const { baseUrl } = options;
|
|
44
73
|
const env = options.env ?? process.env;
|
|
@@ -50,6 +79,7 @@ export function mountConnectMcpHttp(router, options) {
|
|
|
50
79
|
// No in-memory session map, so Cloud Run restarts / multiple instances
|
|
51
80
|
// never cause "Missing or invalid MCP session" errors.
|
|
52
81
|
router.all('/', async (req, res) => {
|
|
82
|
+
normalizeAcceptHeader(req);
|
|
53
83
|
const gate = gateHostedMcpRequest(req, { env, anonymousQuota });
|
|
54
84
|
if (!gate.ok) {
|
|
55
85
|
sendJsonRpcError(res, gate.status, gate.message, {
|
package/dist/schemas.d.ts
CHANGED
|
@@ -83,15 +83,15 @@ export declare const dropInputSchema: {
|
|
|
83
83
|
chainId: z.ZodNumber;
|
|
84
84
|
tokenContract: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
85
|
recipients: z.ZodArray<z.ZodObject<{
|
|
86
|
-
type: z.ZodEnum<["email", "phone", "telegram", "discord", "farcaster", "twitter", "github", "
|
|
86
|
+
type: z.ZodEnum<["email", "phone", "telegram", "discord", "farcaster", "twitter", "github", "wallet"]>;
|
|
87
87
|
id: z.ZodOptional<z.ZodString>;
|
|
88
88
|
username: z.ZodOptional<z.ZodString>;
|
|
89
89
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
90
|
-
type: z.ZodEnum<["email", "phone", "telegram", "discord", "farcaster", "twitter", "github", "
|
|
90
|
+
type: z.ZodEnum<["email", "phone", "telegram", "discord", "farcaster", "twitter", "github", "wallet"]>;
|
|
91
91
|
id: z.ZodOptional<z.ZodString>;
|
|
92
92
|
username: z.ZodOptional<z.ZodString>;
|
|
93
93
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
94
|
-
type: z.ZodEnum<["email", "phone", "telegram", "discord", "farcaster", "twitter", "github", "
|
|
94
|
+
type: z.ZodEnum<["email", "phone", "telegram", "discord", "farcaster", "twitter", "github", "wallet"]>;
|
|
95
95
|
id: z.ZodOptional<z.ZodString>;
|
|
96
96
|
username: z.ZodOptional<z.ZodString>;
|
|
97
97
|
}, z.ZodTypeAny, "passthrough">>, "many">;
|
package/dist/schemas.js
CHANGED
|
@@ -16,6 +16,23 @@ const recipientTypeSchema = z.enum([
|
|
|
16
16
|
'username',
|
|
17
17
|
]);
|
|
18
18
|
const exposureRecipientTypeSchema = recipientTypeSchema;
|
|
19
|
+
const dropSocialTypeSchema = z.enum([
|
|
20
|
+
'email',
|
|
21
|
+
'phone',
|
|
22
|
+
'telegram',
|
|
23
|
+
'discord',
|
|
24
|
+
'farcaster',
|
|
25
|
+
'twitter',
|
|
26
|
+
'github',
|
|
27
|
+
]);
|
|
28
|
+
const dropRecipientTypeSchema = z.enum([...dropSocialTypeSchema.options, 'wallet']);
|
|
29
|
+
const dropRecipientSchema = z
|
|
30
|
+
.object({
|
|
31
|
+
type: dropRecipientTypeSchema,
|
|
32
|
+
id: z.string().optional(),
|
|
33
|
+
username: z.string().optional(),
|
|
34
|
+
})
|
|
35
|
+
.passthrough();
|
|
19
36
|
/** Unified recipient — API validates fully; MCP forwards JSON. */
|
|
20
37
|
export const linkedAccountSchema = z
|
|
21
38
|
.object({
|
|
@@ -83,25 +100,25 @@ export const scoresByUsernameInputSchema = {
|
|
|
83
100
|
username: z.string().min(1),
|
|
84
101
|
};
|
|
85
102
|
export const dropBalanceInputSchema = {
|
|
86
|
-
chainId: z.number().int().describe('EVM chain ID (Smart Send
|
|
103
|
+
chainId: z.number().int().describe('EVM chain ID or 1399811149 for Solana mainnet (Smart Send)'),
|
|
87
104
|
};
|
|
88
105
|
export const dropInputSchema = {
|
|
89
106
|
idempotencyKey: z.string().uuid(),
|
|
90
|
-
chainId: z.number().int().describe('EVM chain ID
|
|
107
|
+
chainId: z.number().int().describe('EVM chain ID or 1399811149 for Solana mainnet'),
|
|
91
108
|
tokenContract: z
|
|
92
109
|
.string()
|
|
93
110
|
.nullable()
|
|
94
111
|
.optional()
|
|
95
|
-
.describe('ERC-20 contract
|
|
112
|
+
.describe('EVM ERC-20 contract or Solana SPL mint. Omit or null for the native token (ETH/POL/AVAX, or SOL on 1399811149). Do not use the zero address.'),
|
|
96
113
|
recipients: z
|
|
97
|
-
.array(
|
|
114
|
+
.array(dropRecipientSchema)
|
|
98
115
|
.min(1)
|
|
99
|
-
.describe('Wallet or social recipients (all wallet or all social, no mix). Optional amountInWei per recipient uses the same smallest-unit rules as amountInWeiPerRecipient.'),
|
|
116
|
+
.describe('Wallet or social recipients (all wallet or all social, no mix). Social types: email, phone, telegram, discord, farcaster, twitter, github (numeric id or username). linkedin and slack are not supported — use connect_lookup first, then type wallet. Optional amountInWei per recipient uses the same smallest-unit rules as amountInWeiPerRecipient. On EVM, wallet ids are 0x addresses; on Solana, base58 pubkeys. Social lookup payouts use ethWalletAddress on EVM and solWalletAddress on Solana.'),
|
|
100
117
|
amountInWeiPerRecipient: z
|
|
101
118
|
.string()
|
|
102
119
|
.optional()
|
|
103
120
|
.nullable()
|
|
104
|
-
.describe('Uniform amount in smallest units
|
|
121
|
+
.describe('Uniform amount in smallest units. Native ETH uses 18 decimals; SOL uses 9; ERC-20/SPL uses token decimals from connect_drop_balance (USDC usually 6). Omit when setting amountInWei on each recipient.'),
|
|
105
122
|
ignoreFailedRecipients: z
|
|
106
123
|
.boolean()
|
|
107
124
|
.optional()
|
package/dist/tools/register.js
CHANGED
|
@@ -31,7 +31,7 @@ const SPENDS_FUNDS = {
|
|
|
31
31
|
};
|
|
32
32
|
export function registerTools(server, client) {
|
|
33
33
|
server.tool('connect_get_price', 'Get public x402 list prices for lookup and scores (reference only; live paywall amounts are in 402 responses).', {}, READ_ONLY, async () => client.request({ method: 'GET', path: '/price', authenticated: false }));
|
|
34
|
-
server.tool('connect_get_chains', 'List product chains with per-feature compatibility. lookup is true for EVM catalog chains and Solana; drop is true
|
|
34
|
+
server.tool('connect_get_chains', 'List product chains with per-feature compatibility. lookup is true for EVM catalog chains and Solana; drop is true for Smart Send EVM chains and Solana (chainId 1399811149 for connect_drop / connect_drop_balance).', {}, READ_ONLY, async () => client.request({ method: 'GET', path: '/chains', authenticated: false }));
|
|
35
35
|
server.tool('connect_lookup', 'Resolve social identities to EVM and Solana wallet addresses. Resolving a recipient who has no wallet provisions one for them, so this is read-only for the caller but not for the recipient. If status is processing, retry the same payload.', lookupInputSchema, READ_ONLY, async ({ recipients }) => client.request({
|
|
36
36
|
method: 'POST',
|
|
37
37
|
path: '/lookup',
|
|
@@ -42,7 +42,7 @@ export function registerTools(server, client) {
|
|
|
42
42
|
path: '/lookup/exposed',
|
|
43
43
|
body: { recipient },
|
|
44
44
|
}));
|
|
45
|
-
server.tool('connect_scores_batch', 'Batch scores for linked accounts or Connect usernames. Optional filter
|
|
45
|
+
server.tool('connect_scores_batch', 'Batch scores for linked accounts or Connect usernames. One result per request user. Optional filter sets passedFilter (quidli 0–100, neynar/lens 0–1, ethos 0–2800).', scoresBatchInputSchema, READ_ONLY, async ({ users, filter }) => client.request({
|
|
46
46
|
method: 'POST',
|
|
47
47
|
path: '/scores',
|
|
48
48
|
body: { users, ...(filter ? { filter } : {}) },
|
|
@@ -59,7 +59,10 @@ export function registerTools(server, client) {
|
|
|
59
59
|
method: 'GET',
|
|
60
60
|
path: '/account/me',
|
|
61
61
|
}));
|
|
62
|
-
server.tool('connect_drop', 'Execute a Smart Send
|
|
62
|
+
server.tool('connect_drop', 'Execute a Smart Send from the API key owner Connect embedded wallet. EVM: batch native or ERC-20 (need native gas plus the token). Solana (chainId 1399811149): SOL or SPL from the Solana embedded wallet; packs up to 20 native or 10 SPL recipients per transaction. Social recipient types: email, phone, telegram, discord, farcaster, twitter, github (id or username). linkedin and slack are not on /drop — use connect_lookup first, then type wallet. After connect_lookup, EVM payouts use ethWalletAddress (never solWalletAddress); Solana payouts use solWalletAddress (never ethWalletAddress). Social types on /drop resolve server-side; for type wallet, pass the resolved payout address for the target chain. Omit tokenContract or set it to null for the native token; pass an ERC-20 contract or SPL mint otherwise — do not use the zero address. Amounts are smallest-unit integer strings (ETH 18 decimals, SOL 9, USDC usually 6). ' +
|
|
63
|
+
'Solana native (tokenContract null): no ATA. Sending to a recipient without an existing funded account requires amount ≥ 890880 lamports (rent-exempt minimum for a system account); that SOL stays with the recipient. Below that the tx fails. Sender also pays a ~5000-lamport fee. ' +
|
|
64
|
+
'Solana SPL: tokens sit in Associated Token Accounts (ATA), not on the wallet pubkey. Recipients need not already hold the token — the API prepends CreateIdempotent. The sender (not the recipient) pays ~2039280 lamports (~0.002039 SOL) rent per newly created dest ATA, plus tx fees, on top of the token amount (which can be as small as 1 unit). A 400 "Insufficient funds" on SPL is often missing SOL for ATA rent, not missing USDC. Token-2022 is not supported; USDC mint is EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v. ' +
|
|
65
|
+
'Always call connect_drop_balance first. Returns 201 when submitted or 202 when recipients still processing — retry with the same idempotencyKey.', dropInputSchema, SPENDS_FUNDS, async ({ ignoreFailedRecipients, ...body }) => client.request({
|
|
63
66
|
method: 'POST',
|
|
64
67
|
path: '/drop',
|
|
65
68
|
body,
|
|
@@ -68,7 +71,9 @@ export function registerTools(server, client) {
|
|
|
68
71
|
? { ignoreFailedRecipients: 'true' }
|
|
69
72
|
: undefined,
|
|
70
73
|
}));
|
|
71
|
-
server.tool('connect_drop_balance', 'Get native and
|
|
74
|
+
server.tool('connect_drop_balance', 'Get native and token balances for the API key owner Smart Send embedded wallet on a chain. Always call before connect_drop. Zero balances are omitted, so a missing token means balance 0. ' +
|
|
75
|
+
'EVM: confirm native gas plus the ERC-20 being sent. ' +
|
|
76
|
+
'Solana (chainId 1399811149): SOL in this response is spendable lamports on the wallet pubkey (rent locked in existing token accounts is not included). Native SOL drop to a recipient without an existing funded account: amount itself must be ≥ 890880 lamports and sender SOL must cover amount + ~5000 lamports fee. SPL drop: token balance ≥ total amount, and SOL ≥ tx fee + ~2039280 lamports (~0.002039 SOL) per recipient that may need a new Associated Token Account — even when sending USDC. Insufficient SOL for ATA rent fails before the token transfer.', dropBalanceInputSchema, READ_ONLY, async ({ chainId }) => client.request({
|
|
72
77
|
method: 'GET',
|
|
73
78
|
path: '/drop/balance',
|
|
74
79
|
requireApiKey: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quidli/connect-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "MCP server for agent identity and reputation: resolve social handles to wallet addresses, score onchain reputation, and send USDC from any MCP client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"./http": "./dist/http.js"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
|
-
"build": "tsc &&
|
|
58
|
+
"build": "tsc && node --input-type=commonjs -e \"const fs=require('fs'); for (const f of ['dist/index.js','dist/index-http.js']) fs.chmodSync(f, 0o755)\"",
|
|
59
59
|
"prepublishOnly": "npm run build",
|
|
60
60
|
"start": "node dist/index.js",
|
|
61
61
|
"start:http": "node dist/index-http.js",
|