NEAR Liquid Staking
# MCP Server: NEAR Liquid Staking
An MCP (Model Context Protocol) server that enables Claude to interact with NEAR liquid staking protocols - Meta Pool (stNEAR) and Linear Protocol (LiNEAR).
## Features
- **Compare LST Providers** - Side-by-side comparison of Meta Pool vs Linear Protocol
- **Balance Checking** - Query stNEAR/LiNEAR balances for any account
- **Exchange Rates** - Real-time LST to NEAR conversion rates
- **Staking Transactions** - Generate transactions to stake NEAR for LSTs
- **Unstaking** - Both instant and delayed unstaking options
- **DeFi Integration** - Find yield opportunities for LSTs
- **APY Tracking** - Estimated staking rewards
## Supported Protocols
| Protocol | Token | Contract | Features |
|----------|-------|----------|----------|
| Meta Pool | stNEAR | meta-pool.near | Instant unstake, META governance, largest TVL |
| Linear | LiNEAR | linear-protocol.near | Auto-compounding, decentralized validators |
## Installation
```bash
npm install
npm run build
```
## Usage with Claude Desktop
Add to your `claude_desktop_config.json`:
```json
{
"mcpServers": {
"near-liquid-staking": {
"command": "node",
"args": ["/path/to/mcp-near-staking/dist/index.js"]
}
}
}
```
## Available Tools
### `compare_lst_providers`
Compare APY, rates, and features across liquid staking providers.
```json
{ "network": "mainnet" }
```
### `get_lst_balance`
Check LST token balances for an account.
```json
{
"account_id": "user.near",
"protocol": "all",
"network": "mainnet"
}
```
### `lst_to_near_rate`
Get current exchange rates.
```json
{
"protocol": "all",
"amount": "100",
"network": "mainnet"
}
```
### `stake_for_lst`
Generate a staking transaction.
```json
{
"protocol": "meta-pool",
"amount": "10",
"network": "mainnet"
}
```
### `unstake_lst`
Generate an unstaking transaction.
```json
{
"protocol": "meta-pool",
"amount": "10",
"instant": false,
"network": "mainnet"
}
```
### `lst_defi_options`
Find DeFi opportunities for LST tokens.
```json
{
"lst_token": "stNEAR",
"network": "mainnet"
}
```
### `get_staking_apy`
Get estimated staking APY.
```json
{
"protocol": "all",
"network": "mainnet"
}
```
## Example Conversations
**User:** "Compare liquid staking options on NEAR"
**Claude:** Uses `compare_lst_providers` to show Meta Pool vs Linear comparison
**User:** "How much is my stNEAR worth?"
**Claude:** Uses `get_lst_balance` and `lst_to_near_rate` to calculate value
**User:** "I want to stake 100 NEAR with Meta Pool"
**Claude:** Uses `stake_for_lst` to generate transaction details
**User:** "What can I do with my LiNEAR tokens?"
**Claude:** Uses `lst_defi_options` to suggest yield strategies
## DeFi Integrations
The server knows about these protocols that accept LSTs:
- **Ref Finance** - Swapping and LP farming
- **Burrow** - Lending and borrowing
- **Pembrock Finance** - Leveraged yield farming
## Development
```bash
# Install dependencies
npm install
# Build
npm run build
# Run directly
npm start
# Development mode
npm run dev
```
## License
MIT
TDQS
Scored across 7 tools
Most tools are clearly distinct by action (stake, unstake, balance, rate, DeFi), but compare_lst_providers overlaps somewhat with get_staking_apy and lst_to_near_rate since it also surfaces APY and rates. Descriptions are clear enough that an agent can usually pick correctly.
All names use lowercase snake_case and share the lst/staking vocabulary, with clear action verbs like get, stake, unstake. A few names (lst_to_near_rate, lst_defi_options) omit a leading verb, but the pattern is still predictable.
Seven tools is well-scoped for a liquid staking server: discovery, balances, rates, staking, unstaking, and DeFi opportunities all have a dedicated tool. No tool feels redundant enough to remove.
The set covers the full user journey for NEAR liquid staking: choosing a provider, checking APY/rates, staking, monitoring balances, unstaking (delayed/instant), and exploring DeFi yield. There are no obvious dead ends or missing lifecycle steps.