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

# Install from PyPI
pip install traderfit-bridge

Configuration

This bridge uses the command-based configuration method for MCP clients like Cursor. The package includes a helper script to generate the necessary JSON snippet for you.

  1. Install the package:

    pip install traderfit-bridge
    
  2. Generate your API Key: Obtain your API key from the TraderFitAI platform dashboard.

  3. Generate MCP Configuration: Run the following command in your terminal, replacing YOUR_TRADERFIT_API_KEY_HERE with the key you obtained:

    python -m traderfit_bridge.main --api-key YOUR_TRADERFIT_API_KEY_HERE --print-mcp-config
    

    (Note: If python doesn't work, try python3)

  4. Copy the Output: The command will print a JSON object similar to the example below. Copy this entire object.

    {
        "mcpServers": {
            "traderfit": {
                "name": "TraderFit",
                "description": "TraderFitAI Bridge (via helper script)",
                "protocol": "stdio",
                "command": "/path/to/installed/traderfit-bridge", // Automatically detected path
                "cwd": "/path/to/parent/of/command", // Automatically detected path
                "env": {
                    "TRADERFIT_API_KEY": "YOUR_TRADERFIT_API_KEY_HERE", // Your key inserted here
                    "TRADERFIT_MCP_URL": "https://traderfit-mcp.skolp.com"
                }
            }
        }
    }
    

    (The command and cwd paths will be automatically detected based on your installation.)

  5. Configure Cursor: Open your Cursor configuration file (e.g., ~/.cursor/mcp.json) and paste the copied JSON object into the "mcpServers" section (or merge it if the section already exists).

  6. Reload MCP Clients: Reload the clients in Cursor (e.g., via the command palette).

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.2.2.tar.gz (13.3 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.2.2-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: traderfit_bridge-0.2.2.tar.gz
  • Upload date:
  • Size: 13.3 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.2.2.tar.gz
Algorithm Hash digest
SHA256 ecf52e5f92c2e99423e6ac13b29cba6737bed612fe1cf99ae1a9203d0aeeada2
MD5 b1d548db5bbaedb02eefbaa5a0d30e8a
BLAKE2b-256 5490f23c59971d1fe4acf3448c0cbcf9e724724787d09eccf7f106eda8af31c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for traderfit_bridge-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 27d209d15e6bc6b832cb443b4c967751477c46fd32860fe83e82b254738ce6c5
MD5 7900781ee36b7f61dafcc628b08afa3b
BLAKE2b-256 90a40127223715327bf6a4a4059d1141d6fbdcd06d74a64ccb1f09b08be36827

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