
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@yepcode/mcp-client-connector
Advanced tools
A flexible client connector for Model Context Protocol servers with support for multiple transport methods
A flexible client connector for Model Context Protocol (MCP) servers with support for multiple transport methods.
npm install @yepcode/mcp-client-connector
import { MCPClientConnector } from 'mcp-client-connector';
// Connect to a remote MCP server via HTTP/SSE
const connector = new MCPClientConnector({
remoteUrl: 'https://your-mcp-server.com/endpoint'
});
// Connect to a remote MCP server via WebSocket
const wsConnector = new MCPClientConnector({
remoteUrl: 'wss://your-mcp-server.com/socket'
});
try {
const client = await connector.connect();
// Use the MCP client
const result = await client.invoke('some_tool', {
param1: 'value1',
param2: 'value2'
});
console.log(result);
// Close the connection when done
await connector.close();
} catch (error) {
console.error('Error connecting to MCP server:', error);
}
import { MCPClientConnector } from 'mcp-client-connector';
// Connect to a local JavaScript MCP server
const connector = new MCPClientConnector({
language: 'javascript',
package: 'your-mcp-server-package',
version: '1.0.0', // optional, will use latest if not specified
commandArgs: '--some-flag', // optional
envVars: { API_KEY: 'your-api-key' } // optional
});
try {
const client = await connector.connect();
// Use the MCP client
const result = await client.invoke('some_tool', {
param1: 'value1',
param2: 'value2'
});
console.log(result);
// Close the connection when done
await connector.close();
} catch (error) {
console.error('Error connecting to MCP server:', error);
// Access stderr logs if available
if (error instanceof MCPError) {
console.error('Stderr logs:', error.stderrLogs);
}
}
import { MCPClientConnector, Logger } from 'mcp-client-connector';
// Implement your own logger
class MyCustomLogger implements Logger {
info(message: string, ...args: any[]): void {
// Custom info logging implementation
myLoggingService.log('INFO', message, ...args);
}
error(message: string, ...args: any[]): void {
// Custom error logging implementation
myLoggingService.log('ERROR', message, ...args);
}
}
// Use your custom logger
const connector = new MCPClientConnector({
remoteUrl: 'https://your-mcp-server.com/endpoint',
logger: new MyCustomLogger()
});
// The rest of your code...
MCPClientConnector
The main class for connecting to MCP servers.
constructor(options: MCPClientConnectorOptions)
RemoteMCPClientConnectorOptions
remoteUrl: string
- The URL of the remote MCP serverlogger?: Logger
- Optional custom logger implementationStdioMCPClientConnectorOptions
language: string
- The language of the MCP server package ('javascript' or 'python')package: string
- The name of the MCP server packageversion?: string
- Optional specific version of the packagecommandArgs?: string
- Optional command line argumentsenvVars?: EnvVars | string
- Optional environment variableslogger?: Logger
- Optional custom logger implementationconnect(): Promise<Client>
- Connect to the MCP serverclose(): Promise<void>
- Close the connectiongetStderrLogs(): string[]
- Get any stderr logs from the MCP server (stdio only)Logger
Interfaceinterface Logger {
info(message: string, ...args: any[]): void;
error(message: string, ...args: any[]): void;
}
MIT
FAQs
A flexible client connector for Model Context Protocol servers with support for multiple transport methods
The npm package @yepcode/mcp-client-connector receives a total of 0 weekly downloads. As such, @yepcode/mcp-client-connector popularity was classified as not popular.
We found that @yepcode/mcp-client-connector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.