MCP ExplorerExplorer

Mcp Client Toolkit

@tileshqon a month ago
1 MIT
FreeCommunity
AI Systems
TypeScript client library and utilities for remote Model Context Protocol (MCP) servers

Overview

What is Mcp Client Toolkit

The mcp-client-toolkit is a TypeScript client library and utilities designed for interacting with remote Model Context Protocol (MCP) servers, facilitating communication and operations through a structured interface.

Use cases

Use cases include building web applications that need to authenticate users via OAuth, executing remote tools on MCP servers, and managing real-time notifications and updates from these servers.

How to use

To use the mcp-client-toolkit, you need to import the necessary classes, create an instance of MCPClient, and connect to the MCP server using the provided URL. You can also utilize CLI utilities for listing tools, showing tool details, and calling tools with specific parameters.

Key features

Key features include OAuth 2.0 authentication support, automatic transport fallback from HTTP to SSE, connection management, tool discovery and execution, real-time notifications, and reusable CLI command utilities.

Where to use

The mcp-client-toolkit can be used in various fields such as web development, cloud services, and any application that requires remote interaction with MCP servers for data processing and management.

Content

MCP Client Toolkit

TypeScript client library and utilities for remote Model Context Protocol (MCP) servers.

Basic Client

import { MCPClient, BrowserOAuthHandler } from 'mcp-client-toolkit';

const client = new MCPClient({
  callbackPort: 8090,
  oauthHandler: new BrowserOAuthHandler(8090)
});

await client.connect('http://localhost:3000/mcp');

CLI Utilities

import { 
  listTools, 
  showToolDetails, 
  callTool,
  parseToolCallCommand 
} from 'mcp-client-toolkit';

const mcpClient = client.getClient();
if (mcpClient) {
  await listTools(mcpClient);
  await showToolDetails(mcpClient, 'tool-name');
  await callTool(mcpClient, 'tool-name', { param: 'value' });
}

Exports

  • MCPClient: Main client class
  • BrowserOAuthHandler, CustomOAuthHandler: OAuth handlers
  • ConnectionManager: Connection management
  • listTools, showToolDetails, callTool: CLI utilities
  • formatJsonSchema, generateExampleArgs: Schema utilities
  • Types: MCPClientConfig, OAuthHandler, TransportType, etc.

Features

  • OAuth 2.0 authentication support
  • Automatic transport fallback (HTTP → SSE)
  • Connection management
  • Tool discovery and execution
  • Real-time notifications
  • Reusable CLI command utilities

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers