Skip to main content

A simple client library to connect to any MCP server and interact with or without LLMs.

Project description

 _   _       _ __  __  ____ ____ 
| | | | ___ (_)  \/  |/ ___|  _ \
| | | |/ _ \| | |\/| | |   | |_) |
| |_| | | | | | |  | | |___|  __/ 
 \___/|_| |_|_|_|  |_|\____|_|    
  Universal MCP Client

UniMCP

A simple, Python-native client library to connect to any Model Context Protocol (MCP) server. UniMCP allows you to interact with tools seamlessly via native Python code, an interactive CLI, or an autonomous LLM agent.

Features

  • Multiple Transports: Connect to remote servers via SSE (http://...) or local executables via Stdio (server.py, npx ...).
  • Dynamic Tool Generation: Automatically converts MCP tools into native Python async functions with IDE support.
  • Interactive CLI Playground: Test and chat with your tools straight from the terminal.
  • LLM Integration: Built-in, provider-agnostic LLM wrapper (OpenAI, Groq, Ollama, etc.) to hook your MCP server tools directly into an autonomous agent.
  • Session Management: Automatically persist and resume multi-turn conversations with context awareness.

Installation

pip install unimcp

🚀 Interactive CLI

The CLI provides a quick way to chat with your MCP server without writing any code.

Quick Start

Run the chat command from your terminal:

unimcp-chat

Configuration

The CLI uses environment variables from your .env file by default. To make it work, add these to your .env:

  • MCP_SERVER: The endpoint of your server (e.g., http://localhost:8000/sse or reference/server.py).
  • LLM_API_KEY: Your LLM provider API key.
  • LLM_BASE_URL: The API base URL (e.g., for NVIDIA NIM or Gemini).
  • LLM_MODEL_NAME: The specific model you wish to use.

CLI Options

You can override environment variables using flags:

  • --url <url>: Override the server endpoint.
  • --api-key <key>: Override the API key.
  • --base-url <url>: Override the LLM base URL.
  • --model <name>: Override the model name.
  • --system-prompt "text": Set a custom system instruction.

Example:

unimcp-chat --url http://localhost:8000/sse --model meta/llama-3.1-70b --api-key sk-123...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unimcp-0.9.0.tar.gz (43.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unimcp-0.9.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file unimcp-0.9.0.tar.gz.

File metadata

  • Download URL: unimcp-0.9.0.tar.gz
  • Upload date:
  • Size: 43.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for unimcp-0.9.0.tar.gz
Algorithm Hash digest
SHA256 320bb49fd6d5efb037fef9ad4bdd04859b6db3d2ef0079b26ce5d35eec5e02c4
MD5 9502cb8ca6341cc2afaf188418be2fb5
BLAKE2b-256 e1a190f4f4d3c6df114b4d8e531325604f6c5359c2f0843128e87b3cb908ae1b

See more details on using hashes here.

File details

Details for the file unimcp-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: unimcp-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for unimcp-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95c6b618c3024ba20824112d5c426dce6515f29e9e9700816e08dfd402eef470
MD5 c7ad97cd742249f8c3c3218f79273add
BLAKE2b-256 ff37f2c629e3285bf0ca2235fbd2b0459d251c83758020b5c90a9d6cc68539ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page