MCP Sourcify Server
Verify and retrieve smart contract source code using the Sourcify API.
MCP Sourcify Server
A Model Context Protocol (MCP) server that provides tools for interacting with the Sourcify API to verify and retrieve smart contract source code.
Overview
This MCP server enables LLMs to interact with Sourcify, a decentralized repository of verified smart contract source code. It provides tools to check contract verification status, retrieve source code, and access contract metadata across multiple blockchain networks.
Features
- Check Contract Verification: Verify if a contract is registered on Sourcify
- Get Contract Source: Retrieve the complete source code of verified contracts
- Get Contract Metadata: Access compiler settings and ABI information
- Batch Verification: Check multiple contracts in a single request
Installation
# Clone the repository
git clone <repository-url>
cd mcp-sourcify
# Install dependencies
npm install
# Build the project
npm run build
Configuration
The server can be configured using environment variables:
SOURCIFY_API_URL: The Sourcify API endpoint (default:https://sourcify.dev/server)PORT: Server port (default: 3000) - Note: This is not used in stdio mode
Usage
With Claude Desktop
Add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"sourcify": {
"command": "node",
"args": ["/path/to/mcp-sourcify/dist/index.js"]
}
}
}
With VS Code
Install the MCP extension for VS Code and add the server configuration to your workspace settings.
Direct Usage (Development)
# Run in development mode
npm run dev
# Or run the built version
npm start
Available Tools
1. check-contract
Check if a contract is verified on Sourcify.
Parameters:
chainId(number): The blockchain chain IDaddress(string): The contract address to check
Returns: Verification status (perfect, partial, or false)
2. get-contract-source
Retrieve the source code of a verified contract.
Parameters:
chainId(number): The blockchain chain IDaddress(string): The contract address
Returns: Object with file names as keys and source code as values
3. get-contract-metadata
Get the metadata of a verified contract including compiler settings and ABI.
Parameters:
chainId(number): The blockchain chain IDaddress(string): The contract address
Returns: Contract metadata including compiler version, ABI, and settings
4. check-multiple-contracts
Check verification status for multiple contracts at once.
Parameters:
chainId(number): The blockchain chain IDaddresses(array): Array of contract addresses to check
Returns: Array of verification statuses
Example Usage
Once configured, you can use natural language to interact with Sourcify through your MCP-enabled client:
"Check if contract 0x1234... on Ethereum mainnet (chain 1) is verified on Sourcify"
"Get the source code for contract 0x5678... on Polygon (chain 137)"
"Show me the ABI for contract 0xabcd... on Arbitrum (chain 42161)"
Supported Networks
This server supports all networks that are supported by Sourcify. Common chain IDs include:
- Ethereum Mainnet: 1
- Goerli: 5
- Polygon: 137
- Arbitrum: 42161
- Optimism: 10
- BSC: 56
For a complete list, visit Sourcify's supported chains.
Development
# Watch mode for development
npm run watch
# Build the project
npm run build
# Run type checking
tsc --noEmit
Error Handling
The server includes comprehensive error handling for:
- Invalid contract addresses
- Unsupported chain IDs
- Network timeouts
- Contracts not found in Sourcify
License
ISC
Contributing
Contributions are welcome! Please submit pull requests or open issues for any improvements or bug fixes.
เซิร์ฟเวอร์ที่เกี่ยวข้อง
Scout Monitoring MCP
ผู้สนับสนุนPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
ผู้สนับสนุนAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
MCP Framework
A TypeScript framework for building Model Context Protocol (MCP) servers.
MCP AI Agent Server
A server that bridges Cline to an AI agent system, enabling seamless interaction with AI agents through the Model Context Protocol.
Authless Remote MCP Server
An authless remote MCP server designed for deployment on Cloudflare Workers. It can be set up locally using npm create.
PowerShell MCP Server
Automate Windows PowerShell tasks using Python. Execute scripts, manage the clipboard, and capture terminal output programmatically.
MCP Servers for CS Experimentation Workshop
A collection of MCP servers designed for rapid prototyping in CS experimentation workshops.
Android ADB Server
Control Android devices using the Android Debug Bridge (ADB).
MCP-Slicer
Integrates 3D Slicer with model clients via MCP, allowing natural language control for medical image processing and scene manipulation.
Package README Core MCP Server
Automatically detects package managers and routes requests to appropriate MCP servers for unified package documentation access.
Webhook Tester MCP Server
Interact with webhook-test.com to automate and manage webhook tokens, inspect incoming requests, and perform analytics.
Dart MCP
An example MCP server built with Dart and deployed on Cloudflare Workers.