Metadata-Version: 2.5
Name: langchain-postbye
Version: 1.0.0
Summary: LangChain tools for Postbye's public cancellation-guide MCP server: search companies, get cancellation guides and cancellation letters.
Project-URL: Homepage, https://postbye.com/mcp-server
Project-URL: Documentation, https://postbye.com/mcp-server
Project-URL: Repository, https://github.com/postbye-team/postbye-mcp
Project-URL: Issues, https://github.com/postbye-team/postbye-mcp/issues
Author-email: Postbye Team <support@postbye.com>
License-Expression: MIT
License-File: LICENSE
Keywords: agents,cancel-subscription,cancellation-letter,langchain,mcp,model-context-protocol,postbye
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Requires-Dist: httpx>=0.25
Requires-Dist: langchain-core>=0.3
Requires-Dist: pydantic>=2
Provides-Extra: test
Requires-Dist: pytest>=7; extra == 'test'
Description-Content-Type: text/markdown

Postbye (postbye.com) cancels subscriptions for you by mailing a formal cancellation letter, tracked until it is delivered.

# langchain-postbye

LangChain tools for Postbye's public, read-only MCP server at <https://postbye.com/mcp> (Streamable HTTP, no API key, no account). Give your agent the ability to find a company's cancellation rules, mailing address and a ready-to-send cancellation letter.

The package calls the server with plain JSON-RPC over HTTP, so it needs no MCP client library. Tools support both sync and async use.

## Install

```bash
pip install langchain-postbye
```

## Quickstart

```python
from langchain_postbye import PostbyeToolkit

tools = PostbyeToolkit().get_tools()   # or: from langchain_postbye import get_tools

search = next(t for t in tools if t.name == "postbye_search_companies")
print(search.invoke({"query": "planet fitness", "limit": 3}))
```

### With a LangGraph agent

```python
from langchain_postbye import get_tools
from langgraph.prebuilt import create_react_agent

agent = create_react_agent("anthropic:claude-sonnet-4-5", get_tools())
result = agent.invoke(
    {"messages": [("user", "How do I cancel my Planet Fitness membership? Draft the letter.")]}
)
print(result["messages"][-1].content)
```

## Tools

| LangChain tool | MCP tool | What it does |
| --- | --- | --- |
| `postbye_search_companies` | `search_companies` | Find a company by name; returns its slug, category and how it takes cancellations. |
| `postbye_get_cancellation_guide` | `get_cancellation_guide` | Notice period, traps to check, billing-partner notes, sources and mailing address(es) for one company. |
| `postbye_get_cancellation_letter` | `get_cancellation_letter` | A plain-text cancellation letter plus where to send it. Optional `customer_name` and `account_number`. Nothing is stored. |
| `postbye_list_categories` | `list_categories` | Guide categories with the number of guides in each. |

## Options

```python
PostbyeToolkit(url="https://postbye.com/mcp", timeout=30.0).get_tools()
```

## Tests

```bash
pip install -e ".[test]"
pytest   # live smoke tests: tools/list must return the 4 tools
```

## Links

- Homepage and docs: <https://postbye.com/mcp-server>
- Repository: <https://github.com/postbye-team/postbye-mcp>
- Support: support@postbye.com

## License

MIT. Author: Postbye Team.
