Skip to content

Documentation for using FastMCP as an MCP Client #2003

Closed

Description

@strawgate

Enhancement

We should advertise FastMCP Client as a great way to add MCP tools to your existing code, chat application or AI agent framework.

We should include examples use cases in the docs for this

Activity

  1. added
    enhancement
    on Oct 4, 2025
  2. added
    documentation
    client
    and removed
    enhancement
    on Oct 4, 2025
  3. added
    triage-martian
    on Oct 4, 2025
  4. marvin-context-protocol commented on Oct 4, 2025

    @marvin-context-protocol
    Contributor

    Claude finished @strawgate's task —— View job


    Investigation Complete

    Issue Type: Documentation Enhancement

    Recommendation

    Create a dedicated "Use Cases" documentation page highlighting FastMCP Client as a powerful way to integrate MCP tools into existing applications. The existing client documentation is technically comprehensive but doesn't effectively advertise the client's value proposition or provide compelling use case examples.

    The documentation should emphasize three primary integration patterns:

    1. AI SDK Integration - Adding MCP tools to AI applications (Anthropic, OpenAI, Gemini)
    2. Testing & Development - Using the client to test MCP servers during development
    3. Agent Framework Integration - Building custom AI agents that leverage MCP tools

    Findings

    Current State

    Existing Client Documentation (docs/clients/):

    • ✅ Comprehensive technical coverage of Client API
    • ✅ Good examples of transports, auth, and operations
    • ✅ Covers multi-server configuration
    • ❌ Missing: Value proposition / "why use this" framing
    • ❌ Missing: Real-world integration examples
    • ❌ Missing: Use case-driven examples

    Existing Integration Examples:

    • AI SDKs: Anthropic (docs/integrations/anthropic.mdx), OpenAI (docs/integrations/openai.mdx), Gemini (docs/integrations/gemini.mdx)
      • These show how to connect FastMCP servers TO the AI SDKs
      • ❌ Missing reverse: Using FastMCP Client to ADD tools to AI applications
    • Testing Pattern: Well-documented in AGENTS.md and test files
      • Shows in-memory transport pattern
      • ✅ Good foundation but buried in developer docs

    Gap Analysis:

    1. The client is positioned as a "programmatic interface" but not as a solution for common problems
    2. Integration examples show "MCP server → AI SDK" but not "FastMCP Client → your code"
    3. No dedicated page for "adding MCP to your existing application"
    4. Use cases are scattered across different docs rather than centralized
    Related Items Context

    Issue #1839 - "MCP Client from multiple in memory servers"

    • Shows user confusion about client capabilities
    • Demonstrates need for clearer multi-server examples
    • Resolved with proxy pattern explanation

    Issue #1878 - "Add more Transformation Examples"

    • Shows related need for client usage patterns
    • Focused on tool transformation (exposing client methods as tools)
    • Complementary to this request (that's about consuming tools, this is about providing them)

    PR #2002 - "Additional Tool Transformation Examples"

    • Recently added examples for client wrapping patterns
    • Shows pattern of improving practical examples

    Detailed Action Plan

    1. Create New Documentation Page: docs/clients/use-cases.mdx

    Structure:

    ---
    title: FastMCP Client Use Cases
    description: Real-world examples of integrating MCP tools into your applications
    ---
    
    ## Why Use FastMCP Client?
    
    FastMCP Client provides a programmatic way to add MCP tools to any Python application...
    
    ## Use Case 1: Integrating with AI SDKs
    
    ### Anthropic SDK
    [Example: Adding weather tools to Claude API calls]
    
    ### OpenAI SDK  
    [Example: Adding database tools to GPT applications]
    
    ### LangChain
    [Example: Creating LangChain tools from MCP servers]
    
    ## Use Case 2: Building Custom AI Agents
    
    [Example: Agent that uses multiple MCP servers]
    [Example: Agentic loop with tool selection]
    
    ## Use Case 3: Testing MCP Servers
    
    [Example: In-memory testing pattern]
    [Example: Integration test setup]
    
    ## Use Case 4: Chat Applications
    
    [Example: Adding tools to custom chat interface]
    [Example: Multi-turn conversations with tool use]

    2. Update docs/clients/client.mdx

    Add section near the top (after "Creating a Client"):

    ## Why Use the FastMCP Client?
    
    The FastMCP Client is ideal for:
    
    - **🤖 AI Integration**: Add MCP tools to applications built with Anthropic, OpenAI, or other AI SDKs
    - **🧪 Testing**: Test your MCP servers during development with in-memory connections
    - **🤝 Agent Frameworks**: Build custom AI agents that leverage multiple MCP servers
    - **💬 Chat Apps**: Enhance chat applications with dynamically loaded tools
    
    For detailed examples of each use case, see [Use Cases](/clients/use-cases).

    3. Create Example Code Files

    examples/client_integrations/anthropic_client.py:

    """Example: Using FastMCP Client to add tools to Anthropic SDK."""

    examples/client_integrations/openai_client.py:

    """Example: Using FastMCP Client to add tools to OpenAI SDK."""

    examples/client_integrations/custom_agent.py:

    """Example: Building a custom agent with FastMCP Client."""

    4. Update Navigation

    In docs/docs.json, add to Clients section:

    {
      "group": "Essentials",
      "icon": "cube",
      "pages": [
        "clients/client",
        "clients/use-cases",  // NEW
        "clients/transports"
      ]
    }

    5. Update README.md

    Add to "MCP Clients" section (line ~240):

    The FastMCP Client is not just for testing - it's a powerful way to integrate MCP tools into any Python application, including:
    - AI applications built with Anthropic, OpenAI, or Gemini SDKs
    - Custom AI agent frameworks
    - Chat applications requiring dynamic tool loading

    Related Files

    Documentation Files to Create/Modify
    File Action Purpose
    docs/clients/use-cases.mdx CREATE New dedicated use cases page
    docs/clients/client.mdx MODIFY Add "Why Use" section with value prop
    examples/client_integrations/anthropic_client.py CREATE Example: MCP tools + Anthropic SDK
    examples/client_integrations/openai_client.py CREATE Example: MCP tools + OpenAI SDK
    examples/client_integrations/custom_agent.py CREATE Example: Custom agent with multiple servers
    docs/docs.json MODIFY Add use-cases to navigation
    README.md MODIFY Enhance MCP Clients section
    Key Reference Files
    File Relevance Key Sections
    docs/clients/client.mdx Current client overview Lines 1-291: Complete client documentation
    docs/integrations/anthropic.mdx Shows server→SDK pattern Lines 1-229: Could be adapted for reverse (Client→SDK)
    docs/integrations/gemini.mdx Shows direct client usage Lines 58-82: Good example of Client + AI SDK
    README.md Main project overview Lines 240-299: MCP Clients section

  5. marvin-context-protocol commented on Feb 9, 2026

    @marvin-context-protocol
    Contributor

    When documenting FastMCP Client usage examples, we should include skills as a use case.

    Skills client utilities are already documented in the Skills Provider page, but they should also be mentioned/linked from the general client documentation to improve discoverability.

    Related: #3120 (closed as duplicate)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clientdocumentationtriage-martian

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions