@quidli/connect-mcp 0.6.0 → 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 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 Farcaster handle `ahn.eth` to a wallet.
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": "farcaster",
45
- "value": "ahn.eth",
46
- "ethWalletAddress": "0x07De92Ce6474D718c80e696516bf0bE53290fF5E",
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 Telegram, Discord, Farcaster, X, GitHub, LinkedIn, email and phone — and generates a wallet for people who have never used Quidli.
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
 
@@ -375,4 +375,10 @@ mistake.
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", "linkedin", "slack", "wallet", "username"]>;
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", "linkedin", "slack", "wallet", "username"]>;
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", "linkedin", "slack", "wallet", "username"]>;
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({
@@ -94,9 +111,9 @@ export const dropInputSchema = {
94
111
  .optional()
95
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(linkedAccountSchema)
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. On Solana, wallet ids are base58 pubkeys; social lookup pays solWalletAddress.'),
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()
@@ -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 excludes users below minScore (quidli 0–100, neynar/lens 0–1, ethos 0–2800).', scoresBatchInputSchema, READ_ONLY, async ({ users, filter }) => client.request({
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,8 +59,8 @@ 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 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. Lookup social recipients and pay solWalletAddress, never ethWalletAddress. 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). Packs up to 20 SOL or 10 SPL recipients per transaction. ' +
63
- 'Solana native (tokenContract null): no ATA. Sending to a new or empty wallet 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. ' +
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
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
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({
66
66
  method: 'POST',
@@ -73,7 +73,7 @@ export function registerTools(server, client) {
73
73
  }));
74
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
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 new/empty recipient: 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({
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({
77
77
  method: 'GET',
78
78
  path: '/drop/balance',
79
79
  requireApiKey: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quidli/connect-mcp",
3
- "version": "0.6.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 && chmod +x dist/index.js dist/index-http.js",
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",