Nolus Docs
Agentic workflows

In-page WebMCP

Browser-resident agent surface on app.nolus.io - wallet-scoped reads, connect, navigate.

The Nolus webapp ships with a WebMCP integration. Tools are registered via navigator.modelContext.registerTool inside the app.nolus.io browser tab, so an agent running alongside the page (a browser extension, an embedded model, Chrome's WebMCP EPP) can inspect the user's live session and drive the UI without going through the HTTP API.

When to use it

Reach for WebMCP when the agent runs in the same browser tab as the dApp and the user wants it to:

  • See what wallet is connected, what balances and positions that wallet holds, and what oracle is reporting right now.
  • Trigger the wallet-connect flow when no wallet is active.
  • Navigate the user to a specific page on the dApp (lease, earn, staking, governance).

For everything else, fall back to the stdio MCP (desktop agents, full trading instrument) or the REST API (general-purpose HTTP).

Scope boundary

WebMCP intentionally does not expose any transaction-signing tool. No open-lease, no deposit, no stake, no vote. Signing stays inside the explicit user-driven UI flow with the wallet popup as the single consent surface. If an agent needs to act on the user's behalf, it hands the intent off to the dApp UI or to the stdio MCP - it never bypasses the wallet popup.

Tools

All tools are wallet-scoped: when a wallet is connected, they auto-bind to it, so there's no address parameter to pass.

ToolWhat it returns / does
get_connected_walletThe currently connected Nolus wallet (bech32 address) and connection status.
get_balancesThe connected wallet's token balances across all supported assets.
get_open_leasesThe connected wallet's open Nolus leases (margin positions) with full lifecycle detail.
get_earn_positionsThe connected wallet's positions in the Nolus earn pools, plus the pool-level state.
get_staking_delegationsNLS staking delegations, unbonding entries, and claimable rewards.
get_pricesCurrent oracle prices for all supported assets, keyed by ticker@protocol.
connect_walletOpens the user's wallet extension to connect. Optional mechanism argument picks the extension (keplr, phantom, solflare, ledger).
navigateRoutes the user to one of the dApp's main pages by route name.

The implementation lives in src/common/webmcp/ in the webapp repo. Each tool is a thin adapter over the dApp's Pinia stores, so calls cost no extra backend hits.

Detecting WebMCP from an agent

The dApp gates tool registration behind a feature detection of navigator.modelContext. A browser without WebMCP support simply doesn't register the tools. From the agent side:

  1. Open https://app.nolus.io/ in the tab where the agent runs.
  2. After page load, the dApp registers the eight tools above through navigator.modelContext.registerTool.
  3. The agent enumerates the registered tool surface and calls into it the same way it would for any other WebMCP-enabled page.

The dApp also publishes its agent card at /.well-known/agent-card.json and an agent-skills index at /.well-known/agent-skills/index.json for autodiscovery alongside WebMCP.

On this page