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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xbtfx/mcp-trading

v1.1.0

Published

MCP server for the XBTFX Trading API — trade forex, metals, indices, and crypto from any AI agent

Downloads

147

Readme

XBTFX MCP Trading Server

MCP server for the XBTFX Trading API — trade forex, crypto, metals, indices, stocks, and energies through XBTFX MetaTrader 5 accounts, from any AI agent that supports the Model Context Protocol.

Works with Claude Code, Claude Desktop, OpenAI Codex, Cursor, Windsurf, and any other MCP-compatible client.

Note: This API is for XBTFX trading accounts only. Create an account at my.xbtfx.com and manage API keys at console.xbtfx.com.

Setup

  1. Get an API key from console.xbtfx.com

  2. Add to your AI tool:

Claude Code

claude mcp add xbtfx-trading -e XBTFX_API_KEY=xbtfx_live_your_key_here -- npx @xbtfx/mcp-trading

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "xbtfx-trading": {
      "command": "npx",
      "args": ["@xbtfx/mcp-trading"],
      "env": {
        "XBTFX_API_KEY": "xbtfx_live_your_key_here"
      }
    }
  }
}

OpenAI Codex

codex mcp add xbtfx-trading -- npx @xbtfx/mcp-trading

Then set the API key in your environment before running Codex:

export XBTFX_API_KEY="xbtfx_live_your_key_here"

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "xbtfx-trading": {
      "command": "npx",
      "args": ["@xbtfx/mcp-trading"],
      "env": {
        "XBTFX_API_KEY": "xbtfx_live_your_key_here"
      }
    }
  }
}

Tools

Account & Market Data

| Tool | Description | |------|-------------| | get_auth_status | Check API key status, login, margin mode, permissions | | get_account | Balance, equity, margin, P&L, leverage | | get_positions | All open positions with P&L | | get_orders | Pending limit/stop orders | | get_history | Deal history by period or date range | | get_symbols | All 400+ tradeable instruments | | get_symbol | Detailed spec for one symbol (digits, volume limits, spread, swaps, margins, sessions) | | get_quote | Live bid/ask prices for one or more symbols (max 20) |

Trading

| Tool | Description | |------|-------------| | trade | Open a position (buy/sell) with optional SL/TP | | close_position | Close a position (full or partial) | | modify_position | Change SL/TP on an existing position | | close_by | Close against an opposite position (hedging mode) | | reverse_position | Reverse a position direction | | close_all | Close all open positions | | close_symbol | Close all positions for one symbol |

Example Conversation

You: What's my account balance?

AI: calls get_account — Your balance is $988.00 with $888.00 free margin. Leverage is 1:1000. No open positions.

You: Buy 0.01 lots of EURUSD with a 50 pip stop loss

AI: calls get_symbol for EURUSD, then calls trade — Opened BUY 0.01 EURUSD at 1.15350. Set SL at 1.14850 (50 pips). Ticket #23015470.

You: How's that position doing?

AI: calls get_positions — EURUSD BUY 0.01 lots: opened at 1.15350, current price 1.15380, P&L: +$0.30.

API Documentation

License

MIT