MyFxBook MCP服务

一个为MyFxBook API提供的模型上下文协议(MCP)服务器,允许用户在任何MCP客户端(如Claude Desktop或Gemini)中本地交互其MyFxBook账户。

  • by biohazardxxx
  • JavaScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 biohazardxxx/myfxbook-mcp

使用说明

MyFxBook MCP Server

A Model Context Protocol (MCP) Server for the MyFxBook API. It provides tools to interact with your MyFxBook accounts natively within any MCP client (like Claude Desktop or Gemini).

Features

  • get_accounts: Retrieve a list of all your configured MyFxBook accounts.
  • get_open_trades: Fetch open trades for a specific account (requires account ID).
  • get_history: Retrieve the complete trade history for a specific account (requires account ID).

Prerequisites

  • Node.js installed on your machine
  • A valid MyFxBook account email and password

Setup

  1. Build the server:

    npm install
    npm run build
    
  2. Make sure the entry point has execution permissions (on UNIX systems):

    chmod +x build/index.js
    

Configuration

You must provide your MyFxBook credentials as environment variables.

Create a .env file in the project root:

MYFXBOOK_EMAIL=your_email@example.com
MYFXBOOK_PASSWORD=your_password

Installation as Claude Desktop Package

This project includes a manifest.json which allows it to be bundled as a Claude Desktop installable package (.mcpb).

  1. Ensure you have the build ready:

    npm run build
    
  2. (Alternative) Zip and Rename:

    • Compile the project: npm run build
    • Include manifest.json, package.json, and the build/ folder in a ZIP archive.
    • Rename the file extension from .zip to .mcpb.
    • Drag and drop this .mcpb file into Claude Desktop > Settings > Extensions.

Integrating with an MCP Client (Manual)

Add the following to your MCP client's configuration file (e.g., claude_desktop_config.json):

{
  "mcpServers": {
    "myfxbook": {
      "command": "node",
      "args": ["/path/to/myfxbook-mcp/build/index.js"],
      "env": {
        "MYFXBOOK_EMAIL": "your_email@example.com",
        "MYFXBOOK_PASSWORD": "your_password"
      }
    }
  }
}

Replace /path/to/myfxbook-mcp with the absolute path to this project.