# Directory Structure
```
├── dist
│ ├── index.js
│ └── schemas.js
├── index.ts
├── node_modules
│ ├── .bin
│ │ ├── resolve
│ │ ├── shjs
│ │ ├── shx
│ │ ├── tsc
│ │ └── tsserver
│ ├── .package-lock.json
│ ├── @modelcontextprotocol
│ │ └── sdk
│ │ ├── dist
│ │ │ ├── cli.d.ts
│ │ │ ├── cli.d.ts.map
│ │ │ ├── cli.js
│ │ │ ├── cli.js.map
│ │ │ ├── client
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── index.d.ts.map
│ │ │ │ ├── index.js
│ │ │ │ ├── index.js.map
│ │ │ │ ├── index.test.d.ts
│ │ │ │ ├── index.test.d.ts.map
│ │ │ │ ├── index.test.js
│ │ │ │ ├── index.test.js.map
│ │ │ │ ├── sse.d.ts
│ │ │ │ ├── sse.d.ts.map
│ │ │ │ ├── sse.js
│ │ │ │ ├── sse.js.map
│ │ │ │ ├── stdio.d.ts
│ │ │ │ ├── stdio.d.ts.map
│ │ │ │ ├── stdio.js
│ │ │ │ ├── stdio.js.map
│ │ │ │ ├── stdio.test.d.ts
│ │ │ │ ├── stdio.test.d.ts.map
│ │ │ │ ├── stdio.test.js
│ │ │ │ ├── stdio.test.js.map
│ │ │ │ ├── websocket.d.ts
│ │ │ │ ├── websocket.d.ts.map
│ │ │ │ ├── websocket.js
│ │ │ │ └── websocket.js.map
│ │ │ ├── inMemory.d.ts
│ │ │ ├── inMemory.d.ts.map
│ │ │ ├── inMemory.js
│ │ │ ├── inMemory.js.map
│ │ │ ├── inMemory.test.d.ts
│ │ │ ├── inMemory.test.d.ts.map
│ │ │ ├── inMemory.test.js
│ │ │ ├── inMemory.test.js.map
│ │ │ ├── server
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── index.d.ts.map
│ │ │ │ ├── index.js
│ │ │ │ ├── index.js.map
│ │ │ │ ├── index.test.d.ts
│ │ │ │ ├── index.test.d.ts.map
│ │ │ │ ├── index.test.js
│ │ │ │ ├── index.test.js.map
│ │ │ │ ├── sse.d.ts
│ │ │ │ ├── sse.d.ts.map
│ │ │ │ ├── sse.js
│ │ │ │ ├── sse.js.map
│ │ │ │ ├── stdio.d.ts
│ │ │ │ ├── stdio.d.ts.map
│ │ │ │ ├── stdio.js
│ │ │ │ ├── stdio.js.map
│ │ │ │ ├── stdio.test.d.ts
│ │ │ │ ├── stdio.test.d.ts.map
│ │ │ │ ├── stdio.test.js
│ │ │ │ └── stdio.test.js.map
│ │ │ ├── shared
│ │ │ │ ├── protocol.d.ts
│ │ │ │ ├── protocol.d.ts.map
│ │ │ │ ├── protocol.js
│ │ │ │ ├── protocol.js.map
│ │ │ │ ├── stdio.d.ts
│ │ │ │ ├── stdio.d.ts.map
│ │ │ │ ├── stdio.js
│ │ │ │ ├── stdio.js.map
│ │ │ │ ├── stdio.test.d.ts
│ │ │ │ ├── stdio.test.d.ts.map
│ │ │ │ ├── stdio.test.js
│ │ │ │ ├── stdio.test.js.map
│ │ │ │ ├── transport.d.ts
│ │ │ │ ├── transport.d.ts.map
│ │ │ │ ├── transport.js
│ │ │ │ └── transport.js.map
│ │ │ ├── types.d.ts
│ │ │ ├── types.d.ts.map
│ │ │ ├── types.js
│ │ │ └── types.js.map
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── @types
│ │ ├── node
│ │ │ ├── assert
│ │ │ │ └── strict.d.ts
│ │ │ ├── assert.d.ts
│ │ │ ├── async_hooks.d.ts
│ │ │ ├── buffer.buffer.d.ts
│ │ │ ├── buffer.d.ts
│ │ │ ├── child_process.d.ts
│ │ │ ├── cluster.d.ts
│ │ │ ├── compatibility
│ │ │ │ ├── disposable.d.ts
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── indexable.d.ts
│ │ │ │ └── iterators.d.ts
│ │ │ ├── console.d.ts
│ │ │ ├── constants.d.ts
│ │ │ ├── crypto.d.ts
│ │ │ ├── dgram.d.ts
│ │ │ ├── diagnostics_channel.d.ts
│ │ │ ├── dns
│ │ │ │ └── promises.d.ts
│ │ │ ├── dns.d.ts
│ │ │ ├── dom-events.d.ts
│ │ │ ├── domain.d.ts
│ │ │ ├── events.d.ts
│ │ │ ├── fs
│ │ │ │ └── promises.d.ts
│ │ │ ├── fs.d.ts
│ │ │ ├── globals.d.ts
│ │ │ ├── globals.typedarray.d.ts
│ │ │ ├── http.d.ts
│ │ │ ├── http2.d.ts
│ │ │ ├── https.d.ts
│ │ │ ├── index.d.ts
│ │ │ ├── inspector.d.ts
│ │ │ ├── LICENSE
│ │ │ ├── module.d.ts
│ │ │ ├── net.d.ts
│ │ │ ├── os.d.ts
│ │ │ ├── package.json
│ │ │ ├── path.d.ts
│ │ │ ├── perf_hooks.d.ts
│ │ │ ├── process.d.ts
│ │ │ ├── punycode.d.ts
│ │ │ ├── querystring.d.ts
│ │ │ ├── readline
│ │ │ │ └── promises.d.ts
│ │ │ ├── readline.d.ts
│ │ │ ├── README.md
│ │ │ ├── repl.d.ts
│ │ │ ├── sea.d.ts
│ │ │ ├── sqlite.d.ts
│ │ │ ├── stream
│ │ │ │ ├── consumers.d.ts
│ │ │ │ ├── promises.d.ts
│ │ │ │ └── web.d.ts
│ │ │ ├── stream.d.ts
│ │ │ ├── string_decoder.d.ts
│ │ │ ├── test.d.ts
│ │ │ ├── timers
│ │ │ │ └── promises.d.ts
│ │ │ ├── timers.d.ts
│ │ │ ├── tls.d.ts
│ │ │ ├── trace_events.d.ts
│ │ │ ├── ts5.6
│ │ │ │ ├── buffer.buffer.d.ts
│ │ │ │ ├── globals.typedarray.d.ts
│ │ │ │ └── index.d.ts
│ │ │ ├── tty.d.ts
│ │ │ ├── url.d.ts
│ │ │ ├── util.d.ts
│ │ │ ├── v8.d.ts
│ │ │ ├── vm.d.ts
│ │ │ ├── wasi.d.ts
│ │ │ ├── worker_threads.d.ts
│ │ │ └── zlib.d.ts
│ │ └── node-fetch
│ │ ├── externals.d.ts
│ │ ├── index.d.ts
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── asynckit
│ │ ├── bench.js
│ │ ├── index.js
│ │ ├── lib
│ │ │ ├── abort.js
│ │ │ ├── async.js
│ │ │ ├── defer.js
│ │ │ ├── iterate.js
│ │ │ ├── readable_asynckit.js
│ │ │ ├── readable_parallel.js
│ │ │ ├── readable_serial_ordered.js
│ │ │ ├── readable_serial.js
│ │ │ ├── state.js
│ │ │ ├── streamify.js
│ │ │ └── terminator.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── parallel.js
│ │ ├── README.md
│ │ ├── serial.js
│ │ ├── serialOrdered.js
│ │ └── stream.js
│ ├── balanced-match
│ │ ├── .github
│ │ │ └── FUNDING.yml
│ │ ├── index.js
│ │ ├── LICENSE.md
│ │ ├── package.json
│ │ └── README.md
│ ├── brace-expansion
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── bytes
│ │ ├── History.md
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── Readme.md
│ ├── combined-stream
│ │ ├── lib
│ │ │ └── combined_stream.js
│ │ ├── License
│ │ ├── package.json
│ │ ├── Readme.md
│ │ └── yarn.lock
│ ├── concat-map
│ │ ├── .travis.yml
│ │ ├── example
│ │ │ └── map.js
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── README.markdown
│ │ └── test
│ │ └── map.js
│ ├── content-type
│ │ ├── HISTORY.md
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── data-uri-to-buffer
│ │ ├── dist
│ │ │ ├── index.d.ts
│ │ │ ├── index.js
│ │ │ └── index.js.map
│ │ ├── package.json
│ │ ├── README.md
│ │ └── src
│ │ └── index.ts
│ ├── delayed-stream
│ │ ├── .npmignore
│ │ ├── lib
│ │ │ └── delayed_stream.js
│ │ ├── License
│ │ ├── Makefile
│ │ ├── package.json
│ │ └── Readme.md
│ ├── depd
│ │ ├── History.md
│ │ ├── index.js
│ │ ├── lib
│ │ │ └── browser
│ │ │ └── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── Readme.md
│ ├── fetch-blob
│ │ ├── file.d.ts
│ │ ├── file.js
│ │ ├── from.d.ts
│ │ ├── from.js
│ │ ├── index.d.ts
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── README.md
│ │ └── streams.cjs
│ ├── form-data
│ │ ├── index.d.ts
│ │ ├── lib
│ │ │ ├── browser.js
│ │ │ ├── form_data.js
│ │ │ └── populate.js
│ │ ├── License
│ │ ├── package.json
│ │ └── Readme.md
│ ├── formdata-polyfill
│ │ ├── esm.min.d.ts
│ │ ├── esm.min.js
│ │ ├── formdata-to-blob.js
│ │ ├── FormData.js
│ │ ├── formdata.min.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── fs.realpath
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── old.js
│ │ ├── package.json
│ │ └── README.md
│ ├── function-bind
│ │ ├── .eslintrc
│ │ ├── .github
│ │ │ ├── FUNDING.yml
│ │ │ └── SECURITY.md
│ │ ├── .nycrc
│ │ ├── CHANGELOG.md
│ │ ├── implementation.js
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── README.md
│ │ └── test
│ │ ├── .eslintrc
│ │ └── index.js
│ ├── glob
│ │ ├── common.js
│ │ ├── glob.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── README.md
│ │ └── sync.js
│ ├── hasown
│ │ ├── .eslintrc
│ │ ├── .github
│ │ │ └── FUNDING.yml
│ │ ├── .nycrc
│ │ ├── CHANGELOG.md
│ │ ├── index.d.ts
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── README.md
│ │ └── tsconfig.json
│ ├── http-errors
│ │ ├── HISTORY.md
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── iconv-lite
│ │ ├── .github
│ │ │ └── dependabot.yml
│ │ ├── .idea
│ │ │ ├── codeStyles
│ │ │ │ ├── codeStyleConfig.xml
│ │ │ │ └── Project.xml
│ │ │ ├── iconv-lite.iml
│ │ │ ├── inspectionProfiles
│ │ │ │ └── Project_Default.xml
│ │ │ ├── modules.xml
│ │ │ └── vcs.xml
│ │ ├── Changelog.md
│ │ ├── encodings
│ │ │ ├── dbcs-codec.js
│ │ │ ├── dbcs-data.js
│ │ │ ├── index.js
│ │ │ ├── internal.js
│ │ │ ├── sbcs-codec.js
│ │ │ ├── sbcs-data-generated.js
│ │ │ ├── sbcs-data.js
│ │ │ ├── tables
│ │ │ │ ├── big5-added.json
│ │ │ │ ├── cp936.json
│ │ │ │ ├── cp949.json
│ │ │ │ ├── cp950.json
│ │ │ │ ├── eucjp.json
│ │ │ │ ├── gb18030-ranges.json
│ │ │ │ ├── gbk-added.json
│ │ │ │ └── shiftjis.json
│ │ │ ├── utf16.js
│ │ │ ├── utf32.js
│ │ │ └── utf7.js
│ │ ├── lib
│ │ │ ├── bom-handling.js
│ │ │ ├── index.d.ts
│ │ │ ├── index.js
│ │ │ └── streams.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── inflight
│ │ ├── inflight.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── inherits
│ │ ├── inherits_browser.js
│ │ ├── inherits.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── interpret
│ │ ├── CHANGELOG
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── mjs-stub.js
│ │ ├── package.json
│ │ └── README.md
│ ├── is-core-module
│ │ ├── .eslintrc
│ │ ├── .nycrc
│ │ ├── CHANGELOG.md
│ │ ├── core.json
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── README.md
│ │ └── test
│ │ └── index.js
│ ├── mime-db
│ │ ├── db.json
│ │ ├── HISTORY.md
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── mime-types
│ │ ├── HISTORY.md
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── minimatch
│ │ ├── LICENSE
│ │ ├── minimatch.js
│ │ ├── package.json
│ │ └── README.md
│ ├── minimist
│ │ ├── .eslintrc
│ │ ├── .github
│ │ │ └── FUNDING.yml
│ │ ├── .nycrc
│ │ ├── CHANGELOG.md
│ │ ├── example
│ │ │ └── parse.js
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── README.md
│ │ └── test
│ │ ├── all_bool.js
│ │ ├── bool.js
│ │ ├── dash.js
│ │ ├── default_bool.js
│ │ ├── dotted.js
│ │ ├── kv_short.js
│ │ ├── long.js
│ │ ├── num.js
│ │ ├── parse_modified.js
│ │ ├── parse.js
│ │ ├── proto.js
│ │ ├── short.js
│ │ ├── stop_early.js
│ │ ├── unknown.js
│ │ └── whitespace.js
│ ├── node-domexception
│ │ ├── .history
│ │ │ ├── index_20210527203842.js
│ │ │ ├── index_20210527203947.js
│ │ │ ├── index_20210527204259.js
│ │ │ ├── index_20210527204418.js
│ │ │ ├── index_20210527204756.js
│ │ │ ├── index_20210527204833.js
│ │ │ ├── index_20210527211208.js
│ │ │ ├── index_20210527211248.js
│ │ │ ├── index_20210527212722.js
│ │ │ ├── index_20210527212731.js
│ │ │ ├── index_20210527212746.js
│ │ │ ├── index_20210527212900.js
│ │ │ ├── index_20210527213022.js
│ │ │ ├── index_20210527213822.js
│ │ │ ├── index_20210527213843.js
│ │ │ ├── index_20210527213852.js
│ │ │ ├── index_20210527213910.js
│ │ │ ├── index_20210527214034.js
│ │ │ ├── index_20210527214643.js
│ │ │ ├── index_20210527214654.js
│ │ │ ├── index_20210527214700.js
│ │ │ ├── package_20210527203733.json
│ │ │ ├── package_20210527203825.json
│ │ │ ├── package_20210527204621.json
│ │ │ ├── package_20210527204913.json
│ │ │ ├── package_20210527204925.json
│ │ │ ├── package_20210527205145.json
│ │ │ ├── package_20210527205156.json
│ │ │ ├── README_20210527203617.md
│ │ │ ├── README_20210527212714.md
│ │ │ ├── README_20210527213345.md
│ │ │ ├── README_20210527213411.md
│ │ │ ├── README_20210527213803.md
│ │ │ ├── README_20210527214323.md
│ │ │ ├── README_20210527214408.md
│ │ │ ├── test_20210527205603.js
│ │ │ ├── test_20210527205957.js
│ │ │ └── test_20210527210021.js
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── node-fetch
│ │ ├── @types
│ │ │ └── index.d.ts
│ │ ├── LICENSE.md
│ │ ├── package.json
│ │ ├── README.md
│ │ └── src
│ │ ├── body.js
│ │ ├── errors
│ │ │ ├── abort-error.js
│ │ │ ├── base.js
│ │ │ └── fetch-error.js
│ │ ├── headers.js
│ │ ├── index.js
│ │ ├── request.js
│ │ ├── response.js
│ │ └── utils
│ │ ├── get-search.js
│ │ ├── is-redirect.js
│ │ ├── is.js
│ │ ├── multipart-parser.js
│ │ └── referrer.js
│ ├── once
│ │ ├── LICENSE
│ │ ├── once.js
│ │ ├── package.json
│ │ └── README.md
│ ├── path-is-absolute
│ │ ├── index.js
│ │ ├── license
│ │ ├── package.json
│ │ └── readme.md
│ ├── path-parse
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── raw-body
│ │ ├── HISTORY.md
│ │ ├── index.d.ts
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── README.md
│ │ └── SECURITY.md
│ ├── rechoir
│ │ ├── .npmignore
│ │ ├── .travis.yml
│ │ ├── CHANGELOG
│ │ ├── index.js
│ │ ├── lib
│ │ │ ├── extension.js
│ │ │ ├── normalize.js
│ │ │ └── register.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── resolve
│ │ ├── .editorconfig
│ │ ├── .eslintrc
│ │ ├── .github
│ │ │ └── FUNDING.yml
│ │ ├── async.js
│ │ ├── bin
│ │ │ └── resolve
│ │ ├── example
│ │ │ ├── async.js
│ │ │ └── sync.js
│ │ ├── index.js
│ │ ├── lib
│ │ │ ├── async.js
│ │ │ ├── caller.js
│ │ │ ├── core.js
│ │ │ ├── core.json
│ │ │ ├── homedir.js
│ │ │ ├── is-core.js
│ │ │ ├── node-modules-paths.js
│ │ │ ├── normalize-options.js
│ │ │ └── sync.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── readme.markdown
│ │ ├── SECURITY.md
│ │ ├── sync.js
│ │ └── test
│ │ ├── core.js
│ │ ├── dotdot
│ │ │ ├── abc
│ │ │ │ └── index.js
│ │ │ └── index.js
│ │ ├── dotdot.js
│ │ ├── faulty_basedir.js
│ │ ├── filter_sync.js
│ │ ├── filter.js
│ │ ├── home_paths_sync.js
│ │ ├── home_paths.js
│ │ ├── mock_sync.js
│ │ ├── mock.js
│ │ ├── module_dir
│ │ │ ├── xmodules
│ │ │ │ └── aaa
│ │ │ │ └── index.js
│ │ │ ├── ymodules
│ │ │ │ └── aaa
│ │ │ │ └── index.js
│ │ │ └── zmodules
│ │ │ └── bbb
│ │ │ ├── main.js
│ │ │ └── package.json
│ │ ├── module_dir.js
│ │ ├── node_path
│ │ │ ├── x
│ │ │ │ ├── aaa
│ │ │ │ │ └── index.js
│ │ │ │ └── ccc
│ │ │ │ └── index.js
│ │ │ └── y
│ │ │ ├── bbb
│ │ │ │ └── index.js
│ │ │ └── ccc
│ │ │ └── index.js
│ │ ├── node_path.js
│ │ ├── node-modules-paths.js
│ │ ├── nonstring.js
│ │ ├── pathfilter
│ │ │ └── deep_ref
│ │ │ └── main.js
│ │ ├── pathfilter.js
│ │ ├── precedence
│ │ │ ├── aaa
│ │ │ │ ├── index.js
│ │ │ │ └── main.js
│ │ │ ├── aaa.js
│ │ │ ├── bbb
│ │ │ │ └── main.js
│ │ │ └── bbb.js
│ │ ├── precedence.js
│ │ ├── resolver
│ │ │ ├── baz
│ │ │ │ ├── doom.js
│ │ │ │ ├── package.json
│ │ │ │ └── quux.js
│ │ │ ├── browser_field
│ │ │ │ ├── a.js
│ │ │ │ ├── b.js
│ │ │ │ └── package.json
│ │ │ ├── cup.coffee
│ │ │ ├── dot_main
│ │ │ │ ├── index.js
│ │ │ │ └── package.json
│ │ │ ├── dot_slash_main
│ │ │ │ ├── index.js
│ │ │ │ └── package.json
│ │ │ ├── false_main
│ │ │ │ ├── index.js
│ │ │ │ └── package.json
│ │ │ ├── foo.js
│ │ │ ├── incorrect_main
│ │ │ │ ├── index.js
│ │ │ │ └── package.json
│ │ │ ├── invalid_main
│ │ │ │ └── package.json
│ │ │ ├── mug.coffee
│ │ │ ├── mug.js
│ │ │ ├── multirepo
│ │ │ │ ├── lerna.json
│ │ │ │ ├── package.json
│ │ │ │ └── packages
│ │ │ │ ├── package-a
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── package.json
│ │ │ │ └── package-b
│ │ │ │ ├── index.js
│ │ │ │ └── package.json
│ │ │ ├── nested_symlinks
│ │ │ │ └── mylib
│ │ │ │ ├── async.js
│ │ │ │ ├── package.json
│ │ │ │ └── sync.js
│ │ │ ├── other_path
│ │ │ │ ├── lib
│ │ │ │ │ └── other-lib.js
│ │ │ │ └── root.js
│ │ │ ├── quux
│ │ │ │ └── foo
│ │ │ │ └── index.js
│ │ │ ├── same_names
│ │ │ │ ├── foo
│ │ │ │ │ └── index.js
│ │ │ │ └── foo.js
│ │ │ ├── symlinked
│ │ │ │ ├── _
│ │ │ │ │ ├── node_modules
│ │ │ │ │ │ └── foo.js
│ │ │ │ │ └── symlink_target
│ │ │ │ │ └── .gitkeep
│ │ │ │ └── package
│ │ │ │ ├── bar.js
│ │ │ │ └── package.json
│ │ │ └── without_basedir
│ │ │ └── main.js
│ │ ├── resolver_sync.js
│ │ ├── resolver.js
│ │ ├── shadowed_core
│ │ │ └── node_modules
│ │ │ └── util
│ │ │ └── index.js
│ │ ├── shadowed_core.js
│ │ ├── subdirs.js
│ │ └── symlinks.js
│ ├── safer-buffer
│ │ ├── dangerous.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── Porting-Buffer.md
│ │ ├── Readme.md
│ │ ├── safer.js
│ │ └── tests.js
│ ├── setprototypeof
│ │ ├── index.d.ts
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── README.md
│ │ └── test
│ │ └── index.js
│ ├── shelljs
│ │ ├── bin
│ │ │ └── shjs
│ │ ├── CHANGELOG.md
│ │ ├── commands.js
│ │ ├── global.js
│ │ ├── LICENSE
│ │ ├── make.js
│ │ ├── package.json
│ │ ├── plugin.js
│ │ ├── README.md
│ │ ├── shell.js
│ │ └── src
│ │ ├── cat.js
│ │ ├── cd.js
│ │ ├── chmod.js
│ │ ├── common.js
│ │ ├── cp.js
│ │ ├── dirs.js
│ │ ├── echo.js
│ │ ├── error.js
│ │ ├── exec-child.js
│ │ ├── exec.js
│ │ ├── find.js
│ │ ├── grep.js
│ │ ├── head.js
│ │ ├── ln.js
│ │ ├── ls.js
│ │ ├── mkdir.js
│ │ ├── mv.js
│ │ ├── popd.js
│ │ ├── pushd.js
│ │ ├── pwd.js
│ │ ├── rm.js
│ │ ├── sed.js
│ │ ├── set.js
│ │ ├── sort.js
│ │ ├── tail.js
│ │ ├── tempdir.js
│ │ ├── test.js
│ │ ├── to.js
│ │ ├── toEnd.js
│ │ ├── touch.js
│ │ ├── uniq.js
│ │ └── which.js
│ ├── shx
│ │ ├── CHANGELOG.md
│ │ ├── lib
│ │ │ ├── cli.js
│ │ │ ├── config.js
│ │ │ ├── help.js
│ │ │ ├── plugin-true-false.js
│ │ │ ├── printCmdRet.js
│ │ │ └── shx.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── statuses
│ │ ├── codes.json
│ │ ├── HISTORY.md
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── supports-preserve-symlinks-flag
│ │ ├── .eslintrc
│ │ ├── .github
│ │ │ └── FUNDING.yml
│ │ ├── .nycrc
│ │ ├── browser.js
│ │ ├── CHANGELOG.md
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── README.md
│ │ └── test
│ │ └── index.js
│ ├── toidentifier
│ │ ├── HISTORY.md
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── typescript
│ │ ├── bin
│ │ │ ├── tsc
│ │ │ └── tsserver
│ │ ├── lib
│ │ │ ├── _tsc.js
│ │ │ ├── _tsserver.js
│ │ │ ├── _typingsInstaller.js
│ │ │ ├── cancellationToken.js
│ │ │ ├── cs
│ │ │ │ └── diagnosticMessages.generated.json
│ │ │ ├── de
│ │ │ │ └── diagnosticMessages.generated.json
│ │ │ ├── es
│ │ │ │ └── diagnosticMessages.generated.json
│ │ │ ├── fr
│ │ │ │ └── diagnosticMessages.generated.json
│ │ │ ├── it
│ │ │ │ └── diagnosticMessages.generated.json
│ │ │ ├── ja
│ │ │ │ └── diagnosticMessages.generated.json
│ │ │ ├── ko
│ │ │ │ └── diagnosticMessages.generated.json
│ │ │ ├── lib.d.ts
│ │ │ ├── lib.decorators.d.ts
│ │ │ ├── lib.decorators.legacy.d.ts
│ │ │ ├── lib.dom.asynciterable.d.ts
│ │ │ ├── lib.dom.d.ts
│ │ │ ├── lib.dom.iterable.d.ts
│ │ │ ├── lib.es2015.collection.d.ts
│ │ │ ├── lib.es2015.core.d.ts
│ │ │ ├── lib.es2015.d.ts
│ │ │ ├── lib.es2015.generator.d.ts
│ │ │ ├── lib.es2015.iterable.d.ts
│ │ │ ├── lib.es2015.promise.d.ts
│ │ │ ├── lib.es2015.proxy.d.ts
│ │ │ ├── lib.es2015.reflect.d.ts
│ │ │ ├── lib.es2015.symbol.d.ts
│ │ │ ├── lib.es2015.symbol.wellknown.d.ts
│ │ │ ├── lib.es2016.array.include.d.ts
│ │ │ ├── lib.es2016.d.ts
│ │ │ ├── lib.es2016.full.d.ts
│ │ │ ├── lib.es2016.intl.d.ts
│ │ │ ├── lib.es2017.arraybuffer.d.ts
│ │ │ ├── lib.es2017.d.ts
│ │ │ ├── lib.es2017.date.d.ts
│ │ │ ├── lib.es2017.full.d.ts
│ │ │ ├── lib.es2017.intl.d.ts
│ │ │ ├── lib.es2017.object.d.ts
│ │ │ ├── lib.es2017.sharedmemory.d.ts
│ │ │ ├── lib.es2017.string.d.ts
│ │ │ ├── lib.es2017.typedarrays.d.ts
│ │ │ ├── lib.es2018.asyncgenerator.d.ts
│ │ │ ├── lib.es2018.asynciterable.d.ts
│ │ │ ├── lib.es2018.d.ts
│ │ │ ├── lib.es2018.full.d.ts
│ │ │ ├── lib.es2018.intl.d.ts
│ │ │ ├── lib.es2018.promise.d.ts
│ │ │ ├── lib.es2018.regexp.d.ts
│ │ │ ├── lib.es2019.array.d.ts
│ │ │ ├── lib.es2019.d.ts
│ │ │ ├── lib.es2019.full.d.ts
│ │ │ ├── lib.es2019.intl.d.ts
│ │ │ ├── lib.es2019.object.d.ts
│ │ │ ├── lib.es2019.string.d.ts
│ │ │ ├── lib.es2019.symbol.d.ts
│ │ │ ├── lib.es2020.bigint.d.ts
│ │ │ ├── lib.es2020.d.ts
│ │ │ ├── lib.es2020.date.d.ts
│ │ │ ├── lib.es2020.full.d.ts
│ │ │ ├── lib.es2020.intl.d.ts
│ │ │ ├── lib.es2020.number.d.ts
│ │ │ ├── lib.es2020.promise.d.ts
│ │ │ ├── lib.es2020.sharedmemory.d.ts
│ │ │ ├── lib.es2020.string.d.ts
│ │ │ ├── lib.es2020.symbol.wellknown.d.ts
│ │ │ ├── lib.es2021.d.ts
│ │ │ ├── lib.es2021.full.d.ts
│ │ │ ├── lib.es2021.intl.d.ts
│ │ │ ├── lib.es2021.promise.d.ts
│ │ │ ├── lib.es2021.string.d.ts
│ │ │ ├── lib.es2021.weakref.d.ts
│ │ │ ├── lib.es2022.array.d.ts
│ │ │ ├── lib.es2022.d.ts
│ │ │ ├── lib.es2022.error.d.ts
│ │ │ ├── lib.es2022.full.d.ts
│ │ │ ├── lib.es2022.intl.d.ts
│ │ │ ├── lib.es2022.object.d.ts
│ │ │ ├── lib.es2022.regexp.d.ts
│ │ │ ├── lib.es2022.string.d.ts
│ │ │ ├── lib.es2023.array.d.ts
│ │ │ ├── lib.es2023.collection.d.ts
│ │ │ ├── lib.es2023.d.ts
│ │ │ ├── lib.es2023.full.d.ts
│ │ │ ├── lib.es2023.intl.d.ts
│ │ │ ├── lib.es2024.arraybuffer.d.ts
│ │ │ ├── lib.es2024.collection.d.ts
│ │ │ ├── lib.es2024.d.ts
│ │ │ ├── lib.es2024.full.d.ts
│ │ │ ├── lib.es2024.object.d.ts
│ │ │ ├── lib.es2024.promise.d.ts
│ │ │ ├── lib.es2024.regexp.d.ts
│ │ │ ├── lib.es2024.sharedmemory.d.ts
│ │ │ ├── lib.es2024.string.d.ts
│ │ │ ├── lib.es5.d.ts
│ │ │ ├── lib.es6.d.ts
│ │ │ ├── lib.esnext.array.d.ts
│ │ │ ├── lib.esnext.collection.d.ts
│ │ │ ├── lib.esnext.d.ts
│ │ │ ├── lib.esnext.decorators.d.ts
│ │ │ ├── lib.esnext.disposable.d.ts
│ │ │ ├── lib.esnext.full.d.ts
│ │ │ ├── lib.esnext.intl.d.ts
│ │ │ ├── lib.esnext.iterator.d.ts
│ │ │ ├── lib.scripthost.d.ts
│ │ │ ├── lib.webworker.asynciterable.d.ts
│ │ │ ├── lib.webworker.d.ts
│ │ │ ├── lib.webworker.importscripts.d.ts
│ │ │ ├── lib.webworker.iterable.d.ts
│ │ │ ├── pl
│ │ │ │ └── diagnosticMessages.generated.json
│ │ │ ├── pt-br
│ │ │ │ └── diagnosticMessages.generated.json
│ │ │ ├── ru
│ │ │ │ └── diagnosticMessages.generated.json
│ │ │ ├── tr
│ │ │ │ └── diagnosticMessages.generated.json
│ │ │ ├── tsc.js
│ │ │ ├── tsserver.js
│ │ │ ├── tsserverlibrary.d.ts
│ │ │ ├── tsserverlibrary.js
│ │ │ ├── typescript.d.ts
│ │ │ ├── typescript.js
│ │ │ ├── typesMap.json
│ │ │ ├── typingsInstaller.js
│ │ │ ├── watchGuard.js
│ │ │ ├── zh-cn
│ │ │ │ └── diagnosticMessages.generated.json
│ │ │ └── zh-tw
│ │ │ └── diagnosticMessages.generated.json
│ │ ├── LICENSE.txt
│ │ ├── package.json
│ │ ├── README.md
│ │ ├── SECURITY.md
│ │ └── ThirdPartyNoticeText.txt
│ ├── undici-types
│ │ ├── agent.d.ts
│ │ ├── api.d.ts
│ │ ├── balanced-pool.d.ts
│ │ ├── cache.d.ts
│ │ ├── client.d.ts
│ │ ├── connector.d.ts
│ │ ├── content-type.d.ts
│ │ ├── cookies.d.ts
│ │ ├── diagnostics-channel.d.ts
│ │ ├── dispatcher.d.ts
│ │ ├── env-http-proxy-agent.d.ts
│ │ ├── errors.d.ts
│ │ ├── eventsource.d.ts
│ │ ├── fetch.d.ts
│ │ ├── file.d.ts
│ │ ├── filereader.d.ts
│ │ ├── formdata.d.ts
│ │ ├── global-dispatcher.d.ts
│ │ ├── global-origin.d.ts
│ │ ├── handlers.d.ts
│ │ ├── header.d.ts
│ │ ├── index.d.ts
│ │ ├── interceptors.d.ts
│ │ ├── LICENSE
│ │ ├── mock-agent.d.ts
│ │ ├── mock-client.d.ts
│ │ ├── mock-errors.d.ts
│ │ ├── mock-interceptor.d.ts
│ │ ├── mock-pool.d.ts
│ │ ├── package.json
│ │ ├── patch.d.ts
│ │ ├── pool-stats.d.ts
│ │ ├── pool.d.ts
│ │ ├── proxy-agent.d.ts
│ │ ├── readable.d.ts
│ │ ├── README.md
│ │ ├── retry-agent.d.ts
│ │ ├── retry-handler.d.ts
│ │ ├── util.d.ts
│ │ ├── webidl.d.ts
│ │ └── websocket.d.ts
│ ├── unpipe
│ │ ├── HISTORY.md
│ │ ├── index.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ ├── web-streams-polyfill
│ │ ├── dist
│ │ │ ├── polyfill.es2018.js
│ │ │ ├── polyfill.es2018.js.map
│ │ │ ├── polyfill.es2018.min.js
│ │ │ ├── polyfill.es2018.min.js.map
│ │ │ ├── polyfill.es2018.mjs
│ │ │ ├── polyfill.es2018.mjs.map
│ │ │ ├── polyfill.es6.js
│ │ │ ├── polyfill.es6.js.map
│ │ │ ├── polyfill.es6.min.js
│ │ │ ├── polyfill.es6.min.js.map
│ │ │ ├── polyfill.es6.mjs
│ │ │ ├── polyfill.es6.mjs.map
│ │ │ ├── polyfill.js
│ │ │ ├── polyfill.js.map
│ │ │ ├── polyfill.min.js
│ │ │ ├── polyfill.min.js.map
│ │ │ ├── polyfill.mjs
│ │ │ ├── polyfill.mjs.map
│ │ │ ├── ponyfill.es2018.js
│ │ │ ├── ponyfill.es2018.js.map
│ │ │ ├── ponyfill.es2018.mjs
│ │ │ ├── ponyfill.es2018.mjs.map
│ │ │ ├── ponyfill.es6.js
│ │ │ ├── ponyfill.es6.js.map
│ │ │ ├── ponyfill.es6.mjs
│ │ │ ├── ponyfill.es6.mjs.map
│ │ │ ├── ponyfill.js
│ │ │ ├── ponyfill.js.map
│ │ │ ├── ponyfill.mjs
│ │ │ ├── ponyfill.mjs.map
│ │ │ └── types
│ │ │ ├── polyfill.d.ts
│ │ │ ├── ponyfill.d.ts
│ │ │ ├── ts3.6
│ │ │ │ ├── polyfill.d.ts
│ │ │ │ └── ponyfill.d.ts
│ │ │ └── tsdoc-metadata.json
│ │ ├── es2018
│ │ │ └── package.json
│ │ ├── es6
│ │ │ └── package.json
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── ponyfill
│ │ │ ├── es2018
│ │ │ │ └── package.json
│ │ │ ├── es6
│ │ │ │ └── package.json
│ │ │ └── package.json
│ │ └── README.md
│ ├── wrappy
│ │ ├── LICENSE
│ │ ├── package.json
│ │ ├── README.md
│ │ └── wrappy.js
│ ├── zod
│ │ ├── index.d.ts
│ │ ├── lib
│ │ │ ├── __tests__
│ │ │ │ ├── Mocker.d.ts
│ │ │ │ └── Mocker.js
│ │ │ ├── benchmarks
│ │ │ │ ├── datetime.d.ts
│ │ │ │ ├── datetime.js
│ │ │ │ ├── discriminatedUnion.d.ts
│ │ │ │ ├── discriminatedUnion.js
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── index.js
│ │ │ │ ├── ipv4.d.ts
│ │ │ │ ├── ipv4.js
│ │ │ │ ├── object.d.ts
│ │ │ │ ├── object.js
│ │ │ │ ├── primitives.d.ts
│ │ │ │ ├── primitives.js
│ │ │ │ ├── realworld.d.ts
│ │ │ │ ├── realworld.js
│ │ │ │ ├── string.d.ts
│ │ │ │ ├── string.js
│ │ │ │ ├── union.d.ts
│ │ │ │ └── union.js
│ │ │ ├── errors.d.ts
│ │ │ ├── errors.js
│ │ │ ├── external.d.ts
│ │ │ ├── external.js
│ │ │ ├── helpers
│ │ │ │ ├── enumUtil.d.ts
│ │ │ │ ├── enumUtil.js
│ │ │ │ ├── errorUtil.d.ts
│ │ │ │ ├── errorUtil.js
│ │ │ │ ├── parseUtil.d.ts
│ │ │ │ ├── parseUtil.js
│ │ │ │ ├── partialUtil.d.ts
│ │ │ │ ├── partialUtil.js
│ │ │ │ ├── typeAliases.d.ts
│ │ │ │ ├── typeAliases.js
│ │ │ │ ├── util.d.ts
│ │ │ │ └── util.js
│ │ │ ├── index.d.ts
│ │ │ ├── index.js
│ │ │ ├── index.mjs
│ │ │ ├── index.umd.js
│ │ │ ├── locales
│ │ │ │ ├── en.d.ts
│ │ │ │ └── en.js
│ │ │ ├── types.d.ts
│ │ │ ├── types.js
│ │ │ ├── ZodError.d.ts
│ │ │ └── ZodError.js
│ │ ├── LICENSE
│ │ ├── package.json
│ │ └── README.md
│ └── zod-to-json-schema
│ ├── .github
│ │ └── FUNDING.yml
│ ├── .prettierrc.json
│ ├── changelog.md
│ ├── contributing.md
│ ├── createIndex.ts
│ ├── dist
│ │ ├── cjs
│ │ │ ├── errorMessages.js
│ │ │ ├── index.js
│ │ │ ├── Options.js
│ │ │ ├── package.json
│ │ │ ├── parseDef.js
│ │ │ ├── parsers
│ │ │ │ ├── any.js
│ │ │ │ ├── array.js
│ │ │ │ ├── bigint.js
│ │ │ │ ├── boolean.js
│ │ │ │ ├── branded.js
│ │ │ │ ├── catch.js
│ │ │ │ ├── date.js
│ │ │ │ ├── default.js
│ │ │ │ ├── effects.js
│ │ │ │ ├── enum.js
│ │ │ │ ├── intersection.js
│ │ │ │ ├── literal.js
│ │ │ │ ├── map.js
│ │ │ │ ├── nativeEnum.js
│ │ │ │ ├── never.js
│ │ │ │ ├── null.js
│ │ │ │ ├── nullable.js
│ │ │ │ ├── number.js
│ │ │ │ ├── object.js
│ │ │ │ ├── optional.js
│ │ │ │ ├── pipeline.js
│ │ │ │ ├── promise.js
│ │ │ │ ├── readonly.js
│ │ │ │ ├── record.js
│ │ │ │ ├── set.js
│ │ │ │ ├── string.js
│ │ │ │ ├── tuple.js
│ │ │ │ ├── undefined.js
│ │ │ │ ├── union.js
│ │ │ │ └── unknown.js
│ │ │ ├── Refs.js
│ │ │ └── zodToJsonSchema.js
│ │ ├── esm
│ │ │ ├── errorMessages.js
│ │ │ ├── index.js
│ │ │ ├── Options.js
│ │ │ ├── package.json
│ │ │ ├── parseDef.js
│ │ │ ├── parsers
│ │ │ │ ├── any.js
│ │ │ │ ├── array.js
│ │ │ │ ├── bigint.js
│ │ │ │ ├── boolean.js
│ │ │ │ ├── branded.js
│ │ │ │ ├── catch.js
│ │ │ │ ├── date.js
│ │ │ │ ├── default.js
│ │ │ │ ├── effects.js
│ │ │ │ ├── enum.js
│ │ │ │ ├── intersection.js
│ │ │ │ ├── literal.js
│ │ │ │ ├── map.js
│ │ │ │ ├── nativeEnum.js
│ │ │ │ ├── never.js
│ │ │ │ ├── null.js
│ │ │ │ ├── nullable.js
│ │ │ │ ├── number.js
│ │ │ │ ├── object.js
│ │ │ │ ├── optional.js
│ │ │ │ ├── pipeline.js
│ │ │ │ ├── promise.js
│ │ │ │ ├── readonly.js
│ │ │ │ ├── record.js
│ │ │ │ ├── set.js
│ │ │ │ ├── string.js
│ │ │ │ ├── tuple.js
│ │ │ │ ├── undefined.js
│ │ │ │ ├── union.js
│ │ │ │ └── unknown.js
│ │ │ ├── Refs.js
│ │ │ └── zodToJsonSchema.js
│ │ └── types
│ │ ├── errorMessages.d.ts
│ │ ├── index.d.ts
│ │ ├── Options.d.ts
│ │ ├── parseDef.d.ts
│ │ ├── parsers
│ │ │ ├── any.d.ts
│ │ │ ├── array.d.ts
│ │ │ ├── bigint.d.ts
│ │ │ ├── boolean.d.ts
│ │ │ ├── branded.d.ts
│ │ │ ├── catch.d.ts
│ │ │ ├── date.d.ts
│ │ │ ├── default.d.ts
│ │ │ ├── effects.d.ts
│ │ │ ├── enum.d.ts
│ │ │ ├── intersection.d.ts
│ │ │ ├── literal.d.ts
│ │ │ ├── map.d.ts
│ │ │ ├── nativeEnum.d.ts
│ │ │ ├── never.d.ts
│ │ │ ├── null.d.ts
│ │ │ ├── nullable.d.ts
│ │ │ ├── number.d.ts
│ │ │ ├── object.d.ts
│ │ │ ├── optional.d.ts
│ │ │ ├── pipeline.d.ts
│ │ │ ├── promise.d.ts
│ │ │ ├── readonly.d.ts
│ │ │ ├── record.d.ts
│ │ │ ├── set.d.ts
│ │ │ ├── string.d.ts
│ │ │ ├── tuple.d.ts
│ │ │ ├── undefined.d.ts
│ │ │ ├── union.d.ts
│ │ │ └── unknown.d.ts
│ │ ├── Refs.d.ts
│ │ └── zodToJsonSchema.d.ts
│ ├── LICENSE
│ ├── package.json
│ ├── postcjs.ts
│ ├── postesm.ts
│ ├── README.md
│ └── SECURITY.md
├── package-lock.json
├── package.json
├── README.md
├── schemas.ts
└── tsconfig.json
```
# Files
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
```markdown
# Supabase MCP Server
A Model Context Protocol (MCP) server that provides programmatic access to the Supabase Management API. This server allows AI models and other clients to manage Supabase projects and organizations through a standardized interface.
## Features
### Project Management
- List all projects
- Get project details
- Create new projects
- Delete projects
- Retrieve project API keys
### Organization Management
- List all organizations
- Get organization details
- Create new organizations
## Installation
Add the following to your Claude Config JSON file
```
{
"mcpServers": {
"supabase": {
"command": "npx",
"args": [
"y",
"@joshuarileydev/supabase-mcp-server"
],
"env": {
"SUPABASE_API_KEY": "API_KEY_HERE"
}
}
}
}
```
```
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
```json
{
"compilerOptions": {
"target": "ES2022",
"module": "Node16",
"moduleResolution": "Node16",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"outDir": "./dist",
"rootDir": "."
},
"exclude": ["node_modules"],
"include": [
"./**/*.ts"
]
}
```
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
```json
{
"name": "@joshuarileydev/supabase-mcp-server",
"version": "0.0.2",
"description": "An MCP server for using the Supabase API",
"license": "MIT",
"type": "module",
"bin": {
"mcp-server": "dist/index.js"
},
"files": [
"dist"
],
"scripts": {
"build": "tsc && shx chmod +x dist/*.js",
"prepare": "npm run build",
"watch": "tsc --watch"
},
"dependencies": {
"@modelcontextprotocol/sdk": "0.6.0",
"@types/node-fetch": "^2.6.12",
"node-fetch": "^3.3.2",
"zod": "^3.22.4",
"zod-to-json-schema": "^3.23.5"
},
"devDependencies": {
"shx": "^0.3.4",
"typescript": "^5.6.2"
}
}
```
--------------------------------------------------------------------------------
/schemas.ts:
--------------------------------------------------------------------------------
```typescript
import { z } from 'zod';
// Common types
export interface SupabaseResponse<T> {
data: T;
error: null | {
message: string;
};
}
export interface Project {
id: string;
organization_id: string;
name: string;
region: string;
created_at: string;
}
export interface Organization {
id: string;
name: string;
billing_email: string;
created_at: string;
}
export interface ProjectApiKey {
api_key: string;
name: string;
tags?: string[];
created_at: string;
}
// Input Schemas
// Projects
export const ListProjectsInputSchema = z.object({
ref: z.string().optional()
});
export const GetProjectInputSchema = z.object({
ref: z.string()
});
export const CreateProjectInputSchema = z.object({
name: z.string(),
organization_id: z.string(),
region: z.string(),
db_pass: z.string(),
plan: z.string().optional()
});
export const DeleteProjectInputSchema = z.object({
ref: z.string()
});
// Organizations
export const ListOrganizationsInputSchema = z.object({});
export const GetOrganizationInputSchema = z.object({
slug: z.string()
});
export const CreateOrganizationInputSchema = z.object({
name: z.string(),
billing_email: z.string()
});
export const UpdateOrganizationInputSchema = z.object({
slug: z.string(),
name: z.string().optional(),
billing_email: z.string().optional()
});
// Project API Keys
export const GetProjectApiKeysInputSchema = z.object({
ref: z.string(),
// Optional filter by key name
name: z.string().optional()
});
```
--------------------------------------------------------------------------------
/index.ts:
--------------------------------------------------------------------------------
```typescript
#!/usr/bin/env node
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import {
CallToolRequestSchema,
ListToolsRequestSchema,
} from "@modelcontextprotocol/sdk/types.js";
import fetch from "node-fetch";
import { z } from 'zod';
import { zodToJsonSchema } from 'zod-to-json-schema';
import {
CreateProjectInputSchema,
ListProjectsInputSchema,
GetProjectInputSchema,
DeleteProjectInputSchema,
type SupabaseResponse,
type Project,
type Organization,
ListOrganizationsInputSchema,
GetOrganizationInputSchema,
CreateOrganizationInputSchema,
UpdateOrganizationInputSchema,
ProjectApiKey,
GetProjectApiKeysInputSchema,
} from './schemas.js';
// Configuration
const SUPABASE_API_URL = 'https://api.supabase.com/v1';
class SupabaseAPI {
private apiKey: string;
constructor(apiKey: string) {
this.apiKey = apiKey;
}
private async makeRequest(endpoint: string, method: string = 'GET', body?: any): Promise<any> {
const response = await fetch(`${SUPABASE_API_URL}${endpoint}`, {
method,
headers: {
'Authorization': `Bearer ${this.apiKey}`,
'Content-Type': 'application/json',
},
body: body ? JSON.stringify(body) : undefined,
});
if (!response.ok) {
throw new Error(`Supabase API error: ${response.statusText}`);
}
return response.json();
}
async listProjects(ref?: string): Promise<Project[]> {
return this.makeRequest('/projects' + (ref ? `?ref=${ref}` : ''));
}
async getProject(ref: string): Promise<Project> {
return this.makeRequest(`/projects/${ref}`);
}
async createProject(data: any): Promise<Project> {
return this.makeRequest('/projects', 'POST', data);
}
async deleteProject(ref: string): Promise<void> {
return this.makeRequest(`/projects/${ref}`, 'DELETE');
}
async listOrganizations(): Promise<Organization[]> {
return this.makeRequest('/organizations');
}
async getOrganization(slug: string): Promise<Organization> {
return this.makeRequest(`/organizations/${slug}`);
}
async createOrganization(data: any): Promise<Organization> {
return this.makeRequest('/organizations', 'POST', data);
}
async getProjectApiKeys(ref: string): Promise<ProjectApiKey[]> {
return this.makeRequest(`/projects/${ref}/api-keys`);
}
}
// Initialize server and API client
const apiKey = process.env.SUPABASE_API_KEY;
if (!apiKey) {
throw new Error('SUPABASE_API_KEY environment variable is required');
}
const supabase = new SupabaseAPI(apiKey);
const server = new Server({
name: "supabase-mcp",
version: "1.0.0",
}, {
capabilities: {
tools: {}
}
});
// List available tools
server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: [
{
name: "list_projects",
description: "List all Supabase projects",
inputSchema: zodToJsonSchema(ListProjectsInputSchema)
},
{
name: "get_project",
description: "Get details of a specific Supabase project",
inputSchema: zodToJsonSchema(GetProjectInputSchema)
},
{
name: "create_project",
description: "Create a new Supabase project",
inputSchema: zodToJsonSchema(CreateProjectInputSchema)
},
{
name: "delete_project",
description: "Delete a Supabase project",
inputSchema: zodToJsonSchema(DeleteProjectInputSchema)
},
{
name: "list_organizations",
description: "List all organizations",
inputSchema: zodToJsonSchema(ListOrganizationsInputSchema)
},
{
name: "get_organization",
description: "Get details of a specific organization",
inputSchema: zodToJsonSchema(GetOrganizationInputSchema)
},
{
name: "create_organization",
description: "Create a new organization",
inputSchema: zodToJsonSchema(CreateOrganizationInputSchema)
},
{
name: "get_project_api_keys",
description: "Get API keys for a specific Supabase project",
inputSchema: zodToJsonSchema(GetProjectApiKeysInputSchema)
}
]
};
});
// Handle tool calls
server.setRequestHandler(CallToolRequestSchema, async (request) => {
try {
if (!request.params.arguments) {
throw new Error("Arguments are required");
}
switch (request.params.name) {
case "list_projects": {
const args = ListProjectsInputSchema.parse(request.params.arguments);
const result = await supabase.listProjects(args.ref);
return { toolResult: result };
}
case "get_project": {
const args = GetProjectInputSchema.parse(request.params.arguments);
const result = await supabase.getProject(args.ref);
return { toolResult: result };
}
case "create_project": {
const args = CreateProjectInputSchema.parse(request.params.arguments);
const result = await supabase.createProject(args);
return { toolResult: result };
}
case "delete_project": {
const args = DeleteProjectInputSchema.parse(request.params.arguments);
await supabase.deleteProject(args.ref);
return { toolResult: { success: true } };
}
case "list_organizations": {
const result = await supabase.listOrganizations();
return { toolResult: result };
}
case "get_organization": {
const args = GetOrganizationInputSchema.parse(request.params.arguments);
const result = await supabase.getOrganization(args.slug);
return { toolResult: result };
}
case "create_organization": {
const args = CreateOrganizationInputSchema.parse(request.params.arguments);
const result = await supabase.createOrganization(args);
return { toolResult: result };
}
case "get_project_api_keys": {
const args = GetProjectApiKeysInputSchema.parse(request.params.arguments);
const result = await supabase.getProjectApiKeys(args.ref);
if (args.name) {
const filtered = result.filter(key => key.name === args.name);
return { toolResult: filtered };
}
return { toolResult: result };
}
default:
throw new Error(`Unknown tool: ${request.params.name}`);
}
} catch (error) {
if (error instanceof z.ZodError) {
throw new Error(`Invalid arguments: ${error.message}`);
}
throw error;
}
});
// Start the server
async function runServer() {
const transport = new StdioServerTransport();
await server.connect(transport);
console.error("Supabase MCP Server running on stdio");
}
runServer().catch((error) => {
console.error("Fatal error in main():", error);
process.exit(1);
});
```