# MCP — the explorer, for an agent **This is the SourceLess Asgard explorer with a door an AI agent can walk through**, so that an agent answering a question about this chain reads the node's own answer instead of inventing a plausible one. It is a Model Context Protocol server: two tools, both reads, over streamable HTTP. **Every claim on this page is labelled.** `MEASURED` means it was observed by running the thing named, on 2026-10-10, against the endpoint built from this tree. `REASONED` means it is an argument from code that was read. Start it: ``` strblk mcp --demo a synthetic chain, announced as one strblk mcp --dir a real chain, read under a Cerberus lease ``` It binds `127.0.0.1:8085`. `strblk mcp --help` prints every flag. --- ## 1. What it is, in five sentences - **Transport: streamable HTTP, stateless.** One JSON-RPC 2.0 object per `POST`, one JSON object back. No session id is issued and none is honoured. - **Auth: open.** No key is asked for. The bind address is therefore the only boundary there is, which is why it is loopback unless an operator says a sentence about TLS — see §7. - **Read-only.** Two tools, `ping` and `inspect_entity`. No tool on this endpoint can write to the chain, and §6 states that as a property rather than a promise. - **Every reply carries `errors[]`.** Empty on success, never omitted. - **A field this node cannot answer is an explicit marker**, never a guess and never an omission. §4 is about nothing else. Everything is read through `JsonRpcSurface` — `src/core/rpc.ts` — and through nothing else. There is no second chain reader in `src/mcp/`. REASONED: an explorer whose decoding differs from the node's is an explorer showing a chain no node agrees with, and an agent will restate whatever it is given as a fact rather than as a reading. --- ## 2. The two tools ### `ping` Takes nothing. A connectivity check that is also the bootstrap: call it first. It answers which chain is being served — by **genesis hash**, chainId and network key — what height that chain is at, the reply contract, every bound, and the full entity-kind table from §3 including the kinds that are *not* decodable and why. An agent that reads one `ping` reply does not have to guess at anything below. ### `inspect_entity` ```json { "identifier": "STR.sourceless", "kind": "str-domain", "network": "asgard", "chainId": 1313 } ``` Only `identifier` is required. - **`identifier`** — an STR.domain, an address, a 64-hex transaction id, block hash or wNFT id, a decimal block height, or a ledger symbol. At most 256 characters; longer is `WORK_REFUSED` before anything is looked up. - **`kind`** — optional, from the table in §3. Omit it and the string's SHAPE selects the candidates, which are then probed in order; the reply's `probedKinds` says which were tried and `kind` says which answered. **Required for a bare 40-hex id**, because an Oort space id, a STARW machine id and an Occultation thread id are each the first 40 characters of a SHA-256 and the shape cannot separate them. Asked without a `kind`, that case answers `AMBIGUOUS_IDENTIFIER` with the candidates rather than picking one. - **`network`** and **`chainId`** — optional. §5. An unexpected argument is refused rather than ignored: `inputSchema` says `additionalProperties: false` and the tool enforces it, because an ignored argument is one a caller believes they passed. Every `inspect_entity` reply carries the same keys whatever happened to it — `identifier`, `kindAsked`, `kind`, `found`, `probedKinds`, `chain`, `entity`, `ok`, `errors` — so a client never has to test for a key's existence as well as its value. --- ## 3. What is decoded, and what is deliberately not | kind | decodable | in the chain | read through | | --- | --- | --- | --- | | `account` | yes | yes | `balances`, `nonce`, `domainOf`, `accountAuthority` | | `str-domain` | yes | yes | `findDomain`, `wnft`, `organisation` | | `wnft` | yes | yes | `wnft` | | `token-mint` | yes | yes | `collateralReserves`, token definitions | | `program` | yes | yes | `contractCatalog`, `contractStorage`, `contractEvents` | | `transaction` | yes | yes | `transaction`, `transactionProof` | | `block` | yes | yes | `blockByHeight`, `blockByHash` | | `hostless-object` | **no** | **yes** | — | | `str-talk-thread` | **no** | **yes** | — | | `starw-node` | **no** | **yes** | — | | `dex-pool` | **no** | **no** | — | The last four answer `CURRENTLY_UNSUPPORTED`. The error's `detail.presentInChain` is what separates the two reasons a kind can sit there, and the distinction matters: three of them exist and this endpoint cannot reach them, and one does not exist at all. ### `hostless-object` — HostLess DB objects. Present, unreachable. These **are** chain state. `LedgerManager.spaces` is an `OortRegistry` folded into the state root, and its own comment says why: an access rule a node remembers privately is not merely a fork, it is two honest nodes disagreeing about who may read somebody's private data with nothing in either looking wrong. But `JsonRpcSurface` holds nothing hostless — no member for a space, an Oort record or a chunk. REASONED, and not a new finding: `src/network/iris.ts` records the identical gap about its own door and closes it with an injected `IrisHostlessDoor` "satisfied where the node is", stating that widening the in-process surface "belongs to whoever owns `src/core/rpc.ts`". Reaching past the surface here would create exactly the second chain reader this module exists not to be. **What would close it:** a space read on `JsonRpcSurface`. Then this becomes a decoder. ### `str-talk-thread` — Occultation. Present, unreachable. The same gap, and `src/network/iris.ts` names this one in those words: `JsonRpcSurface` holds nothing about Occultation — no inbox key, no thread, no message record. `BlockchainCore` has judged these records all along and `OccultationRegistry` has answered reads all along; neither is reachable through the surface. Note what would *not* be decodable even then: a message body. The chain holds a commitment and the participants' published inbox keys, never a word of plaintext, in either direction. ### `starw-node` — STARW worker-node metadata. Present, unreachable. `src/core/starw-ledger.ts` exists. `StarwLedger` is **not** a member of `LedgerManager`: it is an accounting register for ARSS emission, held by the contract-execution path, outside the chain state root and outside the surface. The nearest read on the surface is `validatorRoll`, and this endpoint **will not substitute it**. The roll answers a different question — who may SEAL a block — and a seat is not a worker node. An agent handed the roll under the name "worker nodes" would report a sealing roster as a compute fleet. ### `dex-pool` — there is no DEX on this chain. Searched across `src`, `contracts`, `runtime`, `consensus`, `spec` and the sixteen `.ares` contract templates: there is no pool, pair, AMM or swap anywhere, and no record kind, ledger or state-root field for one. IgniteHeX is this system's admin and client dashboard, not an exchange. So `presentInChain` is `false` here and `true` on the three above, and that is the whole difference. A pool decoder would make this endpoint the only thing in the system asserting that a market exists, which is worse than returning nothing. ### `ARES` is not a token The spec asks for "token mints (ARSS/ARES)". **ARSS is a ledger on this chain and ARES is not.** ARES is the contract language and the bytecode container — AresLang source compiles to an ARES container which the STARW VM executes. There is no ARES ledger, no ARES supply and no ARES balance. Asked about `ARES`, this endpoint answers `CURRENTLY_UNSUPPORTED` with `presentInChain: false` and says what ARES actually is. The seven ledgers, fixed at genesis: `STR`, `CCOS`, `WSTR`, `ARSS`, `STR_USD`, `WNFT`, `ESTR`. ### `simulateCall` is read-only and is still not here It runs the AresLang VM under a gas ceiling. Iris costs that as `compute` rather than `read`, and one unauthenticated call that buys VM execution would be the bounded-work rule in §8 handed a loophole. --- ## 4. Unknown fields are markers > A field this node cannot answer arrives as `{"unknown": true, "reason": "..."}`. > It is **never** `null`, `0`, `""` or an absent key. Do not infer a value for one. REASONED, from a defect this repository already paid for: `RpcStatus.activeValidators` used to be typed `number`, so the public RPC answered `"activeValidators": 0` over the internet for a figure it could not measure — a confident zero about the validator set. An agent is a worse reader of that than a dashboard is, because it will paraphrase the zero into a sentence. The markers that appear most often, each one a read `JsonRpcSurface` does not have: | field | why it is a marker | | --- | --- | | `account.allocatedStrDomain` | `domainOf` answers for a PROVED name only and `domainHolder` goes the other way, name to holder. There is no reverse read for an allocation, so an address may hold a booked name nothing here can find — and `provedStrDomain: null` therefore does NOT mean "holds no name". | | `program.name`, `.bytecodeHex`, `.deployer`, `.storageRootHex` | the surface exposes `contractCatalog`, `contractStorage` and `contractEvents` for a program and no read of its code or deployment. | | `token-mint.circulatingSupplyMinor` | the surface has no total-issued-supply read. `declaredSupply` is the token definition's POLICY, and `src/core/tokens.ts` records a case where a declared 63,000,000 cap was published by four surfaces and issued by nothing. | | a private wNFT entry's `value` | the chain holds a Lethe commitment and never the payload or the opening. `null` would read as "this entry is empty", which is a different and false statement about somebody's passport number. | | `ping().chain.localValidatorNote` | this process may keep no `ValhallaRegistry` note at all. Not zero validators: no note. | | `transaction.confirmations` | genuinely unknown until the transaction is in a block. `RpcMeasured` is carried through rather than flattened to a number. | `isUnknown()` is exported from `src/mcp` for a TypeScript client. --- ## 5. Networks, not clusters **The spec this endpoint was built to names "clusters" — `mainnet`, `devnet`, `testnet` — borrowed from Solana. This chain has no such concept, and the mapping is made honestly rather than silently.** What it has instead: - a **`chainId`**, recorded per realm in `src/core/snotra.ts`. Asgard's is **1313**. - **named networks**: `dev`, `midgard`, `asgard`, each pinned to a **genesis hash**. - and the rule that decides which of those two is the identity: `src/core/transaction.ts` states that a chain id is self-declared and two networks may carry the same one, so a signature is bound to the genesis hash. **The genesis hash is the identity. The chain id is a label beside it.** So: `network` and `chainId` are optional, and - **omitted** → the chain this server is serving. Not a default choice between realms: this server serves exactly one chain, the one the node it was built over replays. Every reply names it. - **a cluster word** — `mainnet`, `mainnet-beta`, `devnet`, `testnet`, `localnet`, … → refused with `UNKNOWN_NETWORK` and `detail.reason: "solana-cluster-vocabulary"`. Recognised by name so it can be refused by name: a caller who typed `mainnet-beta` has a wrong model of this chain and should be told that `asgard` is the production realm rather than left to infer it. - **a name this build does not know** → `UNKNOWN_NETWORK`, with the list. - **a known name that is not this server's** → `WRONG_NETWORK`, with the served genesis hash. - **a `chainId` that is not the one this node replays** → `CHAIN_ID_MISMATCH`. All of these are refused **before a single lookup**, so a caller who named the wrong realm is never handed a correct-looking answer from this one alongside the complaint. One case deserves its own line. A chain whose genesis hash matches no realm in the register — a business fork, a local development chain, a rehearsal genesis — reports `chain.key` as an **unknown marker** rather than naming one of the three from a self-declared chain id. On such a chain *every* network name is `WRONG_NETWORK`, including `dev`, and omitting the argument is the only way to ask. MEASURED: that is what `tests/helpers/explorer-fixture.ts` produces, and the suite asserts it. --- ## 6. Nothing here can write The endpoint is open and unauthenticated by specification. An open endpoint that could submit a transaction would be a remote-controlled wallet: anybody who can reach the port could move value, claim names, post bonds and raise governance ballots in the operator's name, because the signature on a record covers the RECORD and says nothing about who asked for it to be queued. So read-only here is three separate things, any one of which would have to be defeated: 1. **Two tools, both reads.** `tools/list` publishes exactly `ping` and `inspect_entity`, and an unrecognised name is `MethodNotFound` — never a fall-through. 2. **No reflection.** Nothing in `src/mcp/` looks a method up on the surface by a caller's string. The decoders name the members they call in source, so there is no path from a request body to a method name. 3. **A checked list.** `MCP_CHAIN_WRITE_METHODS` in `src/mcp/tools.ts` names the **twenty** chain-writing members of `JsonRpcSurface` and is asserted against the registered tool names at module load. A server registering one could not start. `MCP_OTHER_EXCLUDED_METHODS` names four more that are absent for a different reason: `registerToken`, `updateParameters` and `updateNetworkEndpoints` mutate the registries this surface answers from — `updateNetworkEndpoints` would let a stranger change the RPC and explorer URLs a client is handed, which is a redirection primitive — and `simulateCall` is excluded on cost. MEASURED, `tests/integration/mcp-endpoint.integration.test.ts`: all twenty-four exist on the surface, none is a tool name, each is refused with 404 both as a `tools/call` name and as a JSON-RPC method name, and the chain's height and mempool are unchanged across the whole suite. The CLI builds a **bare** `JsonRpcSurface` — no announcer — so even a write that reached it would go no further than the serving process. That is a second line and not the first. --- ## 7. Exposure: loopback, or say a sentence about TLS The decision is **Iris's**, called rather than copied: `mcpExposureFor` runs `irisExposureRefusal` from `src/network/iris.ts` unchanged. A second copy of a security decision is a second copy to drift. | you pass | you get | | --- | --- | | nothing | `127.0.0.1:8085`, plaintext, and that is not a compromise: nothing leaves the machine | | `--host ` | **refused**, with the three flags that would allow it | | `--mcp-tls-cert F --mcp-tls-key F` | TLS terminated in this process by `node:https`, floor TLS 1.2 | | `--behind-tls-proxy` | your assertion that a terminator stands in front and nothing else can reach the port. Nothing here checks it | | half a TLS pair | **refused** rather than falling back to plaintext | `isLoopbackHost` fails **closed**: an empty or unresolvable host is treated as not loopback, because an empty host passed to `listen` binds every interface. `createMcpServer` asserts the exposure a second time at the socket, so a public plaintext bind is not reachable by any path. MEASURED: `strblk mcp --host 0.0.0.0` prints the refusal and exits without binding. --- ## 8. Bounded work A stranger must not be able to buy a full-chain fold with one call. Three charges, the first two before a body is allocated: 1. **The length prefix.** `Content-Length` is **required** on a `POST` — not merely used. A body with no declared length can only be charged after it has been received; with the prefix, an unaffordable request costs one header parse and a 411 or 413. The declared length is also enforced: a body that sends more than it declared is refused, because a declaration that is not checked is a hint and not a bound. 2. **The traffic bucket**, charged the declared bytes before they are read. 3. **The expensive-answer bucket**, charged once per `tools/call`, before any decoding. A tool call runs decoders; `admitHandshake` on `RatatoskrRouter` is the class for one fixed allowance per address that closing the connection does not return. Then, inside every decoder, `MCP_BOUNDS`: | bound | value | what it caps | | --- | --- | --- | | `storageRows` | 64 | contract storage rows per reply | | `eventRows` | 32 | retained contract events per reply | | `blockTransactionRows` | 64 | transaction ids per block reply | | `seatRows` | 32 | validator seats per reply | | `entryRows` | 64 | wNFT attribute entries per reply | | `departmentRows` | 32 | organisation departments per reply | | `identifierLength` | 256 | characters in an identifier | | `bodyBytes` | 65536 | bytes a POST may declare | | `callsPerRequest` | 1 | tool calls per HTTP request — a JSON-RPC batch is refused | **Every truncation is reported.** A list cut to its bound goes out beside a `truncated` object carrying the limit and how many rows were omitted, and the `total` is always exact. REASONED: a silently shortened list is one an agent reads as complete and then states as complete. Rate limits are per address, keyed by the socket's remote address and **never by a header** — `x-forwarded-for` is a string a caller writes, so charging it would let one address hold an unbounded number of allowances. 16 tool calls a second with a burst of 128; 32 requests a second with a burst of 256. MEASURED: 8 a second with a burst of 32 was the first attempt and the test suite refused itself with it — forty tool calls in under a second is not an attack, it is what an agent exploring a chain looks like. A refusal is a **WAIT** carrying `retryAfterMs`, never a ban, and nothing records a caller as hostile. A batch is refused rather than looped: the MCP 2025-06-18 revision removed batching, and a batch is a work multiplier on an endpoint whose safety rests on one request buying bounded work. --- ## 9. The reply contract Every tool reply: ```json { "tool": "inspect_entity", "ok": false, "errors": [ { "code": "...", "message": "...", "detail": {} } ] } ``` `ok` is `errors.length === 0`, stated as a field so a client does not have to know the rule. ### The codes | code | means | | --- | --- | | `NOT_FOUND` | the entity does not exist | | `CURRENTLY_UNSUPPORTED` | the kind is recognised and is not decodable yet. `detail.presentInChain` says whether the chain has it at all | | `AMBIGUOUS_IDENTIFIER` | the string is shaped like more than one kind. Pass `kind` | | `UNRECOGNISED_IDENTIFIER` | shaped like nothing this chain holds | | `UNKNOWN_NETWORK` | a network — or a cluster — this chain has no notion of | | `WRONG_NETWORK` | a network this build knows and this server does not serve | | `CHAIN_ID_MISMATCH` | not the chain id this node replays | | `INVALID_ARGUMENT` | the call does not match the tool's schema | | `WORK_REFUSED` | well formed, and larger than one request may buy | ### `isError` is false even when `errors[]` is not empty `isError` on a `tools/call` result means the TOOL failed to run. A `NOT_FOUND` is the tool running correctly and reporting what the chain holds, and marking it as an error would make a client discard the structured reply that contains the answer. A tool that could not run at all is a JSON-RPC error with HTTP 500, not a result. ### One `NOT_FOUND` that must be quoted with its caveat A transaction this node cannot find answers `NOT_FOUND`, and the error carries `detail.phase: "unknown"`, `detail.scanDepthBlocks` and `detail.saysNothingAbout: "whether the transaction happened"` — because the surface scans at most `RPC_TRANSACTION_SCAN_DEPTH` sealed blocks plus the mempool and says, in those words, that `unknown` "says nothing about whether it happened". An integrator that maps it onto failure re-sends a payment that is on its way. MEASURED, and found by the suite failing: `tests/helpers/explorer-fixture.ts` seals 614 blocks and its four transactions are in the first two, so the 512-block window genuinely does not reach them. The endpoint reports them as not found **here**, with the caveat, while the transactions sit in sealed blocks on that very chain. That is the correct answer and it is why the caveat travels with the finding rather than only living on this page. Likewise, an address with nothing credited on any of the seven ledgers, a settled nonce of zero, no proved STR.domain and no key rotation answers `NOT_FOUND` — and says why: this chain creates no account object, so that state is indistinguishable from an address that has never existed. It is still a valid address and may receive. --- ## 10. The JSON-RPC methods this server implements `initialize`, `ping`, `tools/list`, `tools/call`. It declares the `tools` capability and no other, so `resources/*` and `prompts/*` answer `MethodNotFound` rather than an empty list — a client handed an empty resource list would believe it had asked a server that has them. - `initialize` negotiates the protocol version: `2025-06-18`, `2025-03-26` or `2024-11-05` echoed back, anything else answered with `2025-06-18`. In a stateless server it establishes nothing, and no `mcp-session-id` is ever sent. - `ping` at the JSON-RPC level is MCP's transport liveness check and answers `{}`. It is **not** the `ping` tool, which is the one that names the chain. - `GET` and `DELETE` on the endpoint answer **405**: there is no stream to open and no session to delete. - A notification — a request with no `id`, such as `notifications/initialized` — answers **202** with no body. --- ## 11. Verification MEASURED, 2026-10-10, `tests/integration/mcp-endpoint.integration.test.ts` — 53 assertions over a real chain, through a real listening socket: - `initialize`, version negotiation, `tools/list`, a notification. - `ping` over HTTP, naming the chain by genesis hash and carrying `errors: []`. - `inspect_entity` on a settled STR.domain, on its holder's account, on a deployed program, on a block by height and by hash, on a token ledger, on a transaction inside the scan window with its inclusion proof verified against the block's own transaction root. - `NOT_FOUND` for an absent STR.domain, an absent 64-hex id, an absent ledger symbol. - `CURRENTLY_UNSUPPORTED` for `hostless-object`, `starw-node`, `str-talk-thread` and `dex-pool`, with `presentInChain` asserted on each — and for `ARES`. - Every cluster word refused; `WRONG_NETWORK`; `CHAIN_ID_MISMATCH`; and both reported at once when a caller is wrong about both. - All twenty-four excluded surface members proved to exist, proved not to be tool names, and refused with 404 by both routes — with the chain's height and mempool unchanged afterwards. - The transport refusals: 405, 411, 413, batch, bad JSON, unexpected argument, over-long identifier. - The rate limit tripping for one address and not for another, carrying `retryAfterMs`. - Every exposure branch, including the refusal to build a server told to bind a public address as loopback. --- *Created by Alex M Stratulat and the SourceLess team.*