Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

mcp-client-python

A Python client library and CLI for connecting to a serverless MCP server over Streamable HTTP.

Companion to mcp-infra, which deploys the server to AWS, Azure, or GCP.

Installation

pip install mcp-client-python

CLI

export MCP_ENDPOINT=https://YOUR_ENDPOINT/mcp
export MCP_HEADERS="x-api-key:YOUR_KEY"

# List available tools
mcp-client tools list

# Call a tool
mcp-client tools call <name> --args '{"key": "value"}'

# Machine-readable output
mcp-client tools list --json
mcp-client tools call <name> --args '{"key": "value"}' --json

# Custom headers (repeatable)
mcp-client tools list --header "x-api-key:YOUR_KEY"
mcp-client tools list --header "Authorization:Bearer tok123" --header "X-Custom:foo"

Credentials can also be placed in a .env file in the working directory. Additional headers can be set via MCP_HEADERS as comma-separated key:value pairs:

MCP_HEADERS="x-api-key:YOUR_KEY,X-Custom:foo"

SDK

import asyncio
from mcp_client import MCPClient

client = MCPClient(
    endpoint="https://YOUR_ENDPOINT/mcp",
    headers={"x-api-key": "YOUR_KEY"},
)

# List available tools
tools = asyncio.run(client.list_tools())
print([t.name for t in tools])

# Call a tool
result = asyncio.run(client.call_tool(
    "get_repo_summary",
    {"repo_url": "https://github.com/anthropics/anthropic-sdk-python"},
))
print(result.content)

Each method opens a fresh connection, executes, and closes — no persistent state to manage.

Requirements

  • Python 3.10+
  • An MCP server endpoint (see mcp-infra)

License

MIT

Download files

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

Source Distribution

mcp_client_python-0.2.1a0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

mcp_client_python-0.2.1a0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file mcp_client_python-0.2.1a0.tar.gz.

File metadata

  • Download URL: mcp_client_python-0.2.1a0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mcp_client_python-0.2.1a0.tar.gz
Algorithm Hash digest
SHA256 244800ae2447075d90938f41e5a6f2b2af810643c03d50173f0a25888708d325
MD5 a92cfb59b02c8a1956aae499ef1cdb44
BLAKE2b-256 0197f1053e499d73f884a31f041e8f3dcb18c2d4bc09676458fdcb97ae4e1474

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_client_python-0.2.1a0.tar.gz:

Publisher: client-python-publish.yml on nicculus/simple-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_client_python-0.2.1a0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_client_python-0.2.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 45c610daff8f42d59c366928c055f7fa742a3e15fe09a31fe36ea7e09baccb89
MD5 3c8bbff06bc3623bca647b2b22d56780
BLAKE2b-256 97046db579b20d5d43e1a52e36d5ec43cce2c022bbedee5685c042288b8aba7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_client_python-0.2.1a0-py3-none-any.whl:

Publisher: client-python-publish.yml on nicculus/simple-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

This release

0.2.1a0 This release

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page