Manifold Markets

by bmorphism

4 stars
501 downloads
Not rated
GitHub

About

Integrates with Manifold Markets prediction markets, enabling market search, analysis, betting, and portfolio management with precise limit orders and advanced filtering.

Details

Author
bmorphism
Repository
bmorphism/manifold-mcp-server
GitHub stars
4
Downloads
501
License
MIT License
Categories
Other, Finance, AI, Design, Developer Tools, Search, Frontend, Automation, Infrastructure

- send_mana: Transfer mana between users

The server has been tested through comprehensive interaction trajectories:

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Manifold Markets
    Command (node, npx, python, etc.) node
    Arguments
    • Argument 1 /path/to/manifold-mcp-server/build/index.js
    Environment
    • MANIFOLD_API_KEY your_api_key_here

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

npm install manifold-mcp-server

npm install

create_market

Create a new prediction market with specified parameters such as outcome type, question, and visibility.

unresolve_market

Unresolve a previously resolved market by specifying the contract ID and optional answer ID.

close_market

Close a market for trading by providing the contract ID and an optional close time.

follow_market

Follow or unfollow a market by specifying the contract ID and a boolean for follow status.

react

React to markets or comments by providing the content ID, content type, and reaction type (like or dislike).

place_bet

Place a bet on a market by specifying the market ID, amount, and outcome.

sell_shares

Sell shares in a market by providing the market ID and optional outcome and shares.

add_liquidity

Add liquidity to a market pool by specifying the market ID and amount.

remove_liquidity

Remove liquidity from a market pool by providing the contract ID and amount.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "manifold markets": {
            "env": {
                "MANIFOLD_API_KEY": "your_api_key_here"
            },
            "args": [
                "/path/to/manifold-mcp-server/build/index.js"
            ],
            "command": "node"
        }
    }
}

Linux

{
    "env": {
        "MANIFOLD_API_KEY": "your_api_key_here"
    },
    "args": [
        "/path/to/manifold-mcp-server/build/index.js"
    ],
    "command": "node"
}

Macos

{
    "env": {
        "MANIFOLD_API_KEY": "your_api_key_here"
    },
    "args": [
        "/path/to/manifold-mcp-server/build/index.js"
    ],
    "command": "node"
}

Windows

{
    "env": {
        "MANIFOLD_API_KEY": "your_api_key_here"
    },
    "args": [
        "/path/to/manifold-mcp-server/build/index.js"
    ],
    "command": "node"
}

Manifold Markets MCP Server

An MCP server for interacting with Manifold Markets prediction markets. This server provides comprehensive access to Manifold's features through a clean MCP interface, enabling sophisticated market interactions and collective intelligence mechanisms.

Architecture

The server implements a complete mapping of Manifold Markets' API capabilities through a structured tool system:

Core Components

- Schema Layer: Zod-based validation schemas for all operations - API Integration: Direct mapping to Manifold's REST endpoints - Tool Handlers: Request processing with proper error management - Type Safety: Full TypeScript implementation

Tool Categories

Market Creation & Management

- create_market: Create markets (BINARY, MULTIPLE_CHOICE, PSEUDO_NUMERIC, POLL) - unresolve_market: Revert resolved markets - close_market: Close markets for trading - add_answer: Add options to multiple choice markets

Market Interaction

- follow_market: Track markets of interest - react: Like/dislike markets and comments - add_bounty: Add bounties for analysis - award_bounty: Reward valuable contributions

Trading Operations

- place_bet: Execute market trades - cancel_bet: Cancel limit orders - sell_shares: Liquidate positions

Liquidity Management

- add_liquidity: Provide market liquidity - remove_liquidity: Withdraw provided liquidity

Information Retrieval

- search_markets: Find markets with filters - get_market: Detailed market information - get_user: User profile data - get_positions: Portfolio tracking

Social Features

- send_mana: Transfer mana between users

Verified Capabilities

The server has been tested through comprehensive interaction trajectories:

Successfully Tested

1. Market Discovery & Following - ✅ Market search with filters - ✅ Market following - ✅ Detailed market information retrieval

2. Trading Operations
- ✅ Liquidity provision
- ✅ Bet placement with probability updates
- ✅ Position liquidation
- ✅ Share selling

3. Permission Management
- ✅ Role-based access control
- ✅ Authentication handling
- ✅ Error messaging

Permission-Restricted Operations

These operations are implemented but require specific user roles: - Market resolution/unresolving (market creator) - Market closing (market creator) - Bounty management (market creator) - Liquidity removal (liquidity provider)

Prerequisites

- Node.js 18 or higher
- npm or yarn
- Manifold Markets API key
- Minimum M$1000 balance for market creation

Installation

1. Install the package

npm install manifold-mcp-server

2. Get your API Key

1. Log in to Manifold Markets
2. Go to your profile settings
3. Generate an API key
4. Ensure account has sufficient mana for intended operations

3. Configure MCP Settings

For Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "manifold": {
      "command": "node",
      "args": ["/path/to/manifold-mcp-server/build/index.js"],
      "env": {
        "MANIFOLD_API_KEY": "your_api_key_here"
      }
    }
  }
}

For Cline (VSCode Extension)

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json:

{
  "mcpServers": {
    "manifold": {
      "command": "node",
      "args": ["/path/to/manifold-mcp-server/build/index.js"],
      "env": {
        "MANIFOLD_API_KEY": "your_api_key_here"
      }
    }
  }
}

Tool Documentation

Market Creation & Management

create_market

Create a new prediction market:
{
  outcomeType: 'BINARY' | 'MULTIPLE_CHOICE' | 'PSEUDO_NUMERIC' | 'POLL' | 'BOUNTIED_QUESTION'
  question: string
  description?: string | {
    type: 'doc'
    content: any[]
  }
  closeTime?: number // Unix timestamp ms
  visibility?: 'public' | 'unlisted'
  initialProb?: number // Required for BINARY (1-99)
  min?: number // Required for PSEUDO_NUMERIC
  max?: number // Required for PSEUDO_NUMERIC
  isLogScale?: boolean
  initialValue?: number // Required for PSEUDO_NUMERIC
  answers?: string[] // Required for MULTIPLE_CHOICE/POLL
  addAnswersMode?: 'DISABLED' | 'ONLY_CREATOR' | 'ANYONE'
  shouldAnswersSumToOne?: boolean
  totalBounty?: number // Required for BOUNTIED_QUESTION
}

unresolve_market

Unresolve a previously resolved market:
{
  contractId: string
  answerId?: string // For multiple choice markets
}

close_market

Close a market for trading:
{
  contractId: string
  closeTime?: number // Optional close time
}

Market Interaction

follow_market

Follow or unfollow a market:
{
  contractId: string
  follow: boolean
}

react

React to markets or comments:
{
  contentId: string
  contentType: 'comment' | 'contract'
  remove?: boolean
  reactionType: 'like' | 'dislike'
}

Trading Operations

place_bet

Place a bet on a market:
{
  marketId: string
  amount: number
  outcome: 'YES' | 'NO'
  limitProb?: number // 0.01-0.99
}

sell_shares

Sell shares in a market:
{
  marketId: string
  outcome?: 'YES' | 'NO'
  shares?: number // Defaults to all
}

Liquidity Management

add_liquidity

Add liquidity to market pool:
{
  marketId: string
  amount: number
}

remove_liquidity

Remove liquidity from market pool:
{
  contractId: string
  amount: number
}

Error Handling

The server implements comprehensive error handling:

1. Input Validation
- Parameter type checking via Zod schemas
- Value range validation
- Required field verification

2. API Communication
- Authentication errors
- Network failures
- Rate limiting
- Permission checks

3. Business Logic
- Insufficient balance
- Invalid market states
- Unauthorized operations

4. Error Response Format

{
code: ErrorCode
message: string
details?: any
}

Development

```bash

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.