Jesse MCP Server
The Jesse MCP Server exposes Jesse's algorithmic trading framework to LLM agents via 47 tools, covering backtesting, strategy management, optimization, risk analysis, pairs trading, live/paper trading, and monitoring.
Backtesting & Data
Run single or batch (concurrent) backtests with configurable strategy, symbol, timeframe, leverage, fees, and hyperparameters
Import candle data from exchanges
Validate strategy code without saving
Check Jesse API health and supported exchanges
Run benchmarks to measure backtest execution performance
Strategy Management
Create, refine, and delete strategies with iterative AI-powered refinement
List strategies, read source code, and retrieve metadata (version, certification)
Manage async strategy creation jobs (poll status, cancel)
Optimization & Analysis
Bayesian hyperparameter optimization (Optuna)
Walk-forward analysis to detect overfitting
Deep backtest result analysis for performance insights
Risk Analysis
Monte Carlo simulations for statistical robustness testing
Value at Risk (VaR) via historical, parametric, and Monte Carlo methods
Stress testing under extreme scenarios (market crash, flash crash, etc.)
Comprehensive risk reports combining VaR, Monte Carlo, and stress tests
Portfolio risk analysis, leverage risk assessment, hedging recommendations, and drawdown recovery analysis
Pairs Trading & Market Analysis
Cross-asset correlation matrix analysis
Pairs trading backtests with mean reversion strategies
Factor decomposition and market regime detection (HMM)
Live & Paper Trading
Start/stop paper and real-money live trading sessions (with strict warnings for real trading)
Monitor sessions: status, orders, equity curve, logs, trades, and performance metrics
Check jesse-live plugin availability
AI-Powered Agent Tools
Strategy improvement suggestions and side-by-side strategy comparison
Pair selection optimization and optimization impact analysis
Comprehensive backtests, cross-timeframe comparisons, quick parameter optimization, regime-aware analysis, and statistical significance validation
Market Monitoring & Reporting
Daily market scans for trading opportunities
Fear & Greed Index sentiment monitoring
Current market risk identification with severity levels
Backtest history analysis, strategy performance aggregation, and weekly activity reports
Utilities
Send notifications via ntfy.sh
Cache management (stats, clear specific or all caches)
Rate limit monitoring and async job management
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Jesse MCP ServerRun a backtest for my TrendFollower strategy on BTC/USDT for the last 6 months"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Jesse MCP Server
An MCP (Model Context Protocol) server that exposes Jesse's algorithmic trading framework capabilities to LLM agents.
Status: Feature Complete ✅
All planned features implemented and tested. 32 tools available (17 core + 15 agent).
Installation
PyPI
pip install jesse-mcpuvx (recommended for running directly)
uvx jesse-mcpArch Linux (AUR)
yay -S jesse-mcp
# or
paru -S jesse-mcpFrom Source
git clone https://github.com/bkuri/jesse-mcp.git
cd jesse-mcp
pip install -e .Usage
# stdio transport (default, for MCP clients)
jesse-mcp
# HTTP transport (for remote access)
jesse-mcp --transport http --port 8100
# Show help
jesse-mcp --helpEnvironment Variables
Variable | Description | Default |
| Jesse REST API URL |
|
| Jesse UI password | (required) |
| Pre-generated API token | (alternative to password) |
| jesse.trade community API Bearer token | (optional) |
Features
Backtesting - Single and batch backtest execution via Jesse REST API
Optimization - Hyperparameter tuning with walk-forward validation
Monte Carlo Analysis - Statistical robustness testing
Pairs Trading - Cointegration testing and strategy generation
Strategy Management - CRUD operations for trading strategies
Risk Analysis - VaR, stress testing, comprehensive risk reports
Agent Tools - 15 specialized tools for autonomous trading workflows
Community Browsing - Browse, compare, and inspect jesse.trade community strategies
Architecture
LLM Agent ←→ MCP Protocol ←→ jesse-mcp ←→ Jesse REST API (localhost:9000)
↓
Mock Fallbacks (when Jesse unavailable)Available Tools
Core Tools (17)
Phase 1: Backtesting
Tool | Description |
| Run single backtest with specified parameters |
| List available strategies |
| Read strategy source code |
| Validate strategy code |
Phase 2: Data & Analysis
Tool | Description |
| Download candle data from exchanges |
| Run concurrent multi-asset backtests |
| Extract insights from backtest results |
| Walk-forward analysis for overfitting detection |
Phase 3: Optimization
Tool | Description |
| Optimize hyperparameters using Optuna |
Phase 4: Risk Analysis
Tool | Description |
| Monte Carlo simulations for risk analysis |
| Value at Risk (historical, parametric, Monte Carlo) |
| Test under extreme market scenarios |
| Comprehensive risk assessment |
Phase 5: Pairs Trading
Tool | Description |
| Cross-asset correlation analysis |
| Backtest pairs trading strategies |
| Decompose returns into systematic factors |
| Identify market regimes and transitions |
Agent Tools (15)
Specialized tools for autonomous trading workflows:
Tool | Description |
| AI-powered strategy enhancement suggestions |
| Compare multiple strategies side-by-side |
| Optimize pairs trading selection |
| Analyze impact of optimization changes |
| Portfolio-level risk analysis |
| Advanced stress testing |
| Leverage risk assessment |
| Hedging recommendations |
| Drawdown recovery analysis |
| Full backtest with all metrics |
| Compare performance across timeframes |
| Quick parameter optimization |
| Backtest with Monte Carlo analysis |
| Regime-aware backtest analysis |
| Statistical significance validation |
Community Tools (5)
Browse, compare, and inspect community strategies from jesse.trade:
Tool | Description |
| List available backtest periods on jesse.trade |
| Browse strategies sorted by performance metrics |
| Detailed backtest metrics for a specific strategy |
| Full Python source code for a strategy |
| Side-by-side metric comparison of multiple strategies |
Testing
# Install dev dependencies
pip install jesse-mcp[dev]
# Run all tests
pytest -v
# Run with coverage
pytest --cov=jesse_mcpStatus: 49 tests passing
Local Development
Prerequisites
Python 3.10+
Jesse 1.13.x running on localhost:9000
PostgreSQL on localhost:5432
Redis on localhost:6379
Start Jesse Stack (Podman)
# Start infrastructure
podman run -d --name jesse-postgres --network host \
-e POSTGRES_USER=jesse_user -e POSTGRES_PASSWORD=password -e POSTGRES_DB=jesse_db \
docker.io/library/postgres:14-alpine
podman run -d --name jesse-redis --network host \
docker.io/library/redis:6-alpine redis-server --save "" --appendonly no
# Start Jesse
podman run -d --name jesse --network host \
-v /path/to/jesse-bot:/home:z \
docker.io/salehmir/jesse:latest bash -c "cd /home && jesse run"Start Dev MCP Server
./scripts/start-dev-server.sh # Start on port 8100
./scripts/stop-dev-server.sh # Stop serverAdd to OpenCode
Add to ~/.config/opencode/opencode.json:
{
"mcp": {
"jesse-mcp-dev": {
"type": "remote",
"url": "http://localhost:8100/mcp",
"enabled": true
}
}
}Documentation
Using with LLMs - How to use with MCP-compatible LLMs
Production Deployment - Production deployment guide
Jesse Setup - Jesse integration setup
Agent System - Agent architecture
AGENTS.md - Development guidelines for AI agents
API Reference
Jesse REST Client
The jesse_rest_client.py module provides direct access to Jesse's REST API:
from jesse_mcp.core.jesse_rest_client import get_jesse_rest_client
client = get_jesse_rest_client()
# Run backtest
result = client.backtest(
strategy="OctopusStrategy",
symbol="BTC-USDT",
timeframe="1h",
start_date="2024-01-01",
end_date="2024-01-31"
)Mock Implementations
When Jesse is unavailable, all tools gracefully fall back to mock implementations that return realistic synthetic data. This enables development and testing without a full Jesse installation.
Key Dependencies
Package | Version | Purpose |
fastmcp | >=0.3.0 | MCP server framework |
numpy | >=1.24.0 | Numerical computations |
pandas | >=2.0.0 | Data manipulation |
scipy | >=1.10.0 | Statistical functions |
scikit-learn | >=1.3.0 | ML utilities |
optuna | >=3.0.0 | Hyperparameter optimization |
Project Structure
jesse_mcp/
├── server.py # FastMCP server with 17 core tools
├── optimizer.py # Phase 3: Optimization tools
├── risk_analyzer.py # Phase 4: Risk analysis tools
├── pairs_analyzer.py # Phase 5: Pairs trading tools
├── agent_tools.py # 15 agent-specific tools
├── core/
│ ├── integrations.py # Jesse framework integration
│ ├── jesse_rest_client.py # REST API client
│ └── mock.py # Mock implementations
├── agents/
│ ├── base.py # Base agent class
│ ├── backtester.py # Backtesting specialist
│ └── risk_manager.py # Risk management specialist
└── scripts/
├── start-dev-server.sh
└── stop-dev-server.shLicense
MIT License - see LICENSE file for details.
Publishing
This package uses GitHub Actions with PyPI trusted publishing. To release a new version:
Update version in
pyproject.tomlandjesse_mcp/__init__.pyCreate a git tag:
git tag v1.x.xPush tag:
git push origin v1.x.xCreate GitHub release - automatically publishes to PyPI
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bkuri/jesse-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server