langchain-mcp-adapters · MultiServerMCPClient 56 Hosted MCP Tools + 67 REST Endpoints -81.3% Context Savings (mode="summary") StateGraph Ready · 0 Credits on 504/429

Production LangChain & LangGraph
Hosted MCP & StateGraph Integration

Power stateful LangGraph StateGraph and LangChain agents with 16 global data platforms via two production-grade paths: inject all 56 Hosted MCP tools directly from https://mcp.upp3.com/mcp (same-origin alias https://upp3.com/mcp also supported) using MultiServerMCPClient, or call deterministic 67 /v1/* REST endpoints at https://api.upp3.com/v1/* with mode="summary" (-81.3% pretty / -78.8% compact token savings), GDPR 0-PII (strip_real_estate_pii), and $0 credit cost on HTTP 504/429 retries.

56 MCP + 67 REST
One key covers Hosted Streamable HTTP MCP & deterministic /v1/* routes across 16 platforms
-81.3% Context Savings
V2.19 verified mode="summary" reduction (-78.8% compact) keeps LangGraph state slim
504/429 Retry = $0
Node-level exponential backoff on upstream HTTP 504/429 incurs strictly 0 credits
StateGraph Ready
ToolNode, token budget guards, GDPR 0-PII, & streaming in Python + TypeScript
Dual Integration Architecture · HowTo Blueprint

Path A (Hosted MCP First) vs. Path B (Deterministic REST Tool Nodes)

Pick the transport that matches your LangGraph topology—or combine both in a single graph using the same EdgeData API key.

Path A · Recommended Default

langchain-mcp-adapters (MultiServerMCPClient)

Connect directly to https://mcp.upp3.com/mcp over Streamable HTTP (alias https://upp3.com/mcp) with Authorization: Bearer <YOUR_EDGEDATA_API_KEY> and auto-bind all 56 native MCP tools into LangGraph create_react_agent or custom StateGraph + ToolNode.

  • ✓Zero hand-written Pydantic tool schemas — live JSON Schema discovery via MCP
  • ✓All 56 tools default to mode="summary" (-81.3% pretty / -78.8% compact tokens)
  • ✓Zero local stdio subprocesses or Docker containers in production pods
  • ✓Works seamlessly in both Python (langchain-mcp-adapters) & TS (@langchain/mcp-adapters)
Path B · Deterministic Pipelines

REST Tool Wrapper (httpx / fetch)

Invoke any of the 67 REST endpoints at https://api.upp3.com/v1/* with X-API-Key: <YOUR_EDGEDATA_API_KEY> and explicit mode="summary" inside typed LangGraph nodes for strict field projection, parallel fan-out, and deterministic token budgeting.

  • ✓Explicit control over HTTP status codes (504/429 backoff at 0 credit cost)
  • ✓Deterministic state transitions without waiting for LLM tool-call routing
  • ✓Inspect exact meta.credits_charged and meta.credits_remaining in graph state
  • ✓Ideal for scheduled multi-platform ETL + LLM synthesis graphs
Python 3.10+ · LangGraph + MCP Adapters + httpx
pip install langgraph langchain-openai langchain-mcp-adapters httpx
TypeScript / Node 18+ · @langchain/langgraph + MCP Adapters
npm install @langchain/langgraph @langchain/openai @langchain/mcp-adapters @langchain/core
Auth Headers & Endpoint Parity

Hosted MCP uses https://mcp.upp3.com/mcp (or https://upp3.com/mcp) with Authorization: Bearer YOUR_EDGEDATA_API_KEY. Direct REST calls target https://api.upp3.com/v1/* with X-API-Key: YOUR_EDGEDATA_API_KEY. Both share the same credit balance, mode="summary" compaction engine, GDPR 0-PII redaction, and 0-credit 504/429 protection.

Production StateGraph Blueprints · Syntax-Verified Code

3 Production LangGraph Architectures (Copy & Run)

Every snippet enforces mode="summary", tracks token budgets, handles HTTP 504/429 safely at 0 credits, and auto-fills your session key when claimed below.

Using placeholder YOUR_EDGEDATA_API_KEY — claim a free key below to auto-fill every LangGraph snippet. Auto-Fill Free Key →
langgraph_mcp_stategraph.py

Python LangGraph StateGraph + MultiServerMCPClient: Connects to https://mcp.upp3.com/mcp, wraps ToolNode with node-level exponential backoff on HTTP 504/429 (strictly 0 credits charged), and enforces a cumulative mode="summary" token budget guard before looping back to the model.

MultiServerMCPClient StateGraph + ToolNode amazon_get_product_detail redfin_search_properties tradingview_get_quotes 504/429 Backoff = 0 Credits
import asyncio
import os
from typing import Annotated, TypedDict

from langchain_core.messages import AnyMessage, HumanMessage, SystemMessage
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain_openai import ChatOpenAI
from langgraph.graph import END, START, StateGraph
from langgraph.graph.message import add_messages
from langgraph.prebuilt import ToolNode

EDGEDATA_API_KEY = os.getenv("EDGEDATA_API_KEY", "YOUR_EDGEDATA_API_KEY")
TOKEN_BUDGET_LIMIT = 12000  # ~4 chars/token guard to cap graph context spend


class AgentState(TypedDict):
    messages: Annotated[list[AnyMessage], add_messages]
    est_tokens: int
    retry_events: int


def estimate_tokens(messages: list[AnyMessage]) -> int:
    return sum(len(str(getattr(m, "content", ""))) for m in messages) // 4


async def run_langgraph_mcp() -> None:
    mcp_client = MultiServerMCPClient(
        {
            "edgedata": {
                "transport": "streamable_http",
                "url": "https://mcp.upp3.com/mcp",  # Alias: https://upp3.com/mcp
                "headers": {
                    "Authorization": f"Bearer {EDGEDATA_API_KEY}",
                },
            }
        }
    )

    # Auto-discover all 56 Hosted MCP tools; optionally narrow to target tools
    all_tools = await mcp_client.get_tools()
    allowed = {
        "amazon_get_product_detail",
        "walmart_get_item",
        "redfin_search_properties",
        "rightmove_get_house_price_index",
        "tradingview_get_quotes",
        "tradingview_get_earnings_calendar",
    }
    tools = [t for t in all_tools if t.name in allowed]

    llm = ChatOpenAI(model="gpt-4.1-mini", temperature=0).bind_tools(tools)
    raw_tool_node = ToolNode(tools)

    async def reason_node(state: AgentState) -> dict:
        sys_msg = SystemMessage(
            content=(
                "You are a production research agent using EdgeData MCP tools. "
                "Always pass mode='summary' (-81.3% avg tokens). "
                "Respect GDPR 0-PII boundaries and never fabricate metrics."
            )
        )
        response = await llm.ainvoke([sys_msg, *state["messages"]])
        updated_tokens = estimate_tokens([*state["messages"], response])
        return {"messages": [response], "est_tokens": updated_tokens}

    async def resilient_tool_node(state: AgentState) -> dict:
        """Node-level exponential backoff on upstream HTTP 504/429 (0 credits charged)."""
        retries = state.get("retry_events", 0)
        for attempt in range(3):
            try:
                out = await raw_tool_node.ainvoke(state)
                new_msgs = out.get("messages", [])
                return {
                    "messages": new_msgs,
                    "est_tokens": state.get("est_tokens", 0) + estimate_tokens(new_msgs),
                    "retry_events": retries,
                }
            except Exception as exc:
                err_text = str(exc)
                if ("504" in err_text or "429" in err_text) and attempt < 2:
                    retries += 1
                    await asyncio.sleep(1.5 * (2 ** attempt))
                    continue
                raise
        raise RuntimeError("ToolNode exhausted HTTP 504/429 retry budget")

    def route_next(state: AgentState) -> str:
        if state.get("est_tokens", 0) >= TOKEN_BUDGET_LIMIT:
            return END
        last = state["messages"][-1]
        if getattr(last, "tool_calls", None):
            return "tools"
        return END

    graph = StateGraph(AgentState)
    graph.add_node("reason", reason_node)
    graph.add_node("tools", resilient_tool_node)
    graph.add_edge(START, "reason")
    graph.add_conditional_edges("reason", route_next, {"tools": "tools", END: END})
    graph.add_edge("tools", "reason")

    app = graph.compile()
    result = await app.ainvoke(
        {
            "messages": [
                HumanMessage(
                    content=(
                        "Using mode='summary', fetch: "
                        "1) amazon_get_product_detail(asin='B0BSHF7WHW', country='US', mode='summary'); "
                        "2) redfin_search_properties(query='Austin, TX', status='active', max_price=850000, mode='summary'); "
                        "3) tradingview_get_quotes(symbols='NASDAQ:AAPL,NASDAQ:NVDA,BINANCE:BTCUSDT', mode='summary'). "
                        "Return a concise cross-vertical executive summary."
                    )
                )
            ],
            "est_tokens": 0,
            "retry_events": 0,
        }
    )
    print(result["messages"][-1].content)
    print(f"Estimated tokens: {result['est_tokens']} | 504/429 zero-cost retries: {result['retry_events']}")


if __name__ == "__main__":
    asyncio.run(run_langgraph_mcp())
Resilience & Context Economics · Verified Benchmarks

Production Fault-Tolerance & Token Budget Comparison

Compare EdgeData’s two LangGraph integration paths against ad-hoc HTML scraping nodes across retry safety, checkpoint bloat, and compliance.

Architecture Dimension Path A: LangGraph + EdgeData MCP Path B: LangGraph + EdgeData REST Node DIY Scraper / Browser Tool Node
Checkpoint Token Footprint -81.3% Pretty / -78.8% Compact avg via default mode="summary" (V2.19 6-endpoint verified) -81.3% Pretty / -78.8% Compact + optional node-level field filtering & hard token cap 3,000–15,000+ Markdown tokens persisted per step; rapid LangGraph checkpointer bloat
HTTP 504 / 429 Retry Economics 0 Credits Charged on upstream 504/429 — safe for ToolNode backoff 0 Credits Charged on upstream 504/429 + full access to Retry-After & meta.credits_remaining Billed proxy bandwidth, browser minutes, and CAPTCHA solves on every retry
Graph Routing Determinism Dynamic LLM routing across 56 tools with optional allowlist filtering 100% deterministic DAG execution (parallel asyncio.gather fan-out) Fragile selector parsers throw unpredictable runtime exceptions in graph nodes
GDPR 0-PII State Hygiene Server-side strip_real_estate_pii & review/jobs redaction before state persistence Identical gateway-level GDPR 0-PII boundary across all 67 REST routes Raw personal emails & phones risk leaking into Postgres/Redis LangGraph checkpoints
Transparent Unit Economics $0 Free (100/mo) · $47 Pack (25k never-expiring) · $49/mo Pro (15k) · $149/mo Scale (60k) Same unified API key & credit weights (1 credit commerce; 2 credits Redfin/Rightmove/TradingView) Unpredictable residential proxy GBs + headless fleet ops + high LLM input costs
No Card Required

Free

$0 / month
  • ✓100 credits / mo · 10 RPM
  • ✓All 56 MCP tools & 67 REST endpoints
  • ✓mode="summary" (-81.3% avg tokens)
Claim Free Key ↓
Never Expires

One-Time Pack

$47 one-time
  • ✓25,000 credits · never expire
  • ✓Zero monthly subscription lock-in
  • ✓Ideal for burst LangGraph research jobs
Buy $47 Pack →
Most Popular

Pro

$49 / month
  • ✓15,000 credits / mo · 60 RPM
  • ✓Deep reviews (500/call) + NDJSON stream
  • ✓HTTP 504/429 = 0 credits charged
Choose Pro ($49/mo) →
High Throughput

Scale

$149 / month
  • ✓60,000 credits / mo · 200 RPM
  • ✓Up to 2,000 reviews/call + priority routing
  • ✓Built for multi-tenant LangGraph workers
Choose Scale ($149/mo) →
LangChain & LangGraph MCP FAQ

Frequently Asked Questions

MCP vs REST architecture selection, Streamable HTTP auth, checkpoint token control, retry billing, and GDPR 0-PII.

When should I use langchain-mcp-adapters (MultiServerMCPClient) vs. direct REST nodes in LangGraph?
Use Path A (langchain-mcp-adapters MultiServerMCPClient pointed at https://mcp.upp3.com/mcp) when building flexible ReAct or StateGraph agents that dynamically pick across all 56 EdgeData tools without writing schemas. Use Path B (httpx or fetch REST tool wrappers calling https://api.upp3.com/v1/* with X-API-Key) when your StateGraph requires deterministic node execution, strict field projections, or custom local caching.
How does MultiServerMCPClient authenticate against EdgeData Streamable HTTP MCP?
Configure transport="streamable_http", url="https://mcp.upp3.com/mcp" (the same-origin alias https://upp3.com/mcp also works), and headers={"Authorization": "Bearer <YOUR_EDGEDATA_API_KEY>"}. No local stdio subprocess, Docker container, or OAuth redirect server is required.
How does mode="summary" protect LangGraph state checkpointers from token bloat?
LangGraph persists tool messages across graph checkpoints, so verbose JSON or HTML responses rapidly inflate context costs. EdgeData mode="summary" reduces payload tokens by an average of 81.3% (pretty JSON) and 78.8% (compact JSON) across V2.19 verified benchmarks, keeping multi-node StateGraph runs compact and predictable.
Is it safe to configure exponential backoff retries on HTTP 504/429 inside LangGraph nodes?
Yes. EdgeData enforces a strict 0 credits charged billing guardrail on every upstream HTTP 504 timeout or HTTP 429 rate-limit response across all 56 Hosted MCP tools and 67 REST endpoints, so node-level retry policies never incur duplicate credit deductions.
What compliance guardrails and pricing plans apply to production LangGraph deployments?
EdgeData scrubs personal contact fields server-side (including strip_real_estate_pii for Redfin US and Rightmove UK) for GDPR 0-PII compliance before payloads reach your graph state. One key covers all 16 platforms across four tiers: $0 Free (100 credits/mo), $47 One-Time Pack (25,000 never-expiring credits), $49/mo Pro (15,000 credits/mo), and $149/mo Scale (60,000 credits/mo).