MCP ExplorerExplorer

Monorail Mcp Py

@life-agreeson a year ago
1 MIT
FreeCommunity
AI Systems
Self-hosted MCP server with real-time trade tracking and failure alerts.

Overview

What is Monorail Mcp Py

Monorail MCP is a self-hosted Model Context Protocol server designed for Monorail’s on-chain quote and trade APIs. It includes a Streamlit dashboard for real-time visualization and tracking of failed trades.

Use cases

Use cases include monitoring and analyzing trade failures, providing real-time quotes for token swaps, and integrating with trading bots or applications that require reliable transaction data.

How to use

To use monorail-mcp-py, clone the repository, configure the environment variables, build and run the API and dashboard using Docker. Access the API documentation and dashboard via the provided local URLs.

Key features

Key features include fetching swap quotes across multiple exchanges, requesting transaction data, automatic retries and failure logging, Slack alerts for failures, browsing persisted failed trades, and a Streamlit dashboard for visualizing trade failures.

Where to use

Monorail MCP can be used in the cryptocurrency trading sector, particularly for applications that require real-time trading data and failure tracking in decentralized finance (DeFi) environments.

Content

Monorail MCP Server & Dashboard

A self-hosted Model Context Protocol (MCP) server for Monorail’s on-chain quote & trade APIs, plus a Streamlit dashboard to visualize and track failed trades in real time.


🚀 Features

  • /quote: Fetch swap quotes across 11 exchanges (7k+ tokens).
  • /trade/{token_pair}: Request ready-to-send transaction data.
  • Automatic retries & failure capture:
    • Failed calls get logged to SQLite.
    • Slack alerts on each failure.
    • Webhook callbacks support custom listeners.
  • /failed-trades: Browse persisted failures via API.
  • Streamlit Dashboard:
    • Bar chart of failures by token pair
    • Detailed trade-by-trade view

🛠️ Tech Stack

  • FastAPI — MCP server
  • Pydantic — request validation
  • HTTPX — async HTTP client with retry logic
  • SQLModel (SQLite) — lightweight persistence
  • Slack SDK — real-time alerts
  • Streamlit — dashboard UI
  • Docker & Docker Compose — containerized deployment
  • Railway.app — hosting

📦 Getting Started

  1. Clone & configure

    git clone https://github.com/life-agrees/monorail-mcp-py
    cd monorail-mcp-py
    cp .env.example .env
    # Edit .env with your BASE_URL, SLACK_BOT_TOKEN, SLACK_CHANNEL…
    
    
  2. Build & run API

    docker build -t monorail-app .
    docker run -d -p 8000:8000 --env-file .env monorail-app
    
  3. Build & run Dashboard

    docker build -f Dockerfile.dashboard -t monorail-dashboard .
    docker run -d -p 8501:8501 monorail-dashboard
    
  4. Visit
    API docs: http://localhost:8000/docs
    Dashboard: http://localhost:8501

☁️ Deploy

  1. Pushed to Docker Hub
    docker tag monorail-app lifeagrees/monorail-app:latest
    docker push lifeagrees/monorail-app:latest
    
  2. Deployed on Railway
    API:https://monorail-mcp-py-production.up.railway.app/docs
    DASHBOARD:https://monorail-mcp-py-production-ffd0.up.railway.app

What This Solves

  1. Speeds up AI agents’ access to aggregated on-chain swap quotes & trades
  2. Reliability: automatic retry/catch + failure logging & alerting
  3. Visibility: real-time dashboard & API for audit & debugging

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers