Skip to main content

A stdio bridge for the TraderFit MCP API

Project description

TraderFit Bridge (StdIO)

This package provides a Machine Cognition Protocol (MCP) bridge using standard input/output (stdio) to connect an MCP client (like Cursor) to the TraderFitAI backend API.

Features

  • Dynamically fetches available tools from the TraderFitAI OpenAPI schema.
  • Executes tool calls by forwarding requests to the TraderFitAI API.
  • Authenticates with the backend using an API key provided via environment variable.

Installation

# Coming soon to PyPI!
# pip install traderfit-bridge 

(Currently, installation requires cloning the repository and setting up the environment manually - see Development Setup below)

Configuration (Command-Based - Current Method)

To use this bridge with Cursor, you need to configure it in your ~/.cursor/mcp.json file within the "mcpServers" section.

Important: You must replace the placeholder paths with the absolute paths on your local machine.

  1. Generate an API key from the TraderFitAI platform dashboard.
  2. Clone this repository: git clone https://github.com/rizkisyaf/traderfit-bridge.git
  3. Navigate into the directory: cd traderfit-bridge
  4. Create and activate a Python virtual environment:
    python3 -m venv venv
    source venv/bin/activate 
    
  5. Install dependencies: pip install -e . (Installs in editable mode)
  6. Find the absolute path to the installed traderfit-bridge executable (usually within venv/bin/) and the project's root directory (pwd).
  7. Add the following configuration to your ~/.cursor/mcp.json, replacing placeholders:
{
    "mcpServers": {
        "traderfit": {
            "name": "TraderFit",
            "description": "TraderFitAI Bridge (StdIO)",
            "protocol": "stdio",
            "command": "/absolute/path/to/your/traderfit-bridge/venv/bin/traderfit-bridge",
            "cwd": "/absolute/path/to/your/traderfit-bridge", 
            "env": {
                "TRADERFIT_API_KEY": "YOUR_TRADERFIT_API_KEY_HERE",
                "TRADERFIT_MCP_URL": "https://traderfit-mcp.skolp.com" 
            }
        }
        // ... other servers ...
    }
}
  1. Reload MCP Clients in Cursor.

Configuration (Package-Based - Future)

(This method requires installing the package from PyPI: pip install traderfit-bridge)

Once the package is installed, the bridge can be configured using a simple package reference in ~/.cursor/mcp.json, provided you create a configuration file to store your API key.

  1. Install the package:

    pip install traderfit-bridge
    
  2. Create the configuration directory (if it doesn't exist):

    mkdir -p ~/.config/traderfit
    
  3. Create and edit the configuration file: ~/.config/traderfit/config.ini

  4. Add your credentials to the file:

    [Credentials]
    api_key = YOUR_TRADERFIT_API_KEY_HERE
    # Optional: Override the default backend URL
    # backend_url = https://your-custom-backend.com
    

    Replace YOUR_TRADERFIT_API_KEY_HERE with the key generated from the TraderFitAI platform.

  5. Configure Cursor (~/.cursor/mcp.json):

    {
        "mcpServers": {
            "traderfit": {
                "name": "TraderFit",
                "description": "TraderFitAI Bridge",
                "package": "traderfit-bridge", 
                "version": "0.1.1" // Or the specific version you installed
                // No command, cwd, or env needed here if config file is used
            }
            // ... other servers ...
        }
    }
    
  6. Reload MCP Clients in Cursor.

Development Setup

  1. Clone the repository:

    git clone https://github.com/rizkisyaf/traderfit-bridge.git
    cd traderfit-bridge
    
  2. Create a Python virtual environment:

    python3 -m venv venv
    source venv/bin/activate 
    
  3. Install dependencies, including development tools:

    pip install -e ".[dev]" 
    

    (Note: Requires defining [project.optional-dependencies] in pyproject.toml if you have dev tools like pytest, ruff, etc.)

  4. Create a .env file in the project root with your API key for local testing:

    TRADERFIT_API_KEY=YOUR_TRADERFIT_API_KEY_HERE
    TRADERFIT_MCP_URL=https://traderfit-mcp.skolp.com 
    # Optional: Set LOG_LEVEL=DEBUG for more verbose logging
    # LOG_LEVEL=DEBUG 
    
  5. Run the bridge directly (for testing purposes):

    python -m traderfit_bridge.main 
    

License

This project is licensed under the MIT License - see the LICENSE file for details (if one exists).

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

traderfit_bridge-0.1.1.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

traderfit_bridge-0.1.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file traderfit_bridge-0.1.1.tar.gz.

File metadata

  • Download URL: traderfit_bridge-0.1.1.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for traderfit_bridge-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5312d9d010aed31658a413014b8e3b11f156cd7cbbe11528a5e667488123241b
MD5 b8fc4843bc5d98dbd90d6192a2b579c4
BLAKE2b-256 3134b3ddb0888afe8f4c071fad4df8e7c213e9a62240acf13130e8c8f39d99d5

See more details on using hashes here.

File details

Details for the file traderfit_bridge-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for traderfit_bridge-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b689b6f16551b555a2e8cdac3b5f05090b85b4b5a2649c6ac6ec1fdff7a82fcd
MD5 4504a5beca419f79616b5df3a280d6f2
BLAKE2b-256 d5a3446c580f4ee6b84abd7ec930b9e08501f04ed2d2c4229a0d46131a4fdb50

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