Portal Foundation

PORTAL MCP

MCP server for smart contract generation, compilation, and deployment via Claude.
Portal MCP

PortalMCP

What It Is

PortalMCP is a Model Context Protocol server that exposes smart contract tooling to Claude and other LLMs. Users describe what they want in natural language. Claude calls MCP endpoints to generate Solidity, compile it, and prepare deployment transactions. The user signs with their own wallet.

No private keys are stored or transmitted. All contract interactions require explicit user signature.


The Problem

Smart contract development requires:

  • Solidity proficiency
  • Familiarity with compilation toolchains (Hardhat, Foundry)
  • Understanding of deployment scripts and gas estimation
  • Manual transaction construction

Most users cannot deploy a token or NFT collection without significant technical setup.


The Solution

PortalMCP abstracts the development stack into MCP tool calls:

  1. User prompts Claude: "Deploy an ERC-20 token called TestToken with 1M supply"
  2. Claude calls eth_generate_contract to produce Solidity
  3. Claude calls eth_compile_contract to get ABI and bytecode
  4. Claude calls eth_deploy_contract to prepare the deployment transaction
  5. User signs the transaction in their wallet
  6. Contract is deployed

The same flow works for NFT collections, staking contracts, and custom Solidity.


Available Tools

Contract Pipeline | Tool | Function | |------|----------| | eth_generate_contract | Generate Solidity from specification | | eth_compile_contract | Compile to ABI + bytecode | | eth_deploy_contract | Prepare deployment transaction | | eth_call_contract | Read contract state | | eth_send_transaction | Prepare write transaction |

Token Operations | Tool | Function | |------|----------| | eth_create_token | Generate ERC-20 contract | | eth_get_token_balance | Query token balance | | eth_transfer_token | Prepare transfer transaction |

NFT Operations | Tool | Function | |------|----------| | eth_create_nft_collection | Generate ERC-721 contract | | eth_mint_nft | Prepare mint transaction | | eth_get_nft_owner | Query NFT ownership |

DeFi Operations | Tool | Function | |------|----------| | eth_create_staking_contract | Generate staking contract | | eth_stake_tokens | Prepare stake transaction | | eth_swap_tokens | Prepare swap via DEX |

Frontend | Tool | Function | |------|----------| | generate_frontend | Create React UI for contract | | deploy_dapp | Deploy frontend to hosting |


Security Model

PortalMCP is a tool server. It does not:

  • Store private keys
  • Sign transactions
  • Hold custody of assets
  • Execute transactions without user approval

All transactions are prepared and returned to the user for signing. Pre-signature simulation runs before any state-changing call.


Supported Networks

  • Ethereum Mainnet
  • Sepolia Testnet
  • Base
  • Arbitrum
  • Optimism
  • Polygon

Network selection via --network flag at server startup.


Development Status

MilestoneTargetStatus
Core tooling (ERC-20, NFT)Q2 2025Complete
Frontend generatorQ3 2025Complete
Agent autonomy and loopingQ3 2025Planned
dApp templatesQ4 2025Planned
Multi-agent coordinationQ1 2026Planned

Technology Stack

  • FastAPI + Node.js for MCP endpoints
  • Solidity compilation via Foundry
  • Ethers.js for transaction preparation
  • Claude API for natural language processing

Installation

Requirements

  • Node.js v16+
  • Ethereum wallet
  • Claude API access

Setup

git clone https://github.com/portal-foundation/portalmcp.git
cd portalmcp
npm install
cp .env.example .env
# Add ANTHROPIC_API_KEY and INFURA_API_KEY to .env
npm run build
npm start

Claude Configuration

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "portalmcp": {
      "command": "node",
      "args": ["path/to/portalmcp/dist/index.js", "--network", "sepolia"]
    }
  }
}