LangChain toolkit for Assistant Hub (rmassistanthub.io) — crypto intelligence via MCP
Project description
langchain-assistanthub
Crypto intelligence toolkit for LangChain agents. Real-time prices, risk scores, Monte Carlo backtests, AI forecasts, and more — powered by Assistant Hub.
Install
# Recommended: pin to current stable version
pip install langchain-assistanthub==0.1.3
# Or latest (for bleeding-edge users)
# pip install langchain-assistanthub
We're at v0.1.3 — pinned install recommended for stability. Check the changelog for updates!
Optional extras:
pip install langchain-assistanthub[x402] # USDC on-chain payments
pip install langchain-assistanthub[swarm] # LangGraph multi-agent
pip install langchain-assistanthub[notebook] # JupyterLab + pandas + matplotlib for examples
pip install langchain-assistanthub[dev] # pytest, ruff, mypy
Quick Start
Option A: Pre-built toolkit (recommended)
from langchain_assistanthub import AssistantHubToolkit
from langgraph.prebuilt import create_react_agent
toolkit = AssistantHubToolkit.from_api_key("ahk_your_key")
# or: toolkit = AssistantHubToolkit.from_env() # reads ASSISTANT_HUB_API_KEY
tools = toolkit.get_tools()
agent = create_react_agent(model, tools)
result = agent.invoke({"messages": [
{"role": "user", "content": "What's the risk score for SOL?"}
]})
Option B: Login with Hub credentials
from langchain_assistanthub import AssistantHubToolkit
toolkit = AssistantHubToolkit.from_hub_login("you@email.com", "password")
tools = toolkit.get_tools()
Option C: MCP auto-discovery
Dynamically discover tools from the MCP server — picks up new tools without upgrading the package:
from langchain_assistanthub import AssistantHubToolkit
tools = await AssistantHubToolkit.from_mcp(api_key="ahk_your_key")
agent = create_react_agent(model, tools)
Option D: MCP client directly
from langchain_assistanthub import AssistantHubMCPClient
client = AssistantHubMCPClient.from_api_key("ahk_your_key")
tools = await client.get_tools()
Available Tools
| Tool | Description | Tier |
|---|---|---|
live_prices |
Real-time prices for 8 major coins | Free |
fear_greed |
Crypto Fear & Greed Index | Free |
crypto_news |
Latest crypto headlines | Free |
risk_scores |
AI-computed composite risk scores | Free |
daily_pulse |
Daily macro threats + opportunities | Free |
ai_forecast |
AI price predictions (24h/7d) | Premium |
monte_carlo_backtest |
Strategy backtesting with Monte Carlo | Premium |
slippage_estimate |
Trade slippage estimation | Premium |
create_alert |
Price/change alerts | Premium |
strategy_analysis |
Full backtest + Monte Carlo + walk-forward | Premium |
execute_trade |
Paper/live trade execution | Premium |
check_approval |
Trade approval status | Premium |
price_monitor |
Live WebSocket price feed + alerts | Free* |
* Requires enable_price_feed=True and websockets package.
Advanced Usage
# Free tools only
toolkit = AssistantHubToolkit(api_key="...", include_premium=False)
# Specific tools
toolkit = AssistantHubToolkit(api_key="...", tools=["live_prices", "risk_scores"])
# Custom instance (local dev)
toolkit = AssistantHubToolkit(api_key="...", base_url="http://localhost:3000")
# With live price monitoring
toolkit = AssistantHubToolkit(
api_key="...",
enable_price_feed=True,
price_feed_coins=["BTC", "ETH", "SOL"],
)
Anonymous Free Tier
No API key? You get 10 free calls per day on non-premium tools:
toolkit = AssistantHubToolkit() # no api_key needed
tools = toolkit.get_tools() # 10 calls/day, then 429 with upgrade CTA
Payment
Free tools work instantly. Premium tools require:
- Pro/Premium JWT — unlimited calls
- x402 USDC on Base — pay per call (no subscription needed)
- HUB stakers — 50% off all x402 calls
Package Structure
sdk/langchain-python/
src/langchain_assistanthub/
__init__.py # Public API + __all__
_version.py # Single source of truth for version
toolkit.py # AssistantHubToolkit (main entry)
client.py # AssistantHubMCPClient (MCP adapter)
tools.py # Individual tool wrappers
price_feed.py # WebSocket price feed
price_monitor.py # Price alert monitor
strategy.py # Strategy analysis tool
execution.py # Trade execution tools
tests/
test_toolkit.py # Comprehensive test suite
pyproject.toml # hatchling build config
Example Notebooks
See sdk/notebooks/ for runnable examples:
| Notebook | Description | Difficulty |
|---|---|---|
01_sentiment_trader.py |
ReAct agent: sentiment → news → risk → trade | Beginner |
02_backtest_optimizer.py |
Grid search 4 strategies × 3 coins | Intermediate |
03_live_monitor.py |
WebSocket feed + auto AI analysis on big moves | Advanced |
Telemetry
This package sends a single anonymous ping on toolkit init to help us gauge adoption. No PII is collected — just a random ID, package version, and auth type (keyed vs anonymous).
Opt out:
export ASSISTANT_HUB_TELEMETRY_OPT_OUT=1
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_assistanthub-0.1.3.tar.gz.
File metadata
- Download URL: langchain_assistanthub-0.1.3.tar.gz
- Upload date:
- Size: 28.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9589632ae1ce4e55c3b26519de55e99034fc85c443b75b8f191ded55d4b98b2e
|
|
| MD5 |
9af7777c8ca4dc51f45b2c498853bce1
|
|
| BLAKE2b-256 |
986cb9eda00bbce90961f71f9d68fee85323e5382547d13b1154418c6baa6181
|
Provenance
The following attestation bundles were made for langchain_assistanthub-0.1.3.tar.gz:
Publisher:
release.yml on redman4220/langchain-assistanthub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_assistanthub-0.1.3.tar.gz -
Subject digest:
9589632ae1ce4e55c3b26519de55e99034fc85c443b75b8f191ded55d4b98b2e - Sigstore transparency entry: 1100839033
- Sigstore integration time:
-
Permalink:
redman4220/langchain-assistanthub@0e4eaa3ac6e58de26c74849da1c8797ed9606583 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/redman4220
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0e4eaa3ac6e58de26c74849da1c8797ed9606583 -
Trigger Event:
push
-
Statement type:
File details
Details for the file langchain_assistanthub-0.1.3-py3-none-any.whl.
File metadata
- Download URL: langchain_assistanthub-0.1.3-py3-none-any.whl
- Upload date:
- Size: 32.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
304cbcc7795ba1e4472bb3cfefef43b1c3f64af26020faefca0d3e649e0dfe2e
|
|
| MD5 |
17e87935f68646c3285cfffb3a5e9738
|
|
| BLAKE2b-256 |
9905a093e4688fd18262056d79f5d27f34166741553361ec8d2c2803d1206ead
|
Provenance
The following attestation bundles were made for langchain_assistanthub-0.1.3-py3-none-any.whl:
Publisher:
release.yml on redman4220/langchain-assistanthub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_assistanthub-0.1.3-py3-none-any.whl -
Subject digest:
304cbcc7795ba1e4472bb3cfefef43b1c3f64af26020faefca0d3e649e0dfe2e - Sigstore transparency entry: 1100839034
- Sigstore integration time:
-
Permalink:
redman4220/langchain-assistanthub@0e4eaa3ac6e58de26c74849da1c8797ed9606583 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/redman4220
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0e4eaa3ac6e58de26c74849da1c8797ed9606583 -
Trigger Event:
push
-
Statement type: