Skip to main content
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.
stdio({
  command: "npx",
  args: ["-y", "@modelcontextprotocol/server-filesystem", "./demo-files"],
})

Streamable HTTP

Use streamable HTTP for remote MCP servers that expose an HTTP endpoint.
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:
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:
new HttpTransport({
  baseUrl: "https://api.example/mcp",
  envHeaderMap: {
    "x-tenant-id": "TENANT_ID",
  },
}).withEnv(process.env as Record<string, string>)