1.1.9 ⢠Published 4 months ago
@agent-infra/mcp-client v1.1.9
@agent-infra/mcp-client
⨠A unified MCP Client implemented in TypeScript, supporting four major transports out of the box: In-memory, Stdio, SSE (Server-Sent Events), and Streamable HTTP.
š Features
- š¦ Written in TypeScript: Type-safe, modern, and easy to integrate.
- š Multi-Transport Support: Out-of-the-box support for four major transports:
- š§ In-memory: For fast, local tool integration.
- š„ļø Stdio: Communicate with tools via standard input/output, perfect for process-based tools.
- š SSE (Server-Sent Events): Real-time, event-driven communication over HTTP.
- š Streamable HTTP: Efficient, stream-based HTTP communication for scalable remote tools.
- š ļø Unified API: Interact with all transports using a single, consistent interface.
- š§© Highly Extensible: Easily add custom transports or tools as needed.
ā” Quick Start
import { MCPClient } from '@agent-infra/mcp-client';
// type: module project usage
import { createServer as createFileSystemServer } from '@agent-infra/mcp-server-filesystem';
// commonjs project usage
// const { createServer as createFileSystemServer } = await import('@agent-infra/mcp-server-filesystem')
const mcpClient = new MCPClient([
// In-memory
{
type: 'builtin',
name: 'FileSystem',
description: 'filesystem tool',
mcpServer: createFileSystemServer({
allowedDirectories: [omegaDir],
}),
},
// stdio
{
type: 'stdio',
name: 'FileSystem-Stdio',
description: 'filesystem tool',
command: 'npx',
args: [
'-y',
'@agent-infra/mcp-server-filesystem'
]
},
// sse
{
type: 'sse',
name: 'FileSystem-sse',
description: 'filesystem tool',
url: 'http://localhost:8889/sse'
},
// streamable-http
{
type: 'sse',
name: 'FileSystem-http',
description: 'filesystem tool',
url: 'http://localhost:8889/mcp'
}
]);
await mcpClient.listTools();
const result = await mcpClient.callTool({
client: 'FileSystem-sse',
name: 'list_directory',
arguments: {
path: '~/your_computer'
},
});
š Credits
Thanks to:
- kangfenmao for creating a great AI chatbot product Cherry Studio from which we draw a lot of inspiration for browser detection functionality.
- The @modelcontextprotocol/sdk project which helps us develop and use the agent tools better.
1.1.9
4 months ago
1.1.8
4 months ago
1.1.7
5 months ago
1.1.6
5 months ago
1.1.6-beta.10
5 months ago
1.1.6-beta.9
5 months ago
1.1.6-beta.8
5 months ago
1.1.6-beta.7
5 months ago
1.1.6-beta.6
5 months ago
1.1.6-beta.5
5 months ago
1.1.6-beta.4
5 months ago
1.1.6-beta.3
5 months ago
1.1.6-beta.0
5 months ago
1.1.6-beta.2
5 months ago
1.1.6-beta.1
5 months ago
1.1.5
5 months ago
1.1.4
5 months ago
1.1.3
5 months ago
1.1.2
5 months ago
1.1.1
5 months ago
1.1.1-beta.3
5 months ago
1.1.1-beta.2
5 months ago
1.1.1-beta.1
5 months ago
1.1.1-beta.0
5 months ago
1.1.0
5 months ago
1.0.1-beta.15
5 months ago
1.0.1-beta.14
5 months ago
1.0.1-beta.13
5 months ago
1.0.1-beta.12
5 months ago
1.0.1-beta.11
5 months ago
1.0.1-beta.10
5 months ago
1.0.1-beta.9
5 months ago
1.0.1-beta.8
5 months ago
1.0.1-beta.7
5 months ago
0.5.1
6 months ago
0.5.0
6 months ago
0.4.3
6 months ago
0.4.2
7 months ago