npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

mt5-mcp-server

v1.0.1

Published

A Model Context Protocol (MCP) server that provides integration with MetaTrader 5 (MT5) trading platform. This server exposes MT5 functionality through MCP tools and resources, enabling AI assistants to interact with MT5 for trading symbol information and

Downloads

6

Readme

MT5 MCP Server

A Model Context Protocol (MCP) server that provides integration with MetaTrader 5 (MT5) trading platform. This server exposes MT5 functionality through MCP tools and resources, enabling AI assistants to interact with MT5 for trading symbol information and user management.

Features

  • Symbol Management: List and count available trading symbols
  • User Management: Retrieve user information by login
  • MT5 Authentication: Secure connection to MT5 servers with MD5-based authentication
  • MCP Integration: Exposes functionality through both tools and resources for AI assistants

Requirements

  • Node.js 18+
  • TypeScript
  • Access to a MetaTrader 5 server with manager credentials

Installation

  1. Clone the repository:
git clone https://github.com/afx-markets/mt5-mcp-server.git
cd mt5-mcp-server
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Configuration

The server requires the following environment variables:

| Variable | Description | Default | |----------|-------------|---------| | MT5_SERVER | MT5 server hostname | '' | | MT5_SERVER_PORT | MT5 server port | 443 | | MT5_LOGIN | Manager login credentials | '' | | MT5_PASSWORD | Manager password | '' | | MT5_VERSION | MT5 build version | '' |

Example Configuration

export MT5_SERVER="your-mt5-server.com"
export MT5_SERVER_PORT="443"
export MT5_LOGIN="your_manager_login"
export MT5_PASSWORD="your_manager_password"
export MT5_VERSION="3350"

Usage

Starting the Server

npm start

The server will start and listen for MCP connections via stdio transport.

Development Mode

For development with automatic rebuilding:

npm run dev

Available Tools and Resources

Symbol Management

Tools

  • list-symbols: Returns a comma-separated list of all available trading symbols
  • count-symbols: Returns the total number of available symbols

Resources

  • configuration://symbols/count/list: Resource providing list of available symbols
  • configuration://symbols/count: Resource providing symbol count information

User Management

Tools

  • get-user-by-login: Retrieve user information by login ID

API Endpoints

The server connects to MT5 using the following API endpoints:

  • api/auth/start - Initialize authentication
  • api/auth/answer - Complete authentication challenge
  • api/symbol/list - Get list of symbols
  • api/symbol/total - Get total symbol count
  • api/user/get - Get user information

Architecture

The server is built with:

  • MCP SDK: Uses @modelcontextprotocol/sdk for Model Context Protocol implementation
  • MT5 Integration: Custom MT5 API client with secure authentication
  • TypeScript: Full TypeScript implementation with strict typing
  • Modular Design: Organized into separate modules for symbols, users, and configuration

Security

  • Uses MD5-based authentication with random challenges for MT5 connections
  • Maintains persistent HTTPS connections with keep-alive
  • Secure credential management through environment variables

Development

Project Structure

src/
├── config.ts                 # Environment configuration
├── index.ts                  # Main server entry point
├── lib/
│   ├── mt5.ts                # MT5 API client implementation
│   └── mt5-api.ts            # MT5 API helper functions
├── configurationDatabases/
│   └── symbols/              # Symbol management tools
└── users/                    # User management tools

Building

npm run build

Testing

Currently no tests are implemented. To add tests:

npm test

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Build and test your changes
  5. Submit a pull request

License

ISC

Support

For issues and questions, please use the GitHub Issues page.