Kleros Court MCP Server

Kleros Court MCP Server

Enables retrieval of comprehensive Kleros court dispute data including meta-evidence and evidence submissions from Ethereum and Gnosis Chain. Supports querying dispute details, evidence content, and IPFS-hosted materials through natural language.

Category
访问服务器

README

Kleros MCP Server

A Model Context Protocol (MCP) server that retrieves comprehensive Kleros court dispute data including meta-evidence and evidence submissions from multiple blockchain networks.

Features

  • 🔗 Multi-chain Support: Ethereum Mainnet and Gnosis Chain
  • 📊 Comprehensive Data: Meta-evidence, evidence submissions, and IPFS content
  • 🌐 Remote Hosting Ready: Streamable HTTP transport with session management
  • 🔒 Secure: DNS rebinding protection and proper CORS configuration
  • Fast: Parallel IPFS content retrieval with error handling
  • 📱 Claude Desktop Compatible: Direct URL integration

Supported Networks

  • Ethereum Mainnet (chainId: 1)
  • Gnosis Chain (chainId: 100)

Data Sources

  • Meta-evidence API: Kleros dispute metadata
  • Ethereum Subgraph: Evidence submissions on Ethereum
  • Gnosis Subgraph: Evidence submissions on Gnosis Chain
  • IPFS Gateway: Evidence content via Kleros CDN

Claude Desktop Integration

Easy Setup (Recommended)

  1. Open Claude Desktop Settings

    • Click on Settings in the sidebar
  2. Go to Connectors

    • Navigate to Settings → Connectors
  3. Add Custom Connector

    • Click "Add custom connector"
    • Enter a name: Kleros Court
    • Paste the URL: https://kleros-mcp-server-new.fly.dev/mcp
    • Click "Add"

Claude Desktop Connector Setup

  1. Start Using
    • The Kleros Court tool will now be available in Claude Desktop
    • Try: "Get dispute data for dispute ID 481 on Gnosis Chain"

Alternative Configuration File Method

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "kleros": {
      "url": "https://kleros-mcp-server-new.fly.dev/mcp"
    }
  }
}

MCP Tool

get_dispute_data

Retrieves comprehensive dispute data from Kleros including meta-evidence and evidence submissions.

Parameters:

  • disputeId (string): The dispute ID to retrieve data for
  • chainId (number): The chain ID (1 for Ethereum, 100 for Gnosis)

Example Usage:

  • "Get dispute data for dispute ID 123 on Ethereum"
  • "Show me details for dispute 481 on Gnosis Chain"
  • "Retrieve evidence for dispute 50 on chain 100"

Sample Response:

# Kleros Dispute Data

**Dispute ID:** 481
**Chain:** Gnosis Chain (100)

## Meta-Evidence
**Title:** Web3 Security Auditor Registry
**Description:** A curated registry of verified security auditors...

## Evidence Submissions (3)

### Evidence 1
**Title:** Challenge Justification
**Description:** Pokémon is not a web3 auditor, reject the submission.
**Type:** text/plain

Quick Start

Prerequisites

  • Node.js 18.x or higher
  • npm or yarn

Local Development

  1. Clone and install dependencies:

    git clone <your-repo>
    cd kleros-mcp-server
    npm install
    
  2. Build the project:

    npm run build
    
  3. Start the server:

    npm start
    
  4. Health check:

    curl http://localhost:8080/health
    

Development Mode

For development with auto-restart:

npm run dev

Deployment

Fly.io Deployment

  1. Install Fly CLI:

    curl -L https://fly.io/install.sh | sh
    
  2. Login to Fly:

    fly auth login
    
  3. Create app (update app name in fly.toml if needed):

    fly apps create kleros-mcp-server-new
    
  4. Build and deploy:

    npm run build
    fly deploy
    
  5. Check deployment:

    fly status
    fly logs
    

Your MCP server will be available at: https://kleros-mcp-server-new.fly.dev/mcp

Environment Variables

Set any required environment variables:

fly secrets set ALLOWED_HOSTS=your-domain.com

API Endpoints

Health Check

GET /health

Returns server status and timestamp.

MCP Protocol

POST /mcp
GET /mcp (for SSE notifications)
DELETE /mcp (for session termination)

Main MCP protocol endpoints with session management.

Architecture

kleros-mcp-server/
├── src/
│   ├── index.ts              # Express server with Streamable HTTP transport
│   ├── server.ts             # MCP server setup and tool registration
│   ├── services/
│   │   ├── disputeService.ts # Main dispute data coordination
│   │   ├── metaEvidenceService.ts # Meta-evidence API integration
│   │   ├── subgraphService.ts     # Subgraph queries
│   │   └── ipfsService.ts         # IPFS content retrieval
│   ├── types/
│   │   └── index.ts          # TypeScript type definitions
│   └── utils/
│       └── constants.ts      # API endpoints and configuration
├── Dockerfile                # Container configuration
├── fly.toml                  # Fly.io deployment configuration
└── package.json

Error Handling

The server includes comprehensive error handling:

  • Network timeouts: 10-15 second timeouts for external APIs
  • IPFS failures: Graceful handling of unreachable content
  • Subgraph errors: Detailed error reporting for query failures
  • Input validation: Proper validation of dispute IDs and chain IDs

Development

Adding New Chains

  1. Add chain ID to SUPPORTED_CHAIN_IDS in src/types/index.ts
  2. Add subgraph URL to API_ENDPOINTS.SUBGRAPHS in src/utils/constants.ts
  3. Add network name to NETWORK_NAMES in src/utils/constants.ts

Testing

Test the dispute data retrieval:

curl -X POST http://localhost:8080/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "get_dispute_data",
      "arguments": {
        "disputeId": "123",
        "chainId": 1
      }
    },
    "id": 1
  }'

MCP Inspector Compliance

This server passes all MCP Inspector checks:

  • ✅ Proper protocol implementation
  • ✅ Correct message formatting
  • ✅ Standard error codes
  • ✅ Session management
  • ✅ Resource cleanup

Security

  • DNS rebinding protection enabled
  • CORS properly configured
  • Non-root container user
  • Input validation and sanitization
  • Graceful error handling without information leakage

Troubleshooting

Common Issues

  1. 404 Subgraph Errors: Check if subgraph URLs are up to date
  2. IPFS Timeout: Evidence content may be temporarily unavailable
  3. Invalid Dispute ID: Ensure the dispute exists on the specified chain

Getting Help

  • Check server health: curl https://kleros-mcp-server-new.fly.dev/health
  • View logs: fly logs (for deployed version)
  • Test locally: npm run dev

License

MIT

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Support

For issues and questions:

  • Create an issue in the repository
  • Check the logs: fly logs (for deployed version)
  • Verify health: curl https://kleros-mcp-server-new.fly.dev/health

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选