JustLend Skills¶
GitHub: https://github.com/justlend/justlend-skills
JustLend Skills (@justlend/justlend-skills) is an AI Agent skills package for the JustLend DAO protocol on TRON. It provides structured skill instructions and a lightweight read-only MCP server (9 query tools) that enables AI agents (Claude Code, Claude Desktop, Cursor, Codex, etc.) to query market data, monitor account positions, and analyze DeFi lending information.
It also works as a standalone CLI tool for quick market checks directly from the terminal.
Note
This is a read-only query package. No write operations or transaction signing are supported. For write operations (supply, borrow, repay, withdraw, sTRX staking, energy rental, governance voting), use the full MCP server: @justlend/mcp-server-justlend.
Companion references for agents using these tools
The tool outputs use protocol-specific terminology — mantissa, borrowIndex, exchangeRate, collateralFactor, closeFactor, liquidationIncentive, status: active|legacy. Each is defined in the Glossary with units and on-chain encoding. When asking the agent to act on a market (e.g. supply, repay), point it at Common Pitfalls first — the same gotchas (USDT approve() race, decimals mismatch, etc.) apply whether the agent uses Skills, the full MCP server, or raw TronWeb.
Overview¶
JustLend DAO is the largest lending protocol on TRON, based on the Compound V2 architecture. JustLend Skills wraps the core query functionality into MCP tools and structured skill instructions that AI agents can use.
Key Capabilities¶
- Market Data: Real-time APYs (including mining rewards), TVL, utilization rates for all markets
- Protocol Dashboard: Total supply, borrow volume, TVL, and user count across the protocol
- Account Analysis: Health factor monitoring, liquidation risk assessment, balance queries
- Token Balances: Query native TRX and TRC20 token balances (USDT, USDD, USDC, BTC, ETH, SUN, WIN, etc.)
- Token Allowances: Check TRC20 approval status for JustLend contracts
Skill Modules¶
The project includes 4 structured skill modules in the /skills directory that provide AI agents with domain-specific instructions and workflows:
| Skill | Description | MCP Server Required |
|---|---|---|
| justlend-lending-v1 | Market queries, account analysis, health factor monitoring | JustLend Skills (built-in) |
| justlend-trx-staking | Stake TRX for sTRX liquid staking tokens | Full MCP Server |
| justlend-energy-rental | Rent TRON Energy at discounted rates (50-80% cheaper) | Full MCP Server |
| justlend-governance-v1 | View proposals, deposit JST for voting power, cast votes | Full MCP Server |
The lending skill works with the built-in 9 query tools. The other three skills provide instructional guidance and require the full MCP server for write operations.
Featured Markets (CLI Quick Reference)¶
Not an exhaustive market list
The table below lists the 9 markets the bundled CLI examples target by symbol shortcut. It is not the protocol's full market roster. The JustLend DAO protocol currently exposes 17 active + 6 legacy = 23 markets total (see the single source of truth below). All 23 are queryable through the Skills MCP server via get_supported_markets / get_all_markets — the CLI shortcuts are just a convenience subset for human terminal use.
Single source of truth for the live market list (in order of preference):
- Live API —
GET https://openapi.just.network/lend/jtokenreturns the authoritative jToken list with addresses, APYs, and TVL. - Machine-readable address book —
/developers/contracts.json(regenerated from the MCP server'schains.ts). - Rendered table — APIs §2 — jToken Address Reference (all 23 markets, legacy rows tagged).
| jToken | Underlying | Description |
|---|---|---|
| jTRX | TRX | Native TRON token |
| jUSDT | USDT | Tether USD |
| jUSDD | USDD | Decentralized USD |
| jBTC | BTC | Bitcoin (TRC20) |
| jETH | ETH | Ethereum (TRC20) — dApp display name "ETH" (formerly "ETHOLD") |
| jETHB | ETHB | Ethereum bridged — dApp display name "ETHB" (formerly "ETH") |
| jSUN | SUN | SUN Token |
| jWIN | WIN | WINkLink |
| jHTX | HTX | HTX token |
Markets currently closed to new supply/borrow (legacy, queryable but do not direct new deposits to them): jUSDCOLD, jUSDDOLD, jUSDJ, jWBTT, jSUNOLD, jBUSDOLD.
Prerequisites¶
- Node.js 20.0.0 or higher
- TronGrid API key (required)
Installation¶
git clone https://github.com/justlend/justlend-skills.git
cd justlend-skills
bash install.sh
Or manually:
npm install
The install.sh script will create .env and prompt for your TronGrid API key.
Configuration¶
Create a .env file (or use install.sh):
# Required — get from https://www.trongrid.io/
TRONGRID_API_KEY=your_trongrid_api_key
# Network: mainnet (default) or nile (testnet)
NETWORK=mainnet
Client Configuration¶
Resolving the install path
The MCP config snippets below use /ABSOLUTE_PATH_TO/justlend-skills/... as a placeholder. Replace it with the absolute path of the directory you cloned into. From inside the cloned repo, the absolute path to the server entry script is just:
echo "$(pwd)/scripts/mcp_server.mjs"
For a one-step install on macOS / Linux, the following command edits Claude Desktop's config in place using jq (after you have cloned the repo and cd-ed into it):
JL_DIR="$(pwd)"
CONFIG="$HOME/Library/Application Support/Claude/claude_desktop_config.json"
mkdir -p "$(dirname "$CONFIG")"
[ -f "$CONFIG" ] || echo '{"mcpServers":{}}' > "$CONFIG"
jq --arg cmd node --arg arg "$JL_DIR/scripts/mcp_server.mjs" --arg key "${TRONGRID_API_KEY:?set TRONGRID_API_KEY first}" \
'.mcpServers.justlend = {command:$cmd, args:[$arg], env:{TRONGRID_API_KEY:$key}}' \
"$CONFIG" > "$CONFIG.tmp" && mv "$CONFIG.tmp" "$CONFIG"
Claude Desktop¶
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"justlend": {
"command": "node",
"args": ["/ABSOLUTE_PATH_TO/justlend-skills/scripts/mcp_server.mjs"],
"env": {
"TRONGRID_API_KEY": "your_key"
}
}
}
}
Cursor¶
Add to .cursor/mcp.json:
{
"mcpServers": {
"justlend": {
"command": "node",
"args": ["/ABSOLUTE_PATH_TO/justlend-skills/scripts/mcp_server.mjs"],
"env": {
"TRONGRID_API_KEY": "your_key"
}
}
}
}
Claude Code¶
Add to .claude/settings.local.json:
{
"mcpServers": {
"justlend": {
"command": "node",
"args": ["/ABSOLUTE_PATH_TO/justlend-skills/scripts/mcp_server.mjs"],
"env": {
"TRONGRID_API_KEY": "your_key"
}
}
}
}
Codex CLI¶
git clone https://github.com/justlend/justlend-skills ~/.codex/justlend-skills
cd ~/.codex/justlend-skills && bash install.sh
mkdir -p ~/.agents/skills
ln -s ~/.codex/justlend-skills/skills ~/.agents/skills/justlend-skills
Usage¶
MCP Server Mode¶
For AI agent integrations (Claude Desktop, Cursor, Claude Code, etc.):
npm start
The server communicates over stdio and exposes 9 read-only MCP tools.
CLI Tool Mode¶
For quick checks directly from the terminal:
node scripts/justlend_api.mjs markets # List all markets with APY
node scripts/justlend_api.mjs dashboard # Protocol dashboard (TVL, users)
node scripts/justlend_api.mjs supported-markets # List supported markets & addresses
node scripts/justlend_api.mjs balance <addr> # Check TRX balance
node scripts/justlend_api.mjs balance <addr> USDT # Check token balance
node scripts/justlend_api.mjs account <addr> # Account health status
node scripts/justlend_api.mjs account-api <addr> # Full account data from API
node scripts/justlend_api.mjs jtoken-details <jtoken> # Detailed jToken info
node scripts/justlend_api.mjs allowance <addr> USDT # Check TRC20 approval
Skills Reference¶
JustLend Lending (justlend-lending-v1)¶
Core lending skill providing market queries, account analysis, and health factor monitoring workflows.
Workflow Rules:
- Always check before advising — use
get_all_marketsfor APYs,get_account_summaryfor health factor, andget_trx_balance/get_token_balanceto verify balances - TRC20 approval awareness — use
check_allowanceto check approval status before recommending supply or repay operations - Risk assessment — call
get_account_summaryto evaluate liquidation risk; warn ifshortfallUSD > 0
sTRX Staking (justlend-trx-staking)¶
Liquid staking skill for TRX. Stake TRX to receive sTRX tokens that earn staking rewards automatically while remaining usable in DeFi.
Note
This skill requires the full MCP server for tool execution.
How it works: Deposit TRX → receive sTRX → rewards accrue via exchange rate appreciation → unstake with ~14 day unbonding period.
Energy Rental (justlend-energy-rental)¶
Rent TRON Energy from the JustLend marketplace at 50-80% lower cost than burning TRX for transaction fees.
Note
This skill requires the full MCP server for tool execution.
DAO Governance (justlend-governance-v1)¶
Participate in JustLend DAO governance proposals. Deposit JST for voting power (1 JST = 1 Vote), cast votes, and reclaim votes after proposals end.
Note
This skill requires the full MCP server for tool execution.
Voting Workflow:
get_proposal_list— find active proposalsget_vote_info— check available voting power- If no votes:
approve_jst_for_voting→deposit_jst_for_votes cast_vote— vote FOR or AGAINST- After proposal ends:
withdraw_votes_from_proposal→withdraw_votes_to_jst
MCP Tools Reference¶
Tools (9 total, all read-only)¶
| Tool | Inputs | Description |
|---|---|---|
get_all_markets |
— | All markets with supply/borrow APY, mining rewards, and TVL |
get_dashboard |
— | Protocol overview: total supply, borrow, TVL, user count |
get_supported_markets |
— | List all supported markets with jToken/underlying addresses |
get_jtoken_details |
jtokenAddr |
Detailed jToken info: interest rate model, reserves, mining rewards |
get_account_summary |
address |
Health factor, liquidity, liquidation risk |
get_account_data_from_api |
address |
Comprehensive account data from API (positions, rewards) |
get_trx_balance |
address |
Native TRX balance |
get_token_balance |
address, token |
TRC20 token balance (USDT, USDD, etc.) |
check_allowance |
address, asset |
Check TRC20 approval status for JustLend contracts |
Security¶
- Read-Only: All tools use read-only contract calls (
triggerConstantContract) or HTTP API queries. No transaction signing or state modifications. - API Key Only: Only requires a TronGrid API key for blockchain read access. No wallet or private key needed.
- Test First: Use Nile testnet (
NETWORK=nile) to verify queries before mainnet.
Example Conversations¶
"What are the best supply rates on JustLend?"
→ AI calls get_all_markets, sorts by supply APY (includes mining rewards), presents ranking
"Show me the JustLend protocol stats"
→ AI calls get_dashboard, displays total TVL, supply/borrow volume, user count
"Check if my position is safe"
→ AI calls get_account_summary, analyzes health factor, warns if shortfallUSD > 0
"Check my full position with mining rewards"
→ AI calls get_account_data_from_api for comprehensive position details including rewards
"What is the TRX balance of address TXxx...?"
→ AI calls get_trx_balance, returns balance
"How much USDT do I have?"
→ AI calls get_token_balance with token=USDT, returns balance
"Show me detailed info for the jUSDT market"
→ AI calls get_jtoken_details, returns interest rate model, reserves, utilization, mining rewards
"What markets have mining rewards?"
→ AI calls get_all_markets, filters by miningAPY > 0, presents markets with active rewards
Troubleshooting¶
TronGrid API Errors¶
Verify your TRONGRID_API_KEY is valid and not rate-limited. Get a key from trongrid.io.
Invalid Address¶
Ensure the address is a valid TRON base58 address (starts with T, 34 characters).