mcp-client-patterns

Auto-detect transports, invoke tools, and manage task workflows for Turul MCP clients.

2|Updated Aug 17, 2025
One-click install
npx skills add https://github.com/aussierobots/turul-mcp-framework --skill mcp-client-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-client-patterns
Source: https://github.com/aussierobots/turul-mcp-framework/tree/main/plugins/turul-mcp-skills/skills/mcp-client-patterns
Command: npx skills add https://github.com/aussierobots/turul-mcp-framework --skill mcp-client-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pattern for Turul MCP clients that unifies connect, tool invocation, and task workflow across MCP versions. This guide explains how to auto-detect transports, manage sessions, call tools, and handle long-running tasks with the Turul MCP client.

Core Features & Use Cases

  • Auto-detect and select HttpTransport or SseTransport based on server capabilities and MCP version.
  • Unified client API: connect, list_tools, call_tool, call_tool_with_task, list_resources, read_resource, list_prompts, ping, and disconnect.
  • Task workflow support with TaskCreated and handling of long-running operations alongside robust error handling.

Quick Start

Create an MCP client with McpClientBuilder, connect, perform a tool call, and then disconnect.

Frequently Asked Questions about mcp-client-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect an MCP client and call tools across different server versions?

To connect an MCP client and call tools across versions, use a unified client API that auto-detects transports, manages the session lifecycle, and handles handshake negotiation for reliable tool invocation.

How does auto-detect transport selection work for MCP servers?

Auto-detect transport selection works by evaluating server capabilities and MCP version to automatically choose between HttpTransport or SseTransport, abstracting the connection layer and ensuring proper handshake negotiation.

What is the best way to manage long-running tasks during an MCP tool call?

The best way to manage long-running tasks during an MCP tool call is using a task workflow pattern that handles TaskCreated events and provides robust error handling alongside the standard tool invocation lifecycle.

Can I use a single client API for MCP session lifecycle and resource management?

Yes, you can use a single unified client API to manage the MCP session lifecycle, invoke tools, list resources, read resources, and handle connection drops via ping and disconnect operations.

Why does my MCP tool invocation fail when switching between HTTP and SSE transports?

MCP tool invocation fails when switching transports if the client lacks transport abstraction to auto-detect server capabilities, causing improper handshake negotiation or incomplete session lifecycle management.

Do I need specific dependencies to handle MCP task workflow and error handling?

No specific dependencies are required to handle MCP task workflow and error handling, as the client pattern relies on internal logic to manage TaskCreated events and connection robustness without external libraries.