> ## Documentation Index
> Fetch the complete documentation index at: https://fentaris.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# StdioTransport

> Reference for connecting to local MCP servers over stdio.

> Connect to local MCP servers over stdio

Use `stdio(...)` for new applications. It creates a `StdioTransport` that launches a local MCP server process and communicates over stdio.

## Quick Start

```ts theme={null} theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { mcp, stdio } from "@fentaris/core";

const filesystem = mcp("filesystem", {
  transport: stdio({
    command: "npx",
    args: ["-y", "@modelcontextprotocol/server-filesystem", "./demo-files"],
  }),
});
```

## Options

### `command`

Executable to spawn.

```ts theme={null} theme={"theme":{"light":"github-light","dark":"github-dark"}}
command: "npx"
```

### `args`

Argument list passed to the spawned process.

```ts theme={null} theme={"theme":{"light":"github-light","dark":"github-dark"}}
args: ["-y", "@modelcontextprotocol/server-filesystem", "./demo-files"]
```

### `env`

Extra environment variables for the upstream process.

### `stderr`

How to handle stderr from the spawned process.

Allowed values:

* `inherit`
* `pipe`
* `overlapped`
* `ignore`

### `clientName`

MCP client name.

**Default:** `fentaris-core`

### `clientVersion`

MCP client version.

**Default:** `0.1.0`

## Methods

### `listTools(params?)`

Lists tools exposed by the MCP server.

### `callTool(params)`

Calls a tool on the MCP server.

### `close()`

Closes the underlying client connection.

## Low-Level Constructor

The class constructor is available for advanced integrations:

```ts theme={null} theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { StdioTransport } from "@fentaris/core";

const transport = new StdioTransport({
  command: "npx",
  args: ["-y", "@modelcontextprotocol/server-filesystem", "./demo-files"],
});
```

For normal applications, prefer `stdio(options)`.

## Related Documentation

* [McpServer reference](/reference/mcp-server)
* [Servers and transports](/concepts/servers-and-transports)
* [Setup](/getting-started/setup)
