Back to Browse

Python Sdk MCP Server

Developer ToolsLow Risk9.4MCP RegistryLocal
Free

Server data from the Official MCP Registry

Multi-provider proxy infrastructure for AI/ML. Geo, sessions, cost-aware routing, usage tools.

About

Multi-provider proxy infrastructure for AI/ML. Geo, sessions, cost-aware routing, usage tools.

Security Report

9.4
Low Risk9.4Low Risk

Valid MCP server (2 strong, 1 medium validity signals). 1 code issue detected. No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry.

8 files analyzed ยท 2 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

env_vars

Check that this permission is expected for this type of plugin.

HTTP Network Access

Connects to external APIs or services over the internet.

What You'll Need

Set these up before or after installing:

tierproxy API key (tp_live_... or tp_test_...). Sign up at https://tierproxy.com.Required

Environment variable: TIERPROXY_API_KEY

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-tierproxy-python-sdk": {
      "env": {
        "TIERPROXY_API_KEY": "your-tierproxy-api-key-here"
      },
      "args": [
        "tierproxy"
      ],
      "command": "uvx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

tierproxy โ€” Python SDK

๐Ÿšง Preview release. Gateway is not yet generally available. Join the waitlist at hello@tierproxy.com. SDK is functional but tierproxy doctor against a live gateway requires invitation.

PyPI version Python versions Downloads CI codecov License: Apache 2.0 OpenAPI 3.1 MCP compatible

Premium multi-provider proxy infrastructure for AI/ML pipelines. Built for engineers who measure cost, latency, and success rate twice โ€” and write Python.

Install

pip install tierproxy

Quickstart โ€” five-second flavor

import tierproxy
r = tierproxy.get("https://example.com", country="US")
print(r.text)

That's it. (Set TIERPROXY_API_KEY env var first.)

Three lines, persistent session

from tierproxy import TierProxy
with TierProxy() as g:
    print(g.me.get().client_id)
    r = g.get("https://example.com", country="US", session_id="s1")

Auto-pick the cheapest healthy upstream every request

g = TierProxy(routing="cheapest")  # also: "fastest", "most_reliable", "balanced"
g.get("https://example.com")     # picks via /v1/health/upstreams under the hood

Cost guardrails

g = TierProxy(
    monthly_budget_usd=200.0,    # raises BudgetExceededError before going over
)

Power-user knobs

import httpx
from tierproxy import TierProxy
from tierproxy.retry import RetryPolicy

g = TierProxy(
    api_key="tp_live_...",
    base_url="https://my-self-hosted-gw:8444",
    timeout=10.0,
    retry_policy=RetryPolicy(max_retries=5, retry_on_status=frozenset({500, 502})),
    http_client=httpx.Client(verify=False),  # custom transport
    user_agent_suffix="my-app/2.3",          # attribution
)

Raw modes (Playwright, curl, etc.)

from tierproxy import ProxyURL

p = ProxyURL(api_key="tp_live_...", country="US", mode="username_encoding")
print(p.http_url())  # http://customer-tp_live_...-cc-US:x@gw.tierproxy.com:443

Error handling

Every SDK error inherits from tierproxy.TierProxyError and carries a request_id for support escalation:

from tierproxy import TierProxy, RateLimitError
import time

with TierProxy() as g:
    try:
        resp = g.get("https://example.com/page")
    except RateLimitError as e:
        time.sleep(e.retry_after or 5)
        resp = g.get("https://example.com/page")

See Errors reference for the full HTTP-status-to-exception mapping.

AI agent integration

The SDK exposes its response models as JSON Schema and as pre-built tool definitions for Anthropic Claude and OpenAI function-calling:

import anthropic
from tierproxy import TierProxy, schemas

with TierProxy() as gw:
    anthropic.Anthropic().messages.create(
        model="claude-sonnet-4-6",
        max_tokens=1024,
        tools=schemas.anthropic_tools(),
        messages=[{"role": "user", "content": "How much quota is left?"}],
    )

See the AI integration guide and the MCP server in examples/mcp_claude_desktop.md.

How tierproxy compares

tierproxySmartproxy SDKBright Data SDKOxylabs SDKDataImpulse
Multi-provider routingโœ…โŒโŒโŒโŒ
Client-side smart selector (cost-aware)โœ…โŒโŒโŒโŒ
Live usage streaming (SSE)โœ…โŒโŒโŒโŒ
MCP server (Claude/Cursor/Cline)โœ…โŒโŒโŒโŒ
OpenTelemetry built-inโœ…โŒโŒโŒโŒ
Sync + async parityโœ…partialpartialpartialpartial
AI/ML framework examples shipped80100
Type-safe (Pydantic v2 + mypy strict)โœ…โŒโŒpartialโŒ
OpenAPI 3.1 specโœ…โŒโŒโŒโŒ
Pip-installable CLI (tierproxy doctor)โœ…โŒโŒโŒโŒ
Per-request cost attribution (lazy)โœ…โŒโŒโŒโŒ
JA3/JA4 TLS fingerprint rotationโœ…โŒโŒโŒโŒ
Rate-limit learning + auto-failoverโœ…โŒโŒโŒโŒ
LicenseApache 2.0proprietaryproprietaryproprietaryproprietary

Features

  • Five-second quickstart โ€” import tierproxy; tierproxy.get(url, country="US")
  • Layered API โ€” five integration levels from one-liner to power-user knobs
  • Smart routing โ€” routing="cheapest" auto-picks healthy upstream per request
  • Cost guardrails โ€” monthly_budget_usd= refuses requests that would exceed budget
  • Per-request cost attribution โ€” client.cost_for(resp) returns USD; lazy 30s cache, no per-request overhead
  • Client-side response caching โ€” cache_ttl=300, cache_max_response_size=262144 LRU with size cap
  • Multi-provider auto-failover โ€” auto_failover=True retries with next-best upstream on 429/5xx
  • Rate-limit learning โ€” client.rate_limits.get() surfaces gateway-aggregated 429s per target domain
  • JA3/JA4 TLS rotation โ€” per-upstream fingerprint randomization (gateway side; see tls-fingerprint guide)
  • Cookie persistence โ€” cookies stick to session_id across multi-step crawls
  • Streaming responses โ€” client.get(url, stream=True) returns iterator (large files, SSE)
  • Live SSE stream โ€” for delta in g.usage.stream() tails month-to-date bytes
  • MCP server โ€” tierproxy-mcp exposes proxy as tools to Claude/Cursor/Cline
  • 8 framework integrations โ€” LangChain, LlamaIndex, Crawl4AI, Playwright, Firecrawl, Browser-Use, CrewAI
  • OpenTelemetry opt-in โ€” pip install tierproxy[otel] for distributed tracing
  • Geo + sticky sessions โ€” countries, cities, 1-1440min session pins
  • Dual URL syntax โ€” headers (httpx/requests) AND username-encoding (Playwright)
  • Type-safe end-to-end โ€” Pydantic v2 models, mypy strict, full IDE autocomplete

See examples/ for LangChain/LlamaIndex/Crawl4AI/Playwright and examples/levels.py for a runnable demo of every level.

Use with your favorite AI/agent framework

FrameworkExampleNotes
LangChainwith_langchain.pyRAG document loaders through proxy
LlamaIndexwith_llamaindex.pySimpleWebPageReader through proxy
Crawl4AIwith_crawl4ai.pyPlaywright crawler + tierproxy
Firecrawl (hot)with_firecrawl.pySelf-hosted Firecrawl + residential IPs
Browser-Use (hot)with_browser_use.pyLLM-driven autonomous browser
CrewAI (hot)with_crewai.pyMulti-agent scraper crew + cost-aware routing
Playwrightwith_playwright.pyDirect Playwright with tierproxy
MCP (Claude/Cursor/Cline/Windsurf) (unique)mcp_claude_desktop.mdNative tool integration via tierproxy-mcp

MCP server (Claude Desktop / Cursor / Cline / Windsurf)

pip install tierproxy[mcp]

Then add to your MCP client config:

{
  "mcpServers": {
    "tierproxy": {
      "command": "tierproxy-mcp",
      "env": { "TIERPROXY_API_KEY": "tp_live_..." }
    }
  }
}

Now your AI assistant can call fetch_url(url, country="US"), inspect health and usage, and route through the cheapest healthy upstream โ€” no glue code, no httpx imports, no boilerplate.

Reviews

No reviews yet

Be the first to review this server!

Python Sdk MCP Server - Multi-provider proxy infrastructure for AI/ML. Geo, | MCP Marketplace