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 "Install 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-stakingcheck 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
| Name | Required | Description | Default |
|---|---|---|---|
| protocol | Yes | Protocol to query |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries the full burden. It transparently discloses the specific data points returned (APY, TVL, total staked, fees), making the tool's behavior predictable. Though it does not explicitly state that it is read-only or mention rate limits, 'Get' strongly implies no side effects and the metric list is sufficient for this simple getter.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no filler, directly stating the action and key return metrics. It is front-loaded and every word contributes value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-parameter tool with a well-documented schema and no output schema, the description covers the core purpose and return data. It could explicitly differentiate from get_staking_info, but the distinction is largely implied by 'pool statistics' vs. personal staking info, making the description complete enough for the tool's simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already fully documents the single parameter 'protocol' with an enum and description 'Protocol to query'. The description adds no parameter-specific details, so it remains at the baseline expected for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the specific verb 'Get' and identifies the resource 'pool statistics' with concrete metrics (APY, TVL, total staked, fees). This clearly distinguishes it from sibling staking actions like stake_near/unstake and from get_staking_info, which likely covers personal staking details.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide explicit when-to-use or comparison with alternatives. It implies usage for retrieving protocol-level pool metrics, but doesn't mention when to choose this over get_staking_info, so usage guidance is only implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_staking_infoA
Get user's staking position including staked amount, rewards, and pending withdrawals
| Name | Required | Description | Default |
|---|---|---|---|
| protocol | Yes | Protocol to query | |
| accountId | Yes | NEAR account ID to check |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full burden of disclosing behavior. It indicates the output content (staked amount, rewards, pending withdrawals), which implies a read-only operation, but it does not explicitly mention safety, permissions, or potential errors. This is adequate but lacks depth.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that immediately conveys the tool's purpose. It contains no extraneous text and efficiently lists the key return items. Excellent conciseness and structure.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simplicity of the tool, the description covers its purpose and the main return values (staked amount, rewards, pending withdrawals). While there is no output schema, the description provides enough context for an agent to understand what to expect. It could mention edge cases, but overall it is fairly complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already provides clear descriptions for both parameters (protocol enum, accountId). The tool description does not add additional meaning to the parameters themselves, so the schema is sufficient. Baseline of 3 is appropriate since schema coverage is 100%.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool gets the user's staking position, listing the specific data points (staked amount, rewards, pending withdrawals). This verb-resource pairing is precise and distinguishes it from sibling tools like stake_near, unstake, and withdraw, which perform actions rather than queries.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies this tool is for checking staking status, as opposed to performing staking actions, but it does not explicitly state when to use it or when to prefer a sibling like get_pool_stats. There is no mention of exclusions or alternatives, so the guidance is only implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_validatorsB
List validators used by the staking pool
| Name | Required | Description | Default |
|---|---|---|---|
| protocol | Yes | Protocol to query validators for |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It states 'List validators' but does not explicitly indicate read-only behavior, response format, or any side effects. The description adds minimal context beyond the tool name.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence with no redundancy. It communicates the core purpose efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple with one parameter and no output schema, so the description is reasonably complete for listing validators. However, it lacks explicit read-only indication or any note about what the returned list contains, which would be expected given the absence of annotations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the parameter 'protocol' has a clear description and enum. The tool description adds no extra meaning beyond the schema, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists validators used by the staking pool, with a specific verb and resource. It is distinguishable from siblings like stake_near and unstake, but overlaps somewhat with get_staking_info and get_pool_stats without explicitly differentiating the exact scope (e.g., protocol-specific).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description does not mention the protocol parameter or distinguish it from sibling info-gathering tools like get_staking_info or get_pool_stats.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stake_nearA
Stake NEAR tokens on Meta Pool or Linear to receive liquid staking tokens (stNEAR or LiNEAR)
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount of NEAR to stake (in NEAR units) | |
| protocol | Yes | Liquid staking protocol to use | |
| accountId | Yes | NEAR account ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses the immediate outcome (receiving liquid staking tokens) but omits important behavioral details like token transfer, fees, confirmation requirements, or reversibility. This is a thin description for a transactional tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that delivers the core purpose without wasted words. It front-loads the action and outcome immediately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple with fully documented parameters and no output schema. The description covers the essential action and outcome, but lacks context about prerequisites (e.g., funded account), side effects, or return value. It is minimally viable but not rich.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers all parameters (100% coverage). The description adds semantic value by linking 'meta-pool' to stNEAR and 'linear' to LiNEAR, which clarifies the protocol enum. It also reinforces that amount is in NEAR units, beyond a bare schema listing.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific action ('Stake NEAR tokens') with resource context (Meta Pool or Linear) and outcome (receiving stNEAR or LiNEAR). It effectively distinguishes from sibling tools like unstake and withdraw.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context: when you want to stake NEAR to earn liquid staking tokens. Sibling tool names (unstake, withdraw) make the alternative scenarios obvious, though no explicit 'use when not' guidance is given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
unstakeA
Request unstaking of liquid staking tokens. Initiates the unstaking process which has a waiting period.
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount to unstake (in stNEAR/LiNEAR units) | |
| protocol | Yes | Protocol to unstake from | |
| accountId | Yes | NEAR account ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It discloses the waiting period, which is a key consequence, but does not mention that this is a blockchain transaction, its reversibility, or the effect on staked balances. Some disclosure is present but gaps remain.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two concise sentences: the first states the action, the second adds the essential waiting-period consequence. There is no redundancy or unnecessary detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a state-changing staking operation with no output schema, the description covers the core action and waiting period, but lacks information about the transaction result, the follow-up withdraw step, or prerequisites. This leaves some context gaps for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already describes all three parameters (amount, protocol, accountId) with 100% coverage. The description adds no parameter-specific meaning, so it meets the baseline but does not enhance understanding beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: requesting unstaking of liquid staking tokens. It distinguishes itself from staking (stake_near) and withdrawal (withdraw) by explicitly noting it initiates a process with a waiting period, making the purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context that this is the initial unstaking step ('Initiates the unstaking process'), which implies use before withdraw. However, it does not explicitly name alternatives or provide exclusion criteria, so it falls short of a full 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
withdrawA
Withdraw NEAR after the unstaking period is complete
| Name | Required | Description | Default |
|---|---|---|---|
| protocol | Yes | Protocol to withdraw from | |
| accountId | Yes | NEAR account ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It only states the action and timing, without disclosing side effects, prerequisites beyond timing, or failure modes, which is a significant gap for a mutating financial operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with an action verb and no wasted words, effectively front-loaded with the purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is minimal and does not explain return values or prerequisites beyond timing (e.g., that the user must have unstaked previously). With no output schema, more context could be expected for a withdrawal tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% for both parameters, and the tool description adds no additional parameter context. The baseline score of 3 is appropriate since parameters are fully described in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description uses a specific verb 'Withdraw' with a clear resource 'NEAR' and a context condition ('after the unstaking period is complete'), which clearly distinguishes it from sibling tools like stake_near and unstake.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context on when to use the tool ('after the unstaking period is complete') but does not explicitly name alternatives or when not to use it, so it lacks full exclusionary guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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
- FlicenseNot gradedqualityCmaintenanceMCP 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.
- 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.
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables Claude and other AI assistants to interact with NEAR Protocol wallets and blockchain data.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jim-agent/mcp-near-liquid-staking'
If you have feedback or need assistance with the MCP directory API, please join our Discord server