Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use the MCP client in Node.js, browser, and React
@mcp-use/client
@mcp-use/client/react
import { MCPClient, loadConfigFile } from "@mcp-use/client"; // Inline config const client = new MCPClient({ mcpServers: { api: { url: "https://api.example.com/mcp" }, fs: { command: "npx", args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"], }, }, }); // Or from a JSON file const client2 = new MCPClient(loadConfigFile("./mcp-config.json")); const connections = await client.connectAll(); await connections.api.callTool("ping", {}); await client.close();
import { MCPClient } from "@mcp-use/client"; const client = new MCPClient({ mcpServers: { api: { url: "https://api.example.com/mcp" } }, }); const connection = await client.connect("api"); await connection.callTool("tool", {}); await client.close();
npm install @mcp-use/client react
mcp-use/react
Was this page helpful?