Skip to main content
Glama
jorgearturoyap-debug

MetaTrader 5 MCP Server

README.md
# MetaTrader 5 MCP Server for ChatGPT Desktop

A Model Context Protocol (MCP) server for MetaTrader 5, specifically adapted for **ChatGPT Desktop** integration. This fork enables ChatGPT to interact with the MetaTrader 5 platform for trading and market data analysis via HTTP transport and ngrok tunneling.

> **Based on:** [mcp-metatrader5-server](https://github.com/Qoyyuum/mcp-metatrader5-server) by Abdul Qoyyuum
> **Focus:** ChatGPT Desktop integration with HTTP/ngrok support

## Features

- Connect to MetaTrader 5 terminal
- Access market data (symbols, rates, ticks)
- Place and manage trades
- Analyze trading history
- Integrate with AI assistants through the Model Context Protocol

## Installation

### From PyPI 

```bash
uvx --from mcp-metatrader5-server mt5mcp
```

### From Source

```bash
git clone https://github.com/jorgearturoyap-debug/metatrader-5-for-Chatgpt-Desktop.git
cd metatrader-5-for-Chatgpt-Desktop
uv sync
uv run mt5mcp
```

## Requirements

- **ChatGPT Plus** subscription or higher (Free tier doesn't support MCP)
- **ChatGPT Desktop** application (latest version)
- **ngrok** for tunneling: https://ngrok.com/download
- **uv** package manager (recommended) or pip
- **Python 3.11 or higher**
- **MetaTrader 5 terminal** installed on Windows
- **MetaTrader 5 account** (demo or real)

## Quick Start for ChatGPT Desktop

See [CHATGPT_SETUP.md](CHATGPT_SETUP.md) for detailed step-by-step setup instructions.

**TL;DR:**
1. Clone this repo and install dependencies: `uv sync`
2. Configure your MT5 credentials in `.env` file
3. Run `start_chatgpt.bat` to start the server with ngrok
4. Copy the ngrok HTTPS URL
5. Add the connector in ChatGPT Desktop settings
6. Start trading with ChatGPT!

## What's Different from the Original?

This fork includes:
- ✅ **HTTP transport support** for ChatGPT Desktop (via ngrok)
- ✅ **Automated startup script** (`start_chatgpt.bat`) that handles server + ngrok
- ✅ **ChatGPT-specific documentation** and setup guides
- ✅ **Pre-configured for HTTP mode** in `fastmcp.json`
- ✅ **Spanish language support** in setup guides

## Credits & Acknowledgments

### Original Author
This project is based on the excellent work by **Abdul Qoyyuum** ([Qoyyuum](https://github.com/Qoyyuum)) in the original [mcp-metatrader5-server](https://github.com/Qoyyuum/mcp-metatrader5-server) repository. All core MT5 functionality and MCP implementation credit goes to the original author.

### Contributors
Special thanks to all contributors who have helped improve this project in the private development repository before its public release.

### Development Tools
**Important Note:** This adaptation was created entirely using AI-assisted development tools. The maintainer (jorgearturoyap-debug) is **not a professional programmer**. All code, documentation, and improvements were developed with the assistance of:

- **[Claude Code CLI](https://github.com/anthropics/claude-code)** - AI-powered coding assistant by Anthropic
- **GitHub Codex CLI** - AI-powered code completion and generation

This project demonstrates how AI tools can empower non-programmers to adapt and customize complex software for specific use cases (ChatGPT Desktop integration in this case).

### License
This project inherits the license from the original [mcp-metatrader5-server](https://github.com/Qoyyuum/mcp-metatrader5-server) repository. Please see the original repository for license details.