Labsco
MCP SERVER

MCP Sourcify Server

by soyrubio

Check whether a deployed contract is verified on Sourcify, then read its source and ABI — across chains, by chain ID.

Chain State, Explorers & Contract Tooling
Summary
The perfect-versus-partial distinction is the answer, not a footnote.

Sourcify returns three states, and the difference between a perfect and a partial match is exactly what you want to know before trusting source code you did not compile — partial means the source matches but the metadata does not line up. Getting that as a discrete value rather than prose is what makes this useful in an automated check. The batch tool is the one to reach for when auditing a set of addresses, since it saves a round trip per contract.

What it is

An MCP server over the Sourcify API, the decentralised repository of verified smart contract source code. It answers the three questions you have about an address on chain: is it verified, what is the source, and what is the ABI.

What you get
  • `check-contract` takes a `chainId` and an `address` and returns the verification status as `perfect`, `partial` or `false`
  • `get-contract-source` returns the full source, as an object keyed by file name
  • `get-contract-metadata` returns the metadata, including compiler version, settings and the ABI
  • `check-multiple-contracts` takes an array of addresses and returns a status for each, for checking a set in one call
  • Every network Sourcify supports, addressed by chain ID — Ethereum mainnet is 1, Polygon 137, Arbitrum 42161, Optimism 10, BSC 56
  • Error handling that distinguishes an invalid address, an unsupported chain, a network timeout and a contract Sourcify simply does not have
Requirements

Node.js. Clone the repository, `npm install` and `npm run build`, then point the client at the built entry point. `SOURCIFY_API_URL` defaults to `https://sourcify.dev/server` and can be changed to a different instance. The package is `mcp-sourcify`, version 1.0.0. No API key is involved.