
mcp mad lucky
Use the Model Context Protocol (MCP) to build the Monad on-chain AI lottery prediction market. This makes it easier for massive adoption.
Repository Info
About This Server
Use the Model Context Protocol (MCP) to build the Monad on-chain AI lottery prediction market. This makes it easier for massive adoption.
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
mcp-mad-lucky
Use the Model Context Protocol (MCP) to build the Monad on-chain AI lottery prediction market. This makes it easier for massive adoption.
(this is just an idea, the code is not production ready)
After ready to use, User can just type:
'help me buy 100 mon ticket for AI-STRATEGY-100 pool'
'help me get the result of AI-STRATEGY-100 pool'
'help me get the history of AI-STRATEGY-100 pool'
'help me get my account balance'
and the AI will help you to bet on the lottery and get the result.
What is MCP?
The Model Context Protocol (MCP) is a standard that allows AI models to interact with external tools and services.
Prerequisites
- Node.js (v16 or later)
npmoryarn- Claude Desktop
Getting Started
- Clone this repository
git clone https://github.com/vimda/mcp-mad-lucky
- Install dependencies:
npm install
- Configure private key in env file
cp .env.example .env
Building the MCP server
Monad Testnet related configuration is already added to index.ts in the src folder.
Define the server instance
// Create a new MCP server instance
const server = new McpServer({
name: "mad-lucky-mcp",
version: "0.0.1",
// Array of supported tool names that clients can call
capabilities: ["get-lottery-result","get-lottery-history","bet-lottery","get-account-balance"]
});
Defining the tools
Scaffold of the bet-lottery tool:
server.tool(
// Tool ID
"bet-lottery",
// Description of what the tool does
"Bet on the given lottery",
// Input schema
{
lotteryName: z.string().describe("Lottery name to bet on"),
amount: z.string().describe("Amount to bet"),
lotteryNumber: z.string().describe("Lottery number to bet on"),
lotteryDate: z.string().describe("Lottery date to bet on"),
},
// Tool implementation
async ({ lotteryName, amount, lotteryNumber, lotteryDate }) => {
// call mad-lucky-client to bet on the given lottery
// mad-lucky-client is a client that is used to bet on the given lottery. which is also not production ready
}
);
Scaffold of the get-lottery-result tool:
server.tool(
// Tool ID
"get-lottery-result",
// Description of what the tool does
"Get lottery result for a given lottery",
// Input schema
{
lotteryName: z.string().describe("Lottery name to get result for"),
lotteryNumber: z.string().describe("Lottery number to get result for"),
lotteryDate: z.string().describe("Lottery date to get result for"),
},
// Tool implementation
async ({ lotteryName, lotteryNumber, lotteryDate }) => {
// call mad-lucky-client to get lottery result
}
);
Scaffold of the get-lottery-history tool:
server.tool(
// Tool ID
"get-lottery-history",
// Description of what the tool does
"Get lottery history for a given lottery",
// Input schema
{
lotteryName: z.string().describe("Lottery name to get history for"),
},
// Tool implementation
async ({ lotteryName }) => {
// call mad-lucky-client to get lottery history
}
);
Scaffold of the get-account-balance tool:
server.tool(
// Tool ID
"get-account-balance",
// Description of what the tool does
"Get account balance for an address",
// Input schema
{
address: z.string().describe("Monad testnet address to check balance for"),
},
// Tool implementation
async ({ address }) => {
// call public client to get account all token balance
}
);
Initialize the transport and server from the main function
(still working on it)
Build the project
npm run build
The server is now ready to use!
Adding the MCP server to Claude Desktop
- Open "Claude Desktop"
!claude desktop
- Open Settings
Claude > Settings > Developer
!claude settings
- Open
claude_desktop_config.json
!claude config
- Add details about the MCP server and save the file.
{
"mcpServers": {
...
"mad-lucky-mcp": {
"command": "node",
"args": [
"/<path-to-project>/build/index.js"
]
}
}
}
- Restart "Claude Desktop"
Using the MCP server
not production ready yet
Further Resources
- Monad MCP Resources
- Model Context Protocol Documentation
- Monad Documentation
- Viem Documentation
Quick Start
Clone the repository
git clone https://github.com/vimday/mcp-mad-luckyInstall dependencies
cd mcp-mad-lucky
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.