Sponsored by Deepsite.site

MCP Connect Client CLI

Created By
Abiorh0019 months ago
MCP Connect is a versatile command-line interface (CLI) client designed to connect to various Model Context Protocol (MCP) servers using stdio transport. It provides seamless integration with OpenAI models and supports dynamic tool and resource management across multiple servers.
Content

MCP Connect Client CLI

MCP Connect is a versatile command-line interface (CLI) client designed to connect to various Model Context Protocol (MCP) servers using stdio transport. It provides seamless integration with OpenAI models and supports dynamic tool and resource management across multiple servers.

Features

  • Stdio Transport: Connects to MCP servers using efficient stdio transport.
  • OpenAI Integration: Leverages OpenAI models for advanced processing.
  • Multi-Server Support: Connects to multiple MCP servers simultaneously.
  • Dynamic Tool Discovery: Automatically discovers and lists available tools.
  • Resource Management: Accesses and manages resources across servers.

Architecture Overview

Client-Side Components

  • Command Parser: Interprets user commands and routes them to the appropriate handlers.
  • Tool Manager: Manages tool execution requests and interactions with servers.
  • Resource Manager: Handles resource access requests.
  • OpenAI Integration: Processes data using OpenAI models for enhanced capabilities.
  • Response Formatter: Formats responses for user-friendly output.

Server-Side Components

  • MCP Servers: Each server provides specific tools and resources, accessible via stdio transport.

Getting Started

Prerequisites

  • Python 3.12 or later
  • Virtual environment setup
  • OpenAI API Key

Installation

  1. Clone the Repository:

    git clone  https://github.com/Abiorh001/mcp_connect.git
    cd mcp_connect
    
  2. Set Up Virtual Environment:

    uv venv or python -m venv .venv
    source .venv/bin/activate
    
  3. Sync Dependencies with uv:

    uv sync
    
  4. Configure Environment Variables: Create a .env file in the root directory with the following content:

    OPENAI_API_KEY=your_openai_api_key
    
  5. Update the servers_config.json: Ensure your servers_config.json is correctly configured to define the MCP servers you wish to connect to and the LLM configuration. Here is an example configuration:

    {
        "LLM": {
            "model": "gpt-4o-mini",
            "temperature": 0.5,
            "max_tokens": 1000,
            "top_p": 0,
            "frequency_penalty": 0,
            "presence_penalty": 0
        },
        "mcpServers": {
            "server-name": {
                "command": "python",
                "args": ["mcp-server.py"],
                "env": {
                    "API_KEY": "value"
                }
            }
        }
    }
    

Running the Client

  1. Start the MCP Servers: Use uv to run your MCP servers. For example:

    uv run main.py
    
  2. Run the MCP Connect Client:

    python mcp_client.py
    

Usage

  • List Available Tools: /tools
  • List Available Resources: /resources
  • Read a Resource: /resource:<uri>
  • Toggle Debug Mode: /debug
  • Refresh Capabilities: /refresh
  • Exit the Application: quit

Contributing

We welcome contributions! Please fork the repository and submit a pull request with your changes.

License

This project is licensed under the MIT License.

Contact

For questions or support, please contact [abioladedayo1993@gmail.com] or open an issue on GitHub.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
CursorThe AI Code Editor
Serper MCP ServerA Serper MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Tavily Mcp
Playwright McpPlaywright MCP server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Amap Maps高德地图官方 MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
WindsurfThe new purpose-built IDE to harness magic
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
ChatWiseThe second fastest AI chatbot™
DeepChatYour AI Partner on Desktop