near-liquid-staking
Provides tools for managing liquid staking on Linear Protocol (LiNEAR), including staking, unstaking, withdrawing, and querying staking positions and pool statistics.
Allows interaction with the NEAR blockchain for liquid staking operations, including staking NEAR, unstaking liquid tokens, withdrawing after unbonding, querying staking info, pool statistics, and validators.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@near-liquid-staking check my staking balance on Meta Pool"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP NEAR Liquid Staking Server
A Model Context Protocol (MCP) server for interacting with liquid staking protocols on NEAR blockchain. Supports Meta Pool (stNEAR) and Linear Protocol (LiNEAR).
Features
stake_near - Stake NEAR tokens to receive liquid staking tokens (stNEAR or LiNEAR)
unstake - Request unstaking of liquid tokens (starts the unbonding period)
withdraw - Withdraw NEAR after the unstaking period completes
get_staking_info - Query a user's staking position, balances, and pending withdrawals
get_pool_stats - Get pool statistics including APY, TVL, exchange rate, and fees
list_validators - List validators used by each staking pool
Related MCP server: NEAR Liquid Staking
Supported Protocols
Protocol | Contract | Token | Typical APY |
Meta Pool |
| stNEAR | ~9-10% |
Linear |
| LiNEAR | ~10% |
Installation
npm install
npm run buildUsage
As MCP Server
Start the server:
npm start
# or
node dist/index.jsThe server communicates over stdio using the MCP protocol.
MCP Configuration
Add to your MCP client configuration:
{
"mcpServers": {
"near-liquid-staking": {
"command": "node",
"args": ["/path/to/mcp-near-liquid-staking/dist/index.js"]
}
}
}Tools
stake_near
Stake NEAR tokens on Meta Pool or Linear.
{
"protocol": "meta-pool",
"amount": "100",
"accountId": "your-account.near"
}Returns transaction data ready for signing. Estimated liquid tokens to receive are calculated based on current exchange rate.
unstake
Request unstaking. Initiates the unbonding period (~48 hours / 4 epochs).
{
"protocol": "linear",
"amount": "50",
"accountId": "your-account.near"
}withdraw
Withdraw NEAR after the unstaking period completes.
{
"protocol": "meta-pool",
"accountId": "your-account.near"
}get_staking_info
Get user's complete staking position.
{
"protocol": "meta-pool",
"accountId": "your-account.near"
}Response includes:
stakedBalance- Total NEAR equivalent stakedliquidTokenBalance- stNEAR/LiNEAR balancependingWithdrawal- Amount in unbondingwithdrawableBalance- Ready to withdrawepochsUntilWithdrawable- Epochs remaining until withdrawal
get_pool_stats
Get pool statistics and current rates.
{
"protocol": "linear"
}Response includes:
totalStaked- Total NEAR staked in poolexchangeRate- Current NEAR per liquid token rateapy- Annual percentage yieldtvlNear- Total value lockedfee- Protocol fee percentagevalidatorCount- Number of validators
list_validators
List validators used by the staking pool.
{
"protocol": "meta-pool"
}Development
# Install dependencies
npm install
# Run in development mode
npm run dev
# Run tests
npm test
# Build
npm run buildTesting
npm testTests cover:
Pool stats retrieval for both protocols
Staking info queries
Stake/unstake/withdraw transaction preparation
Validator listing
Edge cases (small/large amounts)
Architecture
src/
├── index.ts # MCP server entry point with tool handlers
└── near-client.ts # NEAR RPC client for staking operationsThe server uses:
@modelcontextprotocol/sdk- MCP server implementationnear-api-js- NEAR blockchain interactionzod- Input validation
Notes
Transaction Signing: This server prepares transaction data but does not sign transactions. The consuming application must handle wallet integration and signing.
RPC Endpoints: Uses public NEAR RPC endpoints. For production, consider using a dedicated RPC provider.
Exchange Rates: Liquid token amounts are calculated based on current exchange rates which may vary slightly at execution time.
License
MIT
Available Tools
6 toolsget_pool_statsA
Get pool statistics including APY, TVL, total staked, and fees
Inputs: protocol (required).
get_staking_infoA
Get user's staking position including staked amount, rewards, and pending withdrawals
Inputs: protocol (required), accountId (required).
list_validatorsB
List validators used by the staking pool
Inputs: protocol (required).
stake_nearA
Stake NEAR tokens on Meta Pool or Linear to receive liquid staking tokens (stNEAR or LiNEAR)
Inputs: amount (required), protocol (required), accountId (required).
unstakeA
Request unstaking of liquid staking tokens. Initiates the unstaking process which has a waiting period.
Inputs: amount (required), protocol (required), accountId (required).
withdrawA
Withdraw NEAR after the unstaking period is complete
Inputs: protocol (required), accountId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool addresses a distinct action or query: staking, initiating unstake, withdrawing, viewing user info, viewing pool stats, and listing validators. No two tools overlap in purpose.
Most tools follow a verb_noun pattern (stake_near, get_staking_info, get_pool_stats, list_validators). Two are single verbs (unstake, withdraw) but remain clear and consistent with the action-oriented style.
Six tools cover the essential liquid staking workflow without redundancy or bloat, fitting well within the expected 3-15 range.
The set covers the full staking lifecycle (stake, unstake, withdraw) plus necessary informational queries (user staking info, pool stats, validators). No critical gaps for the domain.
Maintenance
Related MCP Connectors
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
MCP server for Renzo protocol data, including chains, vaults, operators, and ezETH metrics.
Hosted MCP server for live Bittensor chain reads and self-custodial on-chain writes.
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Related MCP Servers
- AlicenseAqualityCmaintenanceA simple MCP server for interacting with Marinade Finance on Solana, providing real-time updates and secure transactions.2MIT
- AlicenseAqualityDmaintenanceMCP server enabling Claude to interact with NEAR liquid staking protocols Meta Pool (stNEAR) and Linear Protocol (LiNEAR) for balance checks, exchange rates, staking, unstaking, and DeFi integrations.7MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that gives any AI agent full access to Lido Finance's staking infrastructure through natural language. Stake ETH, manage positions, request withdrawals, and monitor protocol stats.-
- AlicenseBqualityDmaintenanceAn MCP server that enables Claude and other AI assistants to interact with NEAR Protocol wallets and blockchain data.13MIT