Skip to main content

MCP Server (Local)

Run the Nava MCP server as a local stdio process. Any MCP-compatible client (Claude Desktop, Cursor, etc.) can connect to it.

Run Directly

# Option A: pre-provisioned API key
export NAVA_API_KEY=nava_live_...
export WALLET_ADDRESS=0x...

npx nava-mcp
# Option B: headless wallet bootstrap (no pre-provisioned key)
export NAVA_WALLET_PRIVATE_KEY=0x...
export NAVA_SIWE_DOMAIN=testnet.navalabs.dev
export NAVA_SIWE_URI=https://internal.navalabs.dev/api

npx nava-mcp

For Option B, install viem:

npm install viem

Programmatic Usage

import { NavaClient } from '@navalabs/sdk';
import { createMCPServer } from '@navalabs/sdk/mcp';

const nava = new NavaClient({ apiKey: '...', walletAddress: '0x...' });
const server = createMCPServer(nava);

createMCPServer accepts any object that implements the NavaBackend interface (exported from @navalabs/sdk/mcp). NavaClient satisfies it out of the box. For server-side integrations that call internal services directly instead of going through HTTP, implement NavaBackend with your own backend:

import { createMCPServer, type NavaBackend } from '@navalabs/sdk/mcp';

const backend: NavaBackend = {
async requestVerification(params) { /* call internal service */ },
async checkVerificationStatus(hash) { /* call internal service */ },
getWalletAddress() { return '0x...'; },
};
const server = createMCPServer(backend);

MCP Client Configuration

Add to your MCP client config (e.g. Claude Desktop, Cursor):

{
"mcpServers": {
"nava": {
"command": "npx",
"args": ["nava-mcp"],
"env": {
"NAVA_API_KEY": "nava_live_...",
"WALLET_ADDRESS": "0x..."
}
}
}
}

Or bootstrap from wallet at startup (no pre-provisioned NAVA_API_KEY):

{
"mcpServers": {
"nava": {
"command": "npx",
"args": ["nava-mcp"],
"env": {
"NAVA_WALLET_PRIVATE_KEY": "0x...",
"NAVA_SIWE_DOMAIN": "testnet.navalabs.dev",
"NAVA_SIWE_URI": "https://internal.navalabs.dev/api",
"NAVA_API_KEY_NAME": "agent-session"
}
}
}
}

Exposed Tools

Once connected, the agent has access to four tools:

requestVerification: Submit a transaction for arbiter review.

ParameterTypeRequiredDescription
tostringYesTarget contract or recipient address (0x...)
datastringYesEncoded transaction calldata (hex)
valuestringNoValue in Wei (default "0")
descriptionstringYesHuman-readable description for the arbiter
protocolstringNoProtocol identifier (e.g. "uniswap_v3", "cow", "compound_v2"). Skips arbiter protocol detection.
decodedTxobjectNoPre-decoded transaction fields. Skips arbiter TX normalization.

checkVerificationStatus: Poll for the arbiter’s decision.

ParameterTypeRequiredDescription
requestHashstringYesThe requestHash returned from requestVerification

Returns status (APPROVED, REJECTED, UNDECIDED, PENDING, NONE), arbiter confidence, analysis, and on rejection: executionTrace, failedNodes, and primaryFailure.

requestAndAwaitVerification: Submit a transaction and block until the arbiter reaches a terminal status. Takes the same parameters as requestVerification.

getUserAddress: Returns the wallet address configured for the current session. No parameters.

Environment Variables

VariableRequiredDefaultDescription
NAVA_API_KEYConditionallyNonePre-provisioned Nava API key (direct API-key mode)
WALLET_ADDRESSConditionallyNoneWallet address (required with NAVA_API_KEY)
NAVA_BASE_URLNohttps://internal.navalabs.dev/apiAPI base URL
CHAIN_IDNo11155111Target chain (Sepolia)
NAVA_WALLET_PRIVATE_KEYConditionallyNonePrivate key for local MCP bootstrap mode (requires viem)
NAVA_SIWE_DOMAINNotestnet.navalabs.devSIWE domain for bootstrap mode
NAVA_SIWE_URINoNAVA_BASE_URLSIWE URI for bootstrap mode
NAVA_SIWE_STATEMENTNoSDK default statementSIWE statement override
NAVA_API_KEY_NAMENoserver defaultName for generated API key
NAVA_API_KEY_EXPIRES_ATNono expirationISO timestamp for generated API key expiration