Skip to main content
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

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.
command: "npx"

args

Argument list passed to the spawned process.
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:
import { StdioTransport } from "@fentaris/core";

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