Docs menu

MCP server

@tenergy/mcp is a Model Context Protocol server over the public API. Your agent prices, quotes and orders energy through it; the server signs with your API key, and the key never reaches the model.

The package is not published to npm yet. Until it is, the lines below are the install you will run on release; the agent quickstart covers the same flow over plain HTTP.

Tools

ToolNeeds a keyWhat it does
get_prices, get_address_resourcesNoPrice table; a receiver’s energy and bandwidth
estimate_transferYesCost of one USDT transfer to a receiver
get_balance, get_deposit_addressesYesPrepaid balance; where to top it up
create_quote, create_orderYes (spending scopes)Pin a price for 120 s; buy it
get_order, list_ordersYesStatus and history

Resources: tenergy://docs/quickstart, tenergy://llms.txt.

Install

Run: npx -y @tenergy/mcp (stdio) or npx -y @tenergy/mcp --http 3333 (streamable HTTP at http://localhost:3333/mcp).

Claude Desktop — claude_desktop_config.json:

{"mcpServers":{"tenergy":{"command":"npx","args":["-y","@tenergy/mcp"],"env":{"TENERGY_API_KEY":"...","TENERGY_API_SECRET":"..."}}}}

Claude Code:

claude mcp add tenergy -e TENERGY_API_KEY=... -e TENERGY_API_SECRET=... -- npx -y @tenergy/mcp

ChatGPT (Settings → Connectors → developer mode → add connector): run npx -y @tenergy/mcp --http 3333 behind a public HTTPS URL and enter https://<your-host>/mcp as the server URL.

Cursor / Antigravity — mcp.json:

{"mcpServers":{"tenergy":{"command":"npx","args":["-y","@tenergy/mcp"],"env":{"TENERGY_API_KEY":"...","TENERGY_API_SECRET":"..."}}}}

Environment

VariableDefaultMeaning
TENERGY_API_URLhttps://api-nile.tenergy.me/v1 (Nile)API base including /v1; set the mainnet host deliberately
TENERGY_API_KEY, TENERGY_API_SECRETunsetYour key pair, used to sign and never sent to the model. Unset: only get_prices and get_address_resources are registered
TENERGY_SITE_URLhttps://tenergy.meDocs host for the resources
TENERGY_MCP_READ_ONLYunset1 removes create_quote and create_order, even with a spending key
TENERGY_MCP_MAX_ORDER_TRX50create_order prices the order first and refuses, without buying, above this total

Safety rules

RuleWhy
The server refuses to start if any env value looks like a raw private key (64 hex chars)It never signs transactions; a wallet key has no business here
create_order requires max_price_sun and client_order_idA price ceiling and an idempotency key on every purchase
Orders above TENERGY_MCP_MAX_ORDER_TRX are refused before any chargeA confused agent cannot drain the balance in one call
Give the key only the scopes the agent needs; there is no default setSee Authentication
Rehearse on Nile firstEnvironments lists what Nile cannot prove

    ↑ ↓ to move · Enter to open · Esc to close