MCP ExplorerExplorer

Mcp Client Python

@fist-maestroon 10 months ago
1 MIT
FreeCommunity
AI Systems
Python implementation of the Model Context Protocol (MCP) client

Overview

What is Mcp Client Python

mcp-client-python is a Python implementation of the Model Context Protocol (MCP) client, designed to facilitate interactions with various large language model (LLM) providers.

Use cases

Use cases for mcp-client-python include developing intelligent chatbots, integrating LLM capabilities into applications, and conducting research in AI and machine learning.

How to use

To use mcp-client-python, install the required dependencies with ‘pip install -r requirements.txt’. Then, initialize the MCPClient with your desired LLM provider, load MCP servers from a configuration file, and start a chat loop for interaction.

Key features

Key features include support for multiple LLM providers (such as Anthropic and DeepSeek), dynamic tool loading from MCP servers, configurable server connections, and a chat interface that allows for tool execution.

Where to use

mcp-client-python can be used in fields such as natural language processing, AI development, and chatbot creation, where interaction with LLMs is required.

Content

MCP Client Python

Python implementation of the Model Context Protocol (MCP) client.

Features

  • Support for multiple LLM providers (Anthropic, DeepSeek)
  • Dynamic tool loading from MCP servers
  • Configurable server connections
  • Chat interface with tool execution capabilities

Installation

pip install -r requirements.txt

Usage

from mcp_client import MCPClient

# Initialize client with desired LLM provider
client = MCPClient(llm_provider="anthropic")

# Load MCP servers from config
await client.load_mcp_servers("config/servers.json")

# Start chat loop
await client.chat_loop()

Configuration

Create a .env file with your API keys:

ANTHROPIC_API_KEY=your_anthropic_key
DEEPSEEK_API_KEY=your_deepseek_key

License

MIT

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers