@barfinex/provider-mcp
v1.0.4
Published
Swagger-driven MCP server bootstrap for Barfinex Provider API.
Readme
@barfinex/provider-mcp
MCP (Model Context Protocol) server that exposes the Barfinex Provider API as tools for AI assistants — use Cursor, Claude, or any MCP client to query accounts, orders, candles, detectors, and more without writing HTTP by hand.
The server is Swagger-driven: it fetches the Provider OpenAPI spec and registers one tool per API operation. New Provider endpoints automatically become available as MCP tools.
What it does
- Static tools —
provider_health,provider_request,provider_refresh_openapi_tools,provider_openapifor availability and fallback. - Dynamic tools — one tool per Provider REST operation (e.g.
provider_getAccounts,provider_getCandles) from OpenAPI. - Stdio transport — runs as a process; MCP clients connect via stdio (e.g. Cursor MCP config).
- Configurable —
PROVIDER_API_URL,PROVIDER_BEARER_TOKEN, optionalPROVIDER_MCP_INSECURE_TLSfor local HTTPS.
Installation
npm install @barfinex/provider-mcpQuick use
import { startProviderMcpServer } from '@barfinex/provider-mcp';
// Starts the MCP server (stdio). Typically run by your MCP client, e.g.:
// "command": "node", "args": ["path/to/run-mcp.js"]
await startProviderMcpServer();Configure your MCP client (e.g. Cursor) with the script that calls startProviderMcpServer(), and set PROVIDER_API_URL and PROVIDER_BEARER_TOKEN in the environment so the server can reach your Provider.
What's included
| Export | Purpose |
|--------|--------|
| startProviderMcpServer() | Starts the MCP server; uses stdio and loads OpenAPI from Provider. |
Environment: PROVIDER_API_URL, PROVIDER_BEARER_TOKEN, PROVIDER_MCP_INSECURE_TLS, PROVIDER_MCP_TIMEOUT_MS.
Documentation
- Provider MCP (AI tools) — Using Barfinex with MCP (AI tools) — setup, run modes, auth, troubleshooting.
- Provider — Installation provider, Provider API reference, Understanding Provider Logs.
- Barfinex — First Steps, Architecture, Typical problems and solutions.
Contributing
Improvements and feedback welcome. Community: Telegram · GitHub.
License
Licensed under the Apache License 2.0 with additional terms. Attribution to Barfin Network Limited and a link to https://barfinex.com are required. See LICENSE and the Barfinex site for details.
