Metadata-Version: 2.4
Name: yieldagentx402-langchain
Version: 0.1.3
Summary: LangChain tools for policy-gated YieldAgentX402 execution — discovery, policy preview, receipt verification via the live MCP gateway. Proof: 16 tools, 18 chains, no custody, signed receipts.
Project-URL: Homepage, https://yieldagentx402.app
Project-URL: Documentation, https://yieldagentx402.app/mcp-server
Project-URL: Discovery, https://yieldagentx402.app/.well-known/mcp.json
Project-URL: Repository, https://github.com/Fabio662/yieldagentx402-sdks
Project-URL: Issues, https://github.com/Fabio662/yieldagentx402-sdks/issues
Project-URL: Try It Now, https://api.yieldagentx402.app/api/agent-onboard
Project-URL: Instant Test Key, https://api.yieldagentx402.app/api/apply
Project-URL: Privacy, https://yieldagentx402.app/privacy
Author-email: YieldAgentX402 <security@yieldagentx402.app>
License: MIT
Keywords: ai-agents,langchain,langchain-core,mcp,policy,receipts,x402,yieldagentx402
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: langchain-core>=0.3.0
Requires-Dist: pydantic>=2.0
Requires-Dist: requests>=2.31
Description-Content-Type: text/markdown

# yieldagentx402-langchain

> LangChain tools for **YieldAgentX402** — policy-gated, receipt-backed agent execution (MCP gateway).

**PyPI:** `pip install yieldagentx402-langchain`  
**Import:** `yieldagentx402_langchain`

> **Note:** PyPI rejects third-party packages named `langchain-*` (403 Forbidden). This package uses the `yieldagentx402-langchain` name, same pattern as `crewai-yieldagentx402-tools`.

**Pitch:** LangChain agents plan; YieldAgentX402 executes with ShadeGuard, x402, and verifiable receipts.  
**Proof:** 16 tools · 18 chains · no custody · signed receipts.

[Docs](https://yieldagentx402.app/mcp-server) · [Try without signup](#try-without-signup) · [Get API key](https://yieldagentx402.app/apply) · [PyPI](https://pypi.org/project/yieldagentx402-langchain/)

## Install

```bash
pip install yieldagentx402-langchain
```

**From this repo (editable):**

```bash
python -m pip install -e .
python -c "import yieldagentx402_langchain; print('ok')"
```

## Try without signup

```python
from yieldagentx402_langchain import YieldAgentX402DiscoveryTool

print(YieldAgentX402DiscoveryTool().invoke({}))
```

## With an API key

```bash
export YAX_API_KEY=yax_test_...   # POST https://api.yieldagentx402.app/api/apply
```

```python
from yieldagentx402_langchain import (
    YieldAgentX402DiscoveryTool,
    YieldAgentX402PolicyPreviewTool,
    YieldAgentX402ReceiptVerifierTool,
)

print(YieldAgentX402PolicyPreviewTool().invoke({
    "action_type": "payment",
    "parameters_json": '{"amount": "1.00", "token": "USDC"}',
}))
```

## Tools

| Tool | MCP method | Auth |
|------|------------|------|
| `YieldAgentX402DiscoveryTool` | `yax_get_capabilities` | None |
| `YieldAgentX402ActionPlannerTool` | `yax_get_capabilities` (plan subset) | None |
| `YieldAgentX402PolicyPreviewTool` | `yax_check_policy` | `YAX_API_KEY` |
| `YieldAgentX402ReceiptVerifierTool` | `yax_verify_receipt` | `YAX_API_KEY` for some tenants |

## Environment

| Variable | Default |
|----------|---------|
| `YAX_API_KEY` | — |
| `YAX_API_BASE` / `YAX_MCP_BASE` | `https://api.yieldagentx402.app` |
| `YAX_USE_CURL` | `0` — force MCP HTTP via `curl` (macOS CLT Python 3.9) |

## Publish (maintainer)

```bash
export TWINE_USERNAME=__token__
export TWINE_PASSWORD='pypi-...'
./scripts/publish-pypi.sh
```

## Troubleshooting: `SSLError` on macOS

Use Python 3.11+ from Homebrew in a venv, or set `YAX_USE_CURL=1`. See prior README section / `scripts/smoke-discovery.sh`.
