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.
-
Install the package:
pip install traderfit-bridge
-
Generate your API Key: Obtain your API key from the TraderFitAI platform dashboard.
-
Generate MCP Configuration: Run the following command in your terminal, replacing
YOUR_TRADERFIT_API_KEY_HEREwith the key you obtained:python -m traderfit_bridge.main --api-key YOUR_TRADERFIT_API_KEY_HERE --print-mcp-config
(Note: If
pythondoesn't work, trypython3) -
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
commandandcwdpaths will be automatically detected based on your installation.) -
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). -
Reload MCP Clients: Reload the clients in Cursor (e.g., via the command palette).
Development Setup
-
Clone the repository:
git clone https://github.com/rizkisyaf/traderfit-bridge.git cd traderfit-bridge
-
Create a Python virtual environment:
python3 -m venv venv source venv/bin/activate
-
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.) -
Create a
.envfile 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
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file traderfit_bridge-0.2.9.tar.gz.
File metadata
- Download URL: traderfit_bridge-0.2.9.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
879de41d92877bcee4144109978c72462d3ceb34a041d724200a12877b18e52b
|
|
| MD5 |
c45bf3bb61a46094412a1e71eb1b0ce4
|
|
| BLAKE2b-256 |
75e3e4f870919176e6dbb921bda1a2919283136d6fe6d767f1e219e4ff266127
|
File details
Details for the file traderfit_bridge-0.2.9-py3-none-any.whl.
File metadata
- Download URL: traderfit_bridge-0.2.9-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2d6a3c9e7460b96af1eab8f591297f3958fb32506bfac7ffa2bbb5709b45057
|
|
| MD5 |
c8baf1929adc02b81fc8b41c5635ad7a
|
|
| BLAKE2b-256 |
bada8ca394d9237259a812d6f0a09e817a8dc4f231cf83c4c86dae9ac31cc0c4
|