#
tokens: 16492/50000 6/6 files
lines: on (toggle) GitHub
raw markdown copy reset
# Directory Structure

```
├── dist
│   └── src
│       ├── index.js
│       ├── simulator-service.js
│       └── types.js
├── 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
├── src
│   ├── index.ts
│   ├── simulator-service.ts
│   └── types.ts
└── tsconfig.json
```

# Files

--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------

```markdown
 1 | # iOS Simulator MCP Server
 2 | 
 3 | A Model Context Protocol (MCP) server that provides programmatic control over iOS simulators. This server implements the MCP specification to expose simulator functionality through a standardized interface.
 4 | 
 5 | ## Features
 6 | 
 7 | - List available iOS simulators
 8 | - Boot and shutdown simulators
 9 | - Install .app bundles on simulators
10 | - Launch installed apps by bundle ID
11 | 
12 | ## Installation
13 | Add the following to your Claude Config JSON file
14 | ```
15 | {
16 |   "mcpServers": {
17 |     "simulator": {
18 |       "command": "npx",
19 |       "args": [
20 |         "y",
21 |         "@joshuarileydev/simulator-mcp-server"
22 |       ]
23 |     }
24 |   }
25 | }
26 | ```
```

--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------

```json
 1 | {
 2 |     "compilerOptions": {
 3 |         "target": "ES2022",
 4 |         "module": "Node16",
 5 |         "moduleResolution": "Node16",
 6 |         "strict": true,
 7 |         "esModuleInterop": true,
 8 |         "skipLibCheck": true,
 9 |         "forceConsistentCasingInFileNames": true,
10 |         "resolveJsonModule": true,
11 |         "outDir": "./dist",
12 |         "rootDir": "."
13 |     },
14 |     "exclude": [
15 |         "node_modules"
16 |     ],
17 |     "include": [
18 |         "./**/*.ts"
19 |     ]
20 | }
```

--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------

```json
 1 | {
 2 |     "name": "@joshuarileydev/simulator-mcp-server",
 3 |     "version": "0.0.1",
 4 |     "description": "An MCP server for controlling iOS simulators",
 5 |     "license": "MIT",
 6 |     "type": "module",
 7 |     "private": false,
 8 |     "bin": {
 9 |         "simulator-server": "dist/index.js"
10 |     },
11 |     "files": [
12 |         "dist"
13 |     ],
14 |     "scripts": {
15 |         "build": "tsc && shx chmod +x dist/src/*.js",
16 |         "prepare": "npm run build",
17 |         "watch": "tsc --watch"
18 |     },
19 |     "dependencies": {
20 |         "@modelcontextprotocol/sdk": "0.6.0",
21 |         "@types/node-fetch": "^2.6.12",
22 |         "node-fetch": "^3.3.2",
23 |         "zod": "^3.22.4",
24 |         "zod-to-json-schema": "^3.23.5"
25 |     },
26 |     "devDependencies": {
27 |         "shx": "^0.3.4",
28 |         "typescript": "^5.6.2"
29 |     }
30 | }
```

--------------------------------------------------------------------------------
/src/types.ts:
--------------------------------------------------------------------------------

```typescript
 1 | export interface SimulatorDevice {
 2 |   udid: string;
 3 |   name: string;
 4 |   state: string;
 5 |   runtime: string;
 6 | }
 7 | 
 8 | export interface AppLaunchOptions {
 9 |   deviceId: string;
10 |   bundleId: string;
11 | }
12 | 
13 | export interface AppInstallOptions {
14 |   deviceId: string;
15 |   appPath: string;
16 | }
17 | 
18 | export interface SimulatorBootOptions {
19 |   deviceId: string;
20 | }
21 | 
22 | // Type guards
23 | export function isAppLaunchOptions(args: any): args is AppLaunchOptions {
24 |   return (
25 |     typeof args === 'object' &&
26 |     args !== null &&
27 |     typeof args.deviceId === 'string' &&
28 |     typeof args.bundleId === 'string'
29 |   );
30 | }
31 | 
32 | export function isAppInstallOptions(args: any): args is AppInstallOptions {
33 |   return (
34 |     typeof args === 'object' &&
35 |     args !== null &&
36 |     typeof args.deviceId === 'string' &&
37 |     typeof args.appPath === 'string'
38 |   );
39 | }
40 | 
41 | export function isSimulatorBootOptions(args: any): args is SimulatorBootOptions {
42 |   return (
43 |     typeof args === 'object' &&
44 |     args !== null &&
45 |     typeof args.deviceId === 'string'
46 |   );
47 | } 
```

--------------------------------------------------------------------------------
/src/simulator-service.ts:
--------------------------------------------------------------------------------

```typescript
 1 | import { exec } from 'child_process';
 2 | import { promisify } from 'util';
 3 | import { SimulatorDevice } from './types.js';
 4 | 
 5 | const execAsync = promisify(exec);
 6 | 
 7 | export class SimulatorService {
 8 |   async listDevices(): Promise<SimulatorDevice[]> {
 9 |     const { stdout } = await execAsync('xcrun simctl list devices --json');
10 |     const result = JSON.parse(stdout) as { devices: Record<string, any[]> };
11 |     
12 |     const devices: SimulatorDevice[] = [];
13 |     Object.entries(result.devices).forEach(([runtime, deviceList]) => {
14 |       deviceList.forEach(device => {
15 |         devices.push({
16 |           udid: device.udid,
17 |           name: device.name,
18 |           state: device.state,
19 |           runtime: runtime.replace('com.apple.CoreSimulator.SimRuntime.', '')
20 |         });
21 |       });
22 |     });
23 |     
24 |     return devices;
25 |   }
26 | 
27 |   async bootDevice(deviceId: string): Promise<void> {
28 |     await execAsync(`xcrun simctl boot ${deviceId}`);
29 |   }
30 | 
31 |   async shutdownDevice(deviceId: string): Promise<void> {
32 |     await execAsync(`xcrun simctl shutdown ${deviceId}`);
33 |   }
34 | 
35 |   async installApp(deviceId: string, appPath: string): Promise<void> {
36 |     await execAsync(`xcrun simctl install ${deviceId} "${appPath}"`);
37 |   }
38 | 
39 |   async launchApp(deviceId: string, bundleId: string): Promise<void> {
40 |     await execAsync(`xcrun simctl launch ${deviceId} ${bundleId}`);
41 |   }
42 | } 
```

--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------

```typescript
  1 | #!/usr/bin/env node
  2 | import { Server } from "@modelcontextprotocol/sdk/server/index.js";
  3 | import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
  4 | import {
  5 |   CallToolRequestSchema,
  6 |   ListToolsRequestSchema,
  7 | } from "@modelcontextprotocol/sdk/types.js";
  8 | import { z } from 'zod';
  9 | import { zodToJsonSchema } from 'zod-to-json-schema';
 10 | import { SimulatorService } from './simulator-service.js';
 11 | 
 12 | // Input schemas
 13 | const ListSimulatorsSchema = z.object({});
 14 | 
 15 | const BootSimulatorSchema = z.object({
 16 |   deviceId: z.string().describe("The UDID of the simulator to boot")
 17 | });
 18 | 
 19 | const ShutdownSimulatorSchema = z.object({
 20 |   deviceId: z.string().describe("The UDID of the simulator to shutdown")
 21 | });
 22 | 
 23 | const InstallAppSchema = z.object({
 24 |   deviceId: z.string().describe("The UDID of the target simulator"),
 25 |   appPath: z.string().describe("Path to the .app bundle to install")
 26 | });
 27 | 
 28 | const LaunchAppSchema = z.object({
 29 |   deviceId: z.string().describe("The UDID of the target simulator"),
 30 |   bundleId: z.string().describe("Bundle identifier of the app to launch")
 31 | });
 32 | 
 33 | // Initialize simulator service
 34 | const simulatorService = new SimulatorService();
 35 | 
 36 | // Initialize server
 37 | const server = new Server({
 38 |   name: "ios-simulator-server",
 39 |   version: "1.0.0"
 40 | }, {
 41 |   capabilities: {
 42 |     tools: {}
 43 |   }
 44 | });
 45 | 
 46 | // List available tools
 47 | server.setRequestHandler(ListToolsRequestSchema, async () => {
 48 |   return {
 49 |     tools: [
 50 |       {
 51 |         name: "list_simulators",
 52 |         description: "List all available iOS simulators",
 53 |         inputSchema: zodToJsonSchema(ListSimulatorsSchema)
 54 |       },
 55 |       {
 56 |         name: "boot_simulator",
 57 |         description: "Boot an iOS simulator",
 58 |         inputSchema: zodToJsonSchema(BootSimulatorSchema)
 59 |       },
 60 |       {
 61 |         name: "shutdown_simulator",
 62 |         description: "Shutdown an iOS simulator",
 63 |         inputSchema: zodToJsonSchema(ShutdownSimulatorSchema)
 64 |       },
 65 |       {
 66 |         name: "install_app",
 67 |         description: "Install an app on a simulator",
 68 |         inputSchema: zodToJsonSchema(InstallAppSchema)
 69 |       },
 70 |       {
 71 |         name: "launch_app",
 72 |         description: "Launch an installed app on a simulator",
 73 |         inputSchema: zodToJsonSchema(LaunchAppSchema)
 74 |       }
 75 |     ]
 76 |   };
 77 | });
 78 | 
 79 | // Handle tool calls
 80 | server.setRequestHandler(CallToolRequestSchema, async (request) => {
 81 |   try {
 82 |     if (!request.params.arguments) {
 83 |       throw new Error("Arguments are required");
 84 |     }
 85 | 
 86 |     switch (request.params.name) {
 87 |       case "list_simulators": {
 88 |         const devices = await simulatorService.listDevices();
 89 |         return { toolResult: { devices } };
 90 |       }
 91 |       case "boot_simulator": {
 92 |         const args = BootSimulatorSchema.parse(request.params.arguments);
 93 |         await simulatorService.bootDevice(args.deviceId);
 94 |         return { toolResult: { success: true } };
 95 |       }
 96 |       case "shutdown_simulator": {
 97 |         const args = ShutdownSimulatorSchema.parse(request.params.arguments);
 98 |         await simulatorService.shutdownDevice(args.deviceId);
 99 |         return { toolResult: { success: true } };
100 |       }
101 |       case "install_app": {
102 |         const args = InstallAppSchema.parse(request.params.arguments);
103 |         await simulatorService.installApp(args.deviceId, args.appPath);
104 |         return { toolResult: { success: true } };
105 |       }
106 |       case "launch_app": {
107 |         const args = LaunchAppSchema.parse(request.params.arguments);
108 |         await simulatorService.launchApp(args.deviceId, args.bundleId);
109 |         return { toolResult: { success: true } };
110 |       }
111 |       default:
112 |         throw new Error(`Unknown tool: ${request.params.name}`);
113 |     }
114 |   } catch (error) {
115 |     if (error instanceof z.ZodError) {
116 |       throw new Error(`Invalid arguments: ${error.message}`);
117 |     }
118 |     throw error;
119 |   }
120 | });
121 | 
122 | // Start the server
123 | async function runServer() {
124 |   const transport = new StdioServerTransport();
125 |   await server.connect(transport);
126 |   console.error("iOS Simulator MCP Server running on stdio");
127 | }
128 | 
129 | runServer().catch((error) => {
130 |   console.error("Fatal error in main():", error);
131 |   process.exit(1);
132 | });
```