ProofYield MCP
Enables AI agents to discover verifiable DeFi yield opportunities, generate algorithmic portfolio plans, and track cryptographic proof receipts, bridging LLMs with blockchain yield protocols.
README
ProofYield MCP
An Enterprise-Grade Model Context Protocol (MCP) Server for Verifiable DeFi Yield Discovery and Algorithmic Portfolio Planning.
Overview
ProofYield MCP bridges the gap between Large Language Models (LLMs) and decentralized finance by providing AI agents with standardized, secure tools to discover yield opportunities, formulate execution plans, and verify cryptographic proof-of-work receipts. Built on top of the Model Context Protocol (MCP), it acts as a modular middleware pipeline that enables assistants (such as Claude, Cursor, and custom agents) to interact safely with blockchain yield protocols.
Key Features
- Discovery Engine: Query real-time, risk-adjusted yield opportunities across decentralized protocols using standardized MCP tools.
- Algorithmic Planning: Generate multi-step, risk-mitigated DeFi allocation strategies and execution paths tailored to user parameters.
- Cryptographic Receipts & Evidence Tracking: Every discovery and planning action generates auditable proof receipts and evidence logs stored in persistent repositories.
- Hardened Auth & Security Pipeline: Built-in middleware for request validation, authentication, and secure interaction modeling.
- Interactive UI Widgets: Embedded modern frontend components (built with Next.js & React) designed to render rich DeFi dashboards directly inside MCP-client chat interfaces.
- Smart Contract Integration: Includes Solidity smart contracts (e.g.,
MockYieldVault) deployed and tested using Foundry for on-chain verification and simulation.
Architecture & Project Structure
The project is structured into modular layers with clear separation between MCP protocol handling, core business logic, on-chain contracts, and frontend widget rendering:
proofyield-mcp/
├── contracts/ # Solidity smart contracts & Foundry suites
│ ├── MockYieldVault.sol # Mock yield vault for testing & simulation
│ └── test/ # Foundry test cases (.t.sol)
├── deployments/ # Chain deployment artifacts (e.g., Base Sepolia)
├── scripts/ # Automation, deployment, and testing scripts
│ ├── deploy-vault.ps1 # PowerShell script for vault contract deployment
│ ├── dev-browser.mjs # Helper to launch UI widgets in browser dev mode
│ └── live-smoke.mjs # Smoke testing script against live/test environments
├── src/ # Core TypeScript MCP Server Application
│ ├── app.module.ts # Root application module defining DI & bootstrapping
│ ├── index.ts # Application entry point
│ ├── health/ # Health check endpoints and system monitoring
│ ├── modules/ # Domain specific feature modules
│ │ ├── discovery/ # Yield opportunity discovery (Tools, Prompts, Resources)
│ │ ├── planning/ # Strategy planning (Tools, Prompts, Resources)
│ │ └── shared/ # Shared services, schemas, & repositories
│ │ ├── config.service.ts # Environment & configuration management
│ │ ├── evidence.repository.ts # Persistence layer for audit/evidence logs
│ │ ├── receipt.repository.ts # Persistence layer for proof-of-work receipts
│ │ └── schemas.ts # Zod / data validation schemas
│ └── widgets/ # Next.js frontend widgets for MCP UI rendering
│ ├── app/ # Next.js App Router (Dashboard pages & layouts)
│ ├── lib/ # Browser MCP client utilities
│ └── out/ # Static HTML exports for UI embeds
├── tests/ # Integration and security test suites
│ └── core-security.test.mjs # Core auth & security validation tests
├── foundry.toml # Foundry configuration for smart contracts
├── package.json # Node.js dependencies & NPM scripts
└── tsconfig.json # TypeScript compiler configuration
Prerequisites
Ensure your development environment meets the following requirements:
- Node.js: v18.x or v20.x (LTS recommended)
- Package Manager: npm, pnpm, or yarn
- Foundry: Required for smart contract compilation and testing (
forge,cast,anvil) - Git: For version control and submodule management
Getting Started
1. Clone the Repository
git clone https://github.com/your-org/proofyield-mcp.git
cd proofyield-mcp
2. Install Dependencies
Install the root server dependencies as well as the UI widget dependencies:
# Install root MCP server dependencies
npm install
# Install Next.js UI widget dependencies
cd src/widgets && npm install && cd ../..
3. Environment Configuration
Copy the example environment file and configure your local variables:
cp .env.example .env
Open .env and configure your RPC URLs, private keys (for testnets), and MCP server port configurations.
4. Build the Project
Compile the TypeScript server, build the frontend UI widgets, and compile the Foundry smart contracts:
# Build the TypeScript MCP server
npm run build
# Build the Next.js UI Widgets
cd src/widgets && npm run build && cd ../..
# Compile Solidity contracts using Foundry
forge build
Running the Application
Development Mode
Run the MCP server locally with hot-reloading enabled for rapid development:
npm run dev
To test or develop the interactive UI widgets in your browser, launch the widget dev server:
node scripts/dev-browser.mjs
Production Mode
To run the compiled production server:
npm start
MCP Modules & Core Capabilities
The server exposes two primary AI-facing modules via the Model Context Protocol:
1. Discovery Module (/src/modules/discovery)
- Tools (
discovery.tools.ts): Allows agents to query yield vaults, filter by APY/TVL, and assess smart contract risk scores. - Resources (
discovery.resources.ts): Exposes live feeds of verified protocol metrics. - Prompts (
discovery.prompts.ts): Pre-configured system prompts that instruct LLMs on how to analyze yield data objectively without hallucinating APYs.
2. Planning Module (/src/modules/planning)
- Tools (
planning.tools.ts): Provides algorithmic step-by-step route generation for capital allocation (e.g., Bridge → Swap → Stake → Deposit). - Resources (
planning.resources.ts): Access to historical execution strategies and gas optimization models. - Prompts (
planning.prompts.ts): Guides agents in presenting risk-adjusted financial strategies and requesting user confirmation before execution.
3. Shared Evidence & Receipt Repositories
Every action taken by the Discovery and Planning modules is cryptographically recorded:
receipt.repository.ts: Stores verifiable proof-of-work receipts for completed tool calls.evidence.repository.ts: Maintains audit logs and data snapshots used to justify AI recommendations.
Smart Contracts & Blockchain Layer
The /contracts directory contains the on-chain components powering ProofYield:
MockYieldVault.sol: An ERC-4626 compatible mock yield vault used to simulate staking, yield generation, and withdrawal flows on testnets (e.g., Base Sepolia).
Deploying Contracts
Use the provided deployment scripts or Foundry directly:
# Deploy using Foundry (example for Base Sepolia)
forge script contracts/deploy/Deploy.s.sol:Deploy --rpc-url $BASE_SEPOLIA_RPC --broadcast
# Or use the provided automation script
./scripts/deploy-vault.ps1
Testing & Verification
We enforce strict test coverage across smart contracts, server logic, and security pipelines.
Run Smart Contract Tests (Foundry)
Execute the Solidity test suite to verify vault mechanics and math:
forge test -vvv
Run Server & Security Tests
Run the Node.js test suites to validate middleware pipelines, authentication guardrails, and tool execution:
# Run core security and authentication tests
node tests/core-security.test.mjs
# Execute a live smoke test against running endpoints
node scripts/live-smoke.mjs
Agent & IDE Integration
ProofYield MCP includes pre-configured agent skill profiles and configuration rules for major AI coding assistants and environments.
Claude / Cursor / Copilot / Gemini / OpenCode: Check the .agents/, .claude/, .cursor/, and .gemini/ directories for specialized SKILL.md instructions covering:
- auth-security: Best practices and rules for authentication and key management.
- mcp-app-architecture: Guidelines on extending modules and tools.
- middleware-pipeline: How to inject custom interceptors and logging into request lifecycles.
- ui-widgets: Instructions for building and embedding Next.js widgets into chat streams.
To connect this server to your local MCP client (e.g., Claude Desktop), add the following to your claude_desktop_config.json:
{
"mcpServers": {
"proofyield": {
"command": "node",
"args": ["/absolute/path/to/proofyield-mcp/dist/index.js"],
"env": {
"NODE_ENV": "production"
}
}
}
}
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。