API & MCP
Everything a person can do on Smart Contract Relationship Graph, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://smartcontractrelationshipgraph.usefulweb.site/api/v1/calculate– run Smart Contract Relationship GraphGET https://smartcontractrelationshipgraph.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Smart Contract Relationship Graph
Draws the relationships around one address: proxy → implementation (and beacon), who can upgrade it (ProxyAdmin, Safe, timelock, EOA), owner() and admin(), who deployed it and whether that deployer is itself a contract (a factory), which token standards it implements (ERC-20 / ERC-721 / ERC-1155), plus any related addresses you add. Paste runtime bytecode and a relationship list for an offline graph.
| Field | Type | Default | Description |
|---|---|---|---|
mode | select (lookup, bytecode) | "lookup" | What do you have? |
chain | select (ethereum, base, arbitrum, optimism, polygon, avalanche, bsc) | "ethereum" | Chain |
address | text | — | Contract address |
related | list | — | Related addresses (optional). One per line: "0x… label", e.g. a token it holds, a contract it calls or a known multisig. |
bytecode | textarea | — | Runtime bytecode (offline) |
relationships | textarea | — | Relationship list (offline). One per line: "A -> B : label" — A/B are addresses or names; use "this" for the analysed contract. |
Example request
Token behind a minimal proxy, with known relationships (offline)
curl -X POST https://smartcontractrelationshipgraph.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"mode":"bytecode","chain":"ethereum","bytecode":"0x363d3d373d3d3d363d730123456789abcdef0123456789abcdef012345675af43d82803e903d91602b57fd5bf3","relationships":"this -> 0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed : owned by\n0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359 -> this : deployed\nthis -> 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 : holds USDC\n0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed -> Treasury Safe : member of"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://smartcontractrelationshipgraph.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
smart_contract_relationship_graph - Local stdio connector:
node src/mcp-stdio.ts --tool=smart-contract-relationship-graph
{
"mcpServers": {
"smart-contract-relationship-graph": { "type": "http", "url": "https://smartcontractrelationshipgraph.usefulweb.site/mcp" }
}
}