mcp-z-client
@mcp-z/client
@mcp-z/client manages MCP server configuration, process startup, connections, discovery, calls, and cleanup. Use the package's wrappers for ordinary tool, prompt, and resource calls. Reach for the raw MCP SDK responses only when the wrapper omits data the caller needs.
Install
npm install @mcp-z/client
Read the consuming project's existing MCP configuration before inventing one. A standard .mcp.json stores entries under mcpServers.
Use the client
HTTP entries include type: 'http'. Stdio entries use command and optional args and env.
registry.close() closes every managed client and spawned process. Keep it in finally, or use await using registry = createServerRegistry(config) when the consuming runtime and project conventions support explicit resource management.
Tool names and schemas belong to the connected server, not this skill. Call client.listTools() before composing an unfamiliar invocation and use the returned input schema. Discovery is read-only. A tool call may change external state, so the call must stay within the user's requested action.