> ## 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.

# Servers and Transports

> Understand upstream MCP servers and the transports Fentaris can route through.

An upstream MCP server is any server behind the Fentaris proxy. A transport defines how Fentaris connects to that server.

## Common Transports

### Stdio

Use stdio for local MCP servers launched as child processes.

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

### Streamable HTTP

Use streamable HTTP for remote MCP servers that expose an HTTP endpoint.

```ts theme={null} theme={"theme":{"light":"github-light","dark":"github-dark"}}
streamableHttp({
  url: "https://example.com/mcp",
})
```

`streamableHttp(...)` is the stable high-level helper for remote MCP upstreams. Use the lower-level `HttpTransport` only when you need a custom HTTP adapter surface such as explicit environment-to-header mapping.

HTTP-family upstream transports block loopback, link-local, private, and metadata URLs by default. Allow internal endpoints only when they are part of your deployment boundary:

```ts theme={null} theme={"theme":{"light":"github-light","dark":"github-dark"}}
streamableHttp({
  url: "https://mcp.internal/mcp",
  network: {
    allowedPrivateHosts: ["mcp.internal"],
  },
})
```

For custom upstream headers, prefer transport auth options or explicit env mappings over forwarding whole environment objects:

```ts theme={null} theme={"theme":{"light":"github-light","dark":"github-dark"}}
new HttpTransport({
  baseUrl: "https://api.example/mcp",
  envHeaderMap: {
    "x-tenant-id": "TENANT_ID",
  },
}).withEnv(process.env as Record<string, string>)
```

## Related Documentation

* [Architecture](/concepts/architecture)
* [Proxy setup](/guides/proxy-setup)
* [Stdio transport](/reference/stdio-transport)
