{"_id":"@aliyun-supabase/mcp-utils","_rev":"3-bf61ff92ff662b9578676a983ca44ff9","name":"@aliyun-supabase/mcp-utils","dist-tags":{"latest":"1.0.1"},"versions":{"0.2.1":{"name":"@aliyun-supabase/mcp-utils","version":"0.2.1","license":"Apache-2.0","_id":"@aliyun-supabase/mcp-utils@0.2.1","maintainers":[{"name":"aliyun-supabase","email":"zhangjiachi.zjc@alibaba-inc.com"}],"dist":{"shasum":"066e580a99e14e0b143393e846b282b749f11589","tarball":"https://registry.npmjs.org/@aliyun-supabase/mcp-utils/-/mcp-utils-0.2.1.tgz","fileCount":8,"integrity":"sha512-ufn3OTCc2h0j9uCB5XnPfjXoCgWKzeVZDsrje0Ovv3PkZO9uRppjAicr7p0s47/YzDPWMetzFHKt3b6u7WylzQ==","signatures":[{"sig":"MEUCIQDmBXUNE6kVSwUoF1tLOYGCKI5LjZrU8jjyTi/n8IJuJQIgciMfq2bSKHj6AhNZaVNxrMfTjfohdJ4mdR61hxbmD1c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68864},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.cjs"}},"gitHead":"85d5180ffa4f5adf776c9dcaaf4a260a8cd07498","scripts":{"test":"vitest","build":"tsup --clean","test:coverage":"vitest --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"aliyun-supabase","email":"zhangjiachi.zjc@alibaba-inc.com"},"_npmVersion":"10.9.2","description":"MCP utilities","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","dependencies":{"zod":"^3.24.1","zod-to-json-schema":"^3.24.1","@modelcontextprotocol/sdk":"^1.11.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^3.2.4","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^22.8.6","@total-typescript/tsconfig":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/mcp-utils_0.2.1_1753789730888_0.3375960113617562","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@aliyun-supabase/mcp-utils","version":"1.0.0","license":"Apache-2.0","_id":"@aliyun-supabase/mcp-utils@1.0.0","maintainers":[{"name":"aliyun-supabase","email":"zhangjiachi.zjc@alibaba-inc.com"}],"dist":{"shasum":"cd5ac6fd90c82c70179a0c5cc15dcf3456499360","tarball":"https://registry.npmjs.org/@aliyun-supabase/mcp-utils/-/mcp-utils-1.0.0.tgz","fileCount":8,"integrity":"sha512-193UNroWlGgxFtueU/x8jH6oosvid6leVG1BHGNLaV3ZLni/CchKMlSU1Ns3AaWygaYX5Z8VWXJqctLzvGD48A==","signatures":[{"sig":"MEUCIQDn/vTCbYqvDsg/hv3a0hyGZTf9T1jwydScskLXtwCmPwIgH/9SLfmn+XyTr2zbRx6k1omAoKIKx7SC+7TVkWax224=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68864},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.cjs"}},"gitHead":"54dade4b4814eff0597d0e0a0aa30250d00ccec3","scripts":{"test":"vitest","build":"tsup --clean","test:coverage":"vitest --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"aliyun-supabase","email":"zhangjiachi.zjc@alibaba-inc.com"},"_npmVersion":"10.9.2","description":"MCP utilities","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","dependencies":{"zod":"^3.24.1","zod-to-json-schema":"^3.24.1","@modelcontextprotocol/sdk":"^1.11.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^3.2.4","prettier":"^3.3.3","typescript":"^5.6.3","@types/node":"^22.8.6","@total-typescript/tsconfig":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/mcp-utils_1.0.0_1753791664056_0.12195886099329578","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@aliyun-supabase/mcp-utils","version":"1.0.1","description":"MCP utilities","license":"Apache-2.0","type":"module","main":"dist/index.cjs","types":"dist/index.d.ts","sideEffects":false,"scripts":{"build":"tsup --clean","test":"vitest","test:coverage":"vitest --coverage","prepublishOnly":"npm run build"},"exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"dependencies":{"@modelcontextprotocol/sdk":"^1.11.0","zod":"^3.24.1","zod-to-json-schema":"^3.24.1"},"devDependencies":{"@total-typescript/tsconfig":"^1.0.4","@types/node":"^22.8.6","prettier":"^3.3.3","tsup":"^8.3.5","typescript":"^5.6.3","vitest":"^3.2.4"},"_id":"@aliyun-supabase/mcp-utils@1.0.1","gitHead":"54dade4b4814eff0597d0e0a0aa30250d00ccec3","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-/VqxY9VhPPonq2qG7FFiYwa6dkygMBkzq1KnXEz1q3OjuATqwuARCJUklgr95IP8rjfwbDQD89kZ8wKWjMlnbA==","shasum":"4384af909e06dd0cdc4722eaf084d2ba732ec16f","tarball":"https://registry.npmjs.org/@aliyun-supabase/mcp-utils/-/mcp-utils-1.0.1.tgz","fileCount":8,"unpackedSize":68864,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC1s0+h0dQb4YBXBH2EC4gQnHdZv15rfmYyrUGIIJBh6AIgdmOTRyR6vDgGqJYFlM8QyVOPCKREzLicR+G/uHSRe/s="}]},"_npmUser":{"name":"aliyun-supabase","email":"zhangjiachi.zjc@alibaba-inc.com"},"directories":{},"maintainers":[{"name":"aliyun-supabase","email":"zhangjiachi.zjc@alibaba-inc.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-utils_1.0.1_1753884452613_0.08582804282121304"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-29T11:48:50.798Z","modified":"2025-07-30T14:07:32.996Z","0.2.1":"2025-07-29T11:48:51.071Z","1.0.0":"2025-07-29T12:21:04.249Z","1.0.1":"2025-07-30T14:07:32.818Z"},"license":"Apache-2.0","description":"MCP utilities","maintainers":[{"name":"aliyun-supabase","email":"zhangjiachi.zjc@alibaba-inc.com"}],"readme":"# @supabase/mcp-utils\n\nA collection of utilities for working with the Model Context Protocol (MCP).\n\n## Installation\n\n```shell\nnpm i @supabase/mcp-utils\n```\n\n```shell\nyarn add @supabase/mcp-utils\n```\n\n```shell\npnpm add @supabase/mcp-utils\n```\n\n## API\n\n### `StreamTransport`\n\nIf you're building an MCP client, you'll need to connect to MCP servers programmatically using a [transport](https://modelcontextprotocol.io/docs/concepts/transports).\n\nIn addition to MCP's [built-in](https://modelcontextprotocol.io/docs/concepts/transports#built-in-transport-types) transports, we also offer a `StreamTransport` to connect to clients with servers directly in-memory or over your own stream-based transport:\n\n```ts\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { StreamTransport } from '@supabase/mcp-utils';\nimport { PostgrestMcpServer } from '@supabase/mcp-server-postgrest';\n\n// Create a stream transport for both client and server\nconst clientTransport = new StreamTransport();\nconst serverTransport = new StreamTransport();\n\n// Connect the streams together\nclientTransport.readable.pipeTo(serverTransport.writable);\nserverTransport.readable.pipeTo(clientTransport.writable);\n\nconst client = new Client(\n  {\n    name: 'MyClient',\n    version: '0.1.0',\n  },\n  {\n    capabilities: {},\n  }\n);\n\nconst server = new PostgrestMcpServer({\n  apiUrl: API_URL,\n  schema: 'public',\n});\n\n// Connect the client and server to their respective transports\nawait server.connect(serverTransport);\nawait client.connect(clientTransport);\n```\n\nA `StreamTransport` implements a standard duplex stream interface via [`ReadableStream`](https://developer.mozilla.org/docs/Web/API/ReadableStream) and [`WritableStream`](https://developer.mozilla.org/docs/Web/API/WritableStream):\n\n```ts\ninterface StreamTransport {\n  readable: ReadableStream;\n  writable: WritableStream;\n}\n```\n\nYou can use `pipeTo` or `pipeThrough` to connect or transform streams. For more information, see the [Web Streams API](https://developer.mozilla.org/docs/Web/API/Streams_API).\n\nIf your using Node.js streams, you can use their [`.toWeb()`](https://nodejs.org/api/stream.html#streamduplextowebstreamduplex) and [`.fromWeb()`](https://nodejs.org/api/stream.html#streamduplexfromwebpair-options) methods to convert to and from web standard streams.\n\nThe full interface for `StreamTransport` is as follows:\n\n```ts\nimport { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';\nimport { JSONRPCMessage } from '@modelcontextprotocol/sdk/types.js';\n\ninterface DuplexStream<T> {\n  readable: ReadableStream<T>;\n  writable: WritableStream<T>;\n}\n\ndeclare class StreamTransport\n  implements Transport, DuplexStream<JSONRPCMessage>\n{\n  ready: Promise<void>;\n  readable: ReadableStream<JSONRPCMessage>;\n  writable: WritableStream<JSONRPCMessage>;\n  onclose?: () => void;\n  onerror?: (error: Error) => void;\n  onmessage?: (message: JSONRPCMessage) => void;\n\n  constructor();\n  start(): Promise<void>;\n  send(message: JSONRPCMessage): Promise<void>;\n  close(): Promise<void>;\n}\n```\n","readmeFilename":"README.md"}