使用说明
@eliware/mcp-client
Pure ESM MCP client for SDK v2, Streamable HTTP, stdio, and bearer authentication.
Table of Contents
- Features
- Requirements
- Setup
- Usage
- Development
- Testing
- Troubleshooting
- Security
- API
- Packaging
- Examples
- Support
- Links
- License
Features
Connect to MCP servers through Streamable HTTP or stdio. Use bearer tokens, custom HTTP headers, token providers, and structured logs.
Requirements
Use Node.js 26 or later.
Setup
Install the package with npm install @eliware/mcp-client.
Usage
import { mcpClient } from "@eliware/mcp-client";
const client = await mcpClient({ url: "https://mcp.example.com/mcp" });
try {
console.log(await client.listTools());
} finally {
await client.close();
}
Read the documentation index, specifications, and release notes.
Development
Run npm ci to install locked dependencies. Read repository specifications for contributor requirements.
Testing
Run npm test for aggregate validation.
Troubleshooting
Read the troubleshooting guide for connection help.
Security
Keep access tokens, credentials, and private server data out of source files and logs.
API
Import mcpClient from @eliware/mcp-client. Read the API guide for options and return types.
Packaging
The package includes src/, docs/, README.md, AGENTS.md, LICENSE, RELEASE_NOTES.md, examples/, specs/, and .env.example.
Use numeric MAJOR.MINOR.PATCH versions and a v<version> tag for each release.
Run npm run pack to check package contents. Publish only after approved release steps.
Examples
Read the examples index for commands, results, permissions, and cleanup.
Support
For help, questions, or to chat with the author and community, visit:
