Metadata-Version: 2.4
Name: wise-agent-toolkit
Version: 0.5.0
Summary: The Wise Agent Toolkit enables the integration of various AI frameworks and libraries with Wise APIs to create and manage transfers programmatically.
Author-email: Max Ploter <maksim.ploter@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/maxploter/wise-agent-toolkit
Project-URL: Repository, https://github.com/maxploter/wise-agent-toolkit
Project-URL: Documentation, https://github.com/maxploter/wise-agent-toolkit
Keywords: wise,transferwise,ai,agents,langchain
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: wise-api-client>=0.7.0
Requires-Dist: pydantic>=2.10
Provides-Extra: langchain
Requires-Dist: langchain>=0.3.0; extra == "langchain"
Requires-Dist: langchain-openai>=0.2.0; extra == "langchain"
Requires-Dist: openai>=1.66.0; extra == "langchain"
Provides-Extra: mcp
Requires-Dist: mcp>=2.0.0; extra == "mcp"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: isort>=5.0; extra == "dev"
Requires-Dist: flake8>=6.0; extra == "dev"
Provides-Extra: all
Requires-Dist: wise-agent-toolkit[langchain]; extra == "all"
Requires-Dist: wise-agent-toolkit[mcp]; extra == "all"
Dynamic: license-file

# Wise (TransferWise) Agent Toolkit

Expose the Wise API to AI coding agents and assistants — quotes, transfers, recipients, profiles, activities, and balances — as MCP tools, or as a Python toolkit for LangChain and (soon) CrewAI/AutoGen.

This README leads with MCP (the most common use case: wiring Wise into **Claude Code** or **Codex CLI**). See [Other integrations](#other-integrations) for LangChain/CrewAI/AutoGen.

## Supported API Methods

- **Quotes** — create, update, get by ID
- **Recipients** — list, create, get by ID, deactivate, get account requirements
- **Transfers** — create, get by ID, list, cancel
- **Profiles** — list, get by ID
- **Activities** — list
- **Balances** — list

## Quick Start: MCP

### 1. Install

```bash
pip install "wise-agent-toolkit[mcp]"
```
> Requires `mcp>=2.0.0`. If upgrading from wise-agent-toolkit `<0.4.0`: the `mcp` package made breaking changes to its server API in 2.0, so this toolkit only supports `mcp` 2.x going forward.

> **macOS/zsh:** quote the package name so the shell doesn't interpret the brackets: `pip install "wise-agent-toolkit[mcp]"` (or escape them: `wise-agent-toolkit\[mcp\]`).

### 2. Set credentials

```bash
export WISE_API_KEY="your_wise_api_key_here"
export WISE_API_HOST="https://api.transferwise.com"  # production; see the sandbox note below
```

**Gotcha:** if you omit `WISE_API_HOST`, the server defaults to the sandbox API — set it explicitly for production data. Also note: Wise's V1 sandbox (`api.sandbox.transferwise.tech`) is being retired in favor of Sandbox V2 (see [Wise's migration guide](https://docs.wise.com/guides/developer/environments/sandbox-v2-migration)) — if sandbox calls start failing with `410 Gone`, that's why; you'll need V2 sandbox credentials from Wise, not a code fix here.

### 3a. Claude Code

Register the server for the current project:
```bash
claude mcp add wise -- python -m wise_agent_toolkit.mcp
```

Or check in a `.mcp.json` at your project root so the whole team gets it:
```json
{
  "mcpServers": {
    "wise": {
      "command": "python",
      "args": ["-m", "wise_agent_toolkit.mcp"],
      "env": {
        "WISE_API_KEY": "${WISE_API_KEY}",
        "WISE_API_HOST": "https://api.transferwise.com"
      }
    }
  }
}
```
`${WISE_API_KEY}` is expanded from your shell environment at launch — don't hardcode the key in the file. Project-scoped `.mcp.json` servers need one-time approval in Claude Code, or list them under `enabledMcpjsonServers` in `.claude/settings.local.json` to skip the prompt:
```json
{
  "enabledMcpjsonServers": ["wise"]
}
```

Verify:
```bash
claude mcp list
```
should show `wise: ... - ✔ Connected`. If it instead shows `Failed to connect — Connection closed`, that error only means the server process exited during startup — it doesn't say why. Run the module directly to see the real traceback:
```bash
python -m wise_agent_toolkit.mcp --api_key "$WISE_API_KEY" --host "$WISE_API_HOST"
```

### 3b. Codex CLI

Add a `[mcp_servers.wise]` table to `~/.codex/config.toml` (global) or `.codex/config.toml` in your project (project-scoped):
```toml
[mcp_servers.wise]
command = "python"
args = ["-m", "wise_agent_toolkit.mcp"]
env = { WISE_API_KEY = "your_wise_api_key_here", WISE_API_HOST = "https://api.transferwise.com" }
```
Codex uses `mcp_servers` (snake_case), not `mcpServers`. Unlike Claude Code's `${VAR}` expansion, Codex's `env` table takes literal values — avoid committing a project-scoped `.codex/config.toml` with a real key in it; use the global `~/.codex/config.toml` for real credentials instead.

### 4. Other ways to run the server

Command line, explicit args instead of env vars:
```bash
python -m wise_agent_toolkit.mcp --api_key "your_api_key" --host "https://api.transferwise.com"
```

Programmatically, if you want the MCP tool objects directly:
```python
from wise_agent_toolkit.mcp.toolkit import WiseAgentToolkit

wise_agent_toolkit = WiseAgentToolkit(
    api_key="YOUR_WISE_API_KEY",
    host="https://api.transferwise.com",
    configuration={
        "actions": {
            "transfers": {"create": True},
            "balances": {"read": True},
        }
    },
)
tools = wise_agent_toolkit.get_tools()
```

**Server CLI options:** `--api_key` (required), `--host` (default: sandbox), `--server_name` (default: `"wise-agent-toolkit"`), `--profile_id` (optional).

## Other integrations

### LangChain
```bash
pip install "wise-agent-toolkit[langchain]"
```
```python
from wise_agent_toolkit.langchain.toolkit import WiseAgentToolkit
from langchain_openai import ChatOpenAI
from langchain.agents import create_react_agent

wise_agent_toolkit = WiseAgentToolkit(
    api_key="YOUR_WISE_API_KEY",
    host="https://api.transferwise.com",
    configuration={"actions": {"transfers": {"create": True}}},
)

agent = create_react_agent(
    tools=wise_agent_toolkit.get_tools(),
    llm=ChatOpenAI(model="gpt-4"),
    agent="zero-shot-react-description",
    verbose=True,
)
response = agent.run("Create a transfer of 100 EUR to John Doe's account.")
```
The `context` config option (e.g. `{"context": {"profile_id": 42}}`) sets defaults for API calls that need a profile ID — same option is available for the MCP toolkit above. See `/examples` in this repo for a full script.

### CrewAI / AutoGen
🚧 Not yet implemented — `wise-agent-toolkit[crewai]` / `[autogen]` extras are reserved for future support.

### Checking available integrations
```python
from wise_agent_toolkit import get_available_integrations
print(get_available_integrations())
```

## Installation reference

```bash
pip install wise-agent-toolkit               # core only, no integrations
pip install "wise-agent-toolkit[mcp]"         # MCP
pip install "wise-agent-toolkit[langchain]"   # LangChain
pip install "wise-agent-toolkit[all]"         # everything
pip install "wise-agent-toolkit[dev]"         # development
```
Requires Python 3.11+.

## Extending

To add support for a new AI library:
1. Create a new directory under `wise_agent_toolkit/` for your integration
2. Implement the integration-specific toolkit and tool classes inheriting from the base classes
3. Add the optional dependency to `pyproject.toml`
4. Update the main `__init__.py` to conditionally import your integration

To add support for a new Wise API operation, see the `wise-add-api-endpoint` skill (if you're working in Claude Code) or `AGENTS.md` in this repo, `wise-python`, and `wise-openapi` — it documents the full spec → client → toolkit pipeline end to end.
