Skip to main content

MCP Server Framework for MetaTrader 5. Build HTTP and stdio servers with automatic tool registration and MT5 socket communication

Project description

MCP Servers for MT5


Overview

mcp-mt5-conection is a Python library that bridges MetaTrader 5 (MT5) with the Model Context Protocol (MCP). It provides a simple and extensible framework to create tools that communicate between Python and MT5 via socket connections. Define your tools once in Python, and expose them through either FastMCP (for Claude and MCP clients) or HTTP (for custom integrations).


Main Features

Library Capabilities

  • Simple Tool Registration: Use Python decorators to define MCP tools with minimal boilerplate
  • Dual Protocol Support: Expose tools via FastMCP (for Claude) or HTTP API simultaneously
  • Socket-Based Communication: Reliable TCP socket connection between Python and MT5 with JSON serialization
  • Extensible Architecture: Abstract base classes allow custom implementations (MCP, HTTP, or custom protocols)
  • MT5 Function Access: Call any MT5 function from Python through registered tools (trading, data, charts, etc.)

Repository Structure

McpServer/
├── Src/                    # MQL5 Backend Functions
├── mcp_mt5_conection/      # Python MCP Server Package
└── Configuration & metadata files

Requirements


Installation of repo code

cd "C:\Users\YOUR USER\AppData\Roaming\MetaQuotes\Terminal\YOUR ID\MQL5\Shared Projects"
tsndep install "https://forge.mql5.io/nique_372/McpServer.git"
  • For use tsndep command requerid tsndep pacakage (avaible in pypi).. This command automatically downloads all dependencies and installs all requirements from the repositories.
  • If any part of the system is private, then it will fail... contact me so I can give you access (if it's a product, you can buy it; if you have any questions, don't hesitate to contact me).

Quick start


License

Read Full License

By downloading or using this repository, you accept the license terms.


Documentation


Contact


Copyright © 2026 Niquel Mendoza (nique_372).
TSN Trading Systems ecosystem.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_mt5_conection-1.0.4.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_mt5_conection-1.0.4-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file mcp_mt5_conection-1.0.4.tar.gz.

File metadata

  • Download URL: mcp_mt5_conection-1.0.4.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for mcp_mt5_conection-1.0.4.tar.gz
Algorithm Hash digest
SHA256 525a609baf10823de98c7ce99ecbd43e0593eb1fca929e5765dc5e17cb3d8d42
MD5 d3a00a2eeb67275a163083d3698fba47
BLAKE2b-256 4dffd3bf0cc68670a942dd0238772f47bee448a44f19a00b09a11ee334e1d2b8

See more details on using hashes here.

File details

Details for the file mcp_mt5_conection-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_mt5_conection-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a977542aaf09bef7d30683d9d59e54cbbf624c7696ac064dd58693c9d89cf75e
MD5 5bfb85dc7926341fbb3896997edbb69f
BLAKE2b-256 a2b7e364c528154fb4474a54ffed8b43f9ae9db391a70cef49d319590c2c80a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page