Divvi MCP Server

by divvi-xyz

Not rated
GitHub

About

Automatically integrate the Divvi referral SDK into JavaScript and TypeScript blockchain applications.

Details

Author
divvi-xyz
Categories
Developer Tools, Other

Setup

Install Divvi MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/divvi-xyz/divvi-mcp-server

Follow the installation instructions in the repository README, then restart your MCP client.

A Model Context Protocol (MCP) server that provides AI assistants with tools for working with the Divvi ecosystem. Currently focuses on automatic integration of the@divvi/referral-sdkinto JavaScript/TypeScript blockchain applications, with more Divvi-related functionality planned for future releases.

Integrating referral tracking into blockchain applications typically requires understanding SDK documentation, modifying transaction flows, and maintaining integration code as protocols evolve. This MCP server eliminates that complexity by turning any AI assistant into a Divvi integration expert that can automatically implement referral tracking following current best practices.

Compatible with any JavaScript/TypeScript blockchain application, including:

- Frontend frameworks: React, Next.js, Vue, Angular, Svelte, vanilla JavaScript
- Backend applications: Node.js, Express, Fastify, serverless functions
- Full-stack frameworks: Next.js, Nuxt, SvelteKit, Remix
- Desktop/mobile: Electron, React Native, Ionic
- Any JS/TS appthat makes blockchain transactions

The server currently provides an MCP tool (integrate_divvi_referral_sdk) that:
- πŸ“– Guides AI agentsto read the latest official Divvi SDK documentation
- πŸ” Instructs project analysisto understand the target application structure
- πŸ”§ Provides integration parameters(consumer address and provider campaigns)
- βœ… Ensures proper implementationfollowing official patterns and best practices

⚠️ Prerequisites: Before using this tool, you need to install and configure the MCP server. See theInstallationsection below.

The easiest way to use this is to simply ask your AI assistant:

"Integrate this dapp with Divvi"

Your AI assistant will guide you through providing the necessary configuration (your Divvi dapp address and campaign addresses) and handle the entire integration process.

For more specific control, you can provide the exact parameters:

"Integrate my dapp with Divvi using consumer address 0x1234..."

- Read the latest Divvi SDK documentation
- Analyze your project structure
- Install the SDK if needed
- Modify your blockchain transactions to include referral tracking
- Add referral submission after transactions

To complete the integration, you'll need:

- Consumer Address: Your Divvi dapp wallet address (used to register as a builder on Divvi)

// The AI assistant will call this internally integrate_divvi_referral_sdk({ consumerAddress: '0x1234567890123456789012345678901234567890', })

- Always up-to-date: Instructs AI agents to read documentation directly from the official repository
- Universal compatibility: Works with React, Vue, Angular, Node.js, vanilla JS, and any JavaScript/TypeScript framework
- Blockchain library agnostic: Supports viem, ethers, wagmi, and other Web3 libraries
- Non-prescriptive: Provides guidance while letting AI agents use their own capabilities intelligently
- Future-proof: Instructions adapt as the Divvi SDK evolves
- Extensible: Designed to support additional Divvi ecosystem tools and functionality

Technical Note: This integration is implemented as an MCP "tool" rather than a "prompt" type. While the MCP specification includes a prompt type that would be more semantically appropriate for this use case, we chose the tool implementation for broader compatibility, as Cursor doesn't currently support MCP prompts.

- Node.js 22+
- An MCP-compatible AI assistant (Claude Desktop, Cursor, Copilot, etc.)

The easiest way to use the Divvi MCP server is via npm:

Add to yourclaude_desktop_config.json:

{ "mcpServers": { "divvi-mcp": { "command": "npx", "args": ["-y", "@divvi/mcp-server"], "env": {} } } }

Cursor supports MCP servers through its settings. Add the server configuration:
- Open Cursor Settings (Cmd/Ctrl + ,)
- Navigate to "Features" β†’ "Model Context Protocol"
- Add a new MCP server with:

- Name:divvi-mcp
- Command:npx
- Args:["-y", "@divvi/mcp-server"]

Alternatively, if Cursor uses a configuration file, add:

{ "mcpServers": { "divvi-mcp": { "command": "npx", "args": ["-y", "@divvi/mcp-server"] } } }

Configure according to your MCP client's documentation, using:

- Command:npx
- Args:["-y", "@divvi/mcp-server"]

For development or if you prefer building from source:

git clone https://github.com/divvi-xyz/divvi-mcp.git cd divvi-mcp

Configure your AI assistantto point to the local build:

Usenodeas the command and["/path/to/divvi-mcp/dist/index.js"]as the args in your MCP client configuration.

The tool instructs AI agents to read the official SDK documentation from:https://raw.githubusercontent.com/divvi-xyz/divvi-referral-sdk/refs/heads/main/README.md

This ensures the integration always follows the latest patterns and examples.

AI agents analyze the target project to understand:

- Package manager (npm/yarn)
- JavaScript/TypeScript framework being used
- Blockchain libraries (viem, ethers, wagmi)
- Existing transaction patterns
- Account management approach

Following the official documentation, AI agents implement:

- SDK installation
- Import statements
- Transaction modifications (adding referral tags)
- Referral submission after transactions
- Proper error handling

- All blockchain transactions include referral tracking
- Referral failures don't break existing transaction flows
- Code follows project conventions
- Integration uses the provided addresses correctly

# Start in development mode yarn dev # Run tests yarn test # Type checking yarn typecheck # Linting yarn lint # Format code yarn format
src/ β”œβ”€β”€ index.ts # Main MCP server implementation β”œβ”€β”€ index.test.ts # Unit tests └── ... scripts/ # Build and utility scripts dist/ # Compiled output

- Fork the repository
- Create a feature branch:git checkout -b feature/my-feature
- Make your changes following the existing code style
- Add tests for new functionality
- Run the test suite:yarn test
- Submit a pull request

Provides instructions for integrating the @divvi/referral-sdk into a project.

Comprehensive integration instructions that guide AI agents through:

- Reading official documentation
- Analyzing project structure
- Implementing the integration
- Validating the result

Additional tools for the Divvi ecosystem are planned for future releases. These may include:

- Data integration: Helpers for tracking referral performance and metrics
- Protocol interaction: Direct interaction with Divvi protocol contracts
- Campaign management: Tools for creating and managing referral campaigns

Stay tuned for updates as we expand the server's capabilities!

- @divvi/referral-sdk: The core TypeScript SDK for Divvi integration
-
Divvi Protocol: The main Divvi ecosystem repositories

- Documentation:Divvi SDK Docs
- Issues:
GitHub Issues
- Discussions:
GitHub Discussions

This project is licensed under the Apache License 2.0 - see theLICENSEfile for details.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Read/write to over 2k blockchains, enabling data querying, contract analysis/deployment, and transaction execution, powered by Thirdweb.

Server-side EVM wallet for Ai agents. Send transactions, manage tokens, and interact with smart contracts across multiple chains.

Interact with Aptos documentation and create full-stack Aptos blockchain applications.

A MCP server for interacting with Aptos NPM packages.

A server for blockchain interactions, offering Ethereum vanity address generation, 4byte lookup, ABI encoding, and multi-chain RPC calls.

A comprehensive toolkit for Ethereum blockchain analysis directly within Claude AI.

A set of tools for interacting with the Flow blockchain through the Model Context Protocol.

Analyzes smart contract source code on the Monad blockchain for functionality and security.

Verify and retrieve smart contract source code using the Sourcify API.

A toolkit for building and deploying AI agents with blockchain capabilities, featuring a Model Context Protocol (MCP) server.

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.