# Network accessible (0.0.0.0)
genaiscript mcp --http --network --port 8080
```

When using HTTP transport, the server will be available at `http://host:port/mcp`. For example:

* `http://localhost:8003/mcp` (default)
* `http://0.0.0.0:8080/mcp` (network accessible on port 8080)

The HTTP transport uses the [Streamable HTTP transport](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http) from the MCP specification.

## IDE configuration

[Section titled “IDE configuration”](#ide-configuration)

The `mcp` command launches the MCP server using the stdio transport.

* [@modelcontextprotocol/inspector](https://www.npmjs.com/package/@modelcontextprotocol/inspector) is a MCP client that can be used to inspect the server and list the available tools.

```sh
npx --yes @modelcontextprotocol/inspector npx --yes genaiscript mcp
```

### Visual Studio Code Insiders with GitHub Copilot Chat

[Section titled “Visual Studio Code Insiders with GitHub Copilot Chat”](#visual-studio-code-insiders-with-github-copilot-chat)

You will need Visual Studio Code v1.99 or higher and the [GitHub Copilot Chat](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat) extension installed.

.vscode/mcp.json

```json
{
  "servers": {
    "genaiscript": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "genaiscript",
        "mcp",
        "--cwd",
        "${workspaceFolder}"
      ],
      "envFile": "${workspaceFolder}/.env"
    }
  }
}
```

### Claude Desktop

[Section titled “Claude Desktop”](#claude-desktop)

```json
{
  "mcpServers": {
    "genaiscript": {
      "command": "npx",
      "args": ["-y", "genaiscript", "mcp"]
    }
  }
}
```

### Filtering scripts

[Section titled “Filtering scripts”](#filtering-scripts)

If you need to filter out which scripts are exposed as MCP tools, you can use the `--groups` flag and set the `mcp` group in your scripts.

```js
script({
  group: "mcp",
});
```

.vscode/mcp.json

```json
{
  "servers": {
    "genaiscript": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "genaiscript",
        "mcp",
        "--cwd",
        "${workspaceFolder}",
        "--groups",
        "mcp"
      ],
      "envFile": "${workspaceFolder}/.env"
    }
  }
}
```

## Running scripts from a remote repository

[Section titled “Running scripts from a remote repository”](#running-scripts-from-a-remote-repository)

You can use the `--remote` option to load scripts from a remote repository. GenAIScript will do a shallow clone of the repository and run the script from the clone folder.

```sh
npx --yes genaiscript mcp --remote https://github.com/...
```

There are additional flags to how the repository is cloned:

* `--remote-branch <branch>`: The branch to clone from the remote repository.
* `--remote-force`: Force the clone even if the cloned folder already exists.
* `--remote-install`: Install dependencies after cloning the repository.

Caution

As usual, be careful when running scripts from a remote repository. Make sure you trust the source before running the script and consider locking to a specific commit.