An MCP (Model Context Protocol) server to interact with the Bit2Me ecosystem. This server allows AI assistants like Claude to access real-time market data, manage wallets, execute trading operations, and query products like Earn and Loans.
For more information, visit: https://mcp.bit2me.com
Bit2Me is a leading cryptocurrency exchange based in Spain, offering a wide range of services including trading, staking (Earn), and loans. This MCP server acts as a bridge, enabling LLMs to perform actions and retrieve data securely from your Bit2Me account.
- General: Asset information, account details, and portfolio valuation.
- Wallet Management: Query balances, transactions, and wallet (Pockets) details.
- Pro Trading: Manage orders (Limit, Market, Stop), query open orders, and transfer funds between Wallet and Pro.
- Earn & Loans: Manage Earn (Staking) strategies and collateralized loans.
- Operations: Execute trades, transfers, and withdrawals securely.
The server currently exposes 47 tools grouped as follows:
- 3 General tools
- 7 Broker (Simple Trading) tools
- 5 Wallet tools
- 14 Pro Trading tools
- 11 Earn (Staking) tools
- 7 Loan tools
Full descriptions, response schemas, Bit2Me REST endpoints and usage notes live in TOOLS_DOCUMENTATION.md.
All tool responses are normalised for LLM consumption (consistent naming, flattened payloads, concise metadata). Use the following references when developing new tooling:
TOOLS_DOCUMENTATION.md– Auto-generated catalogue with descriptions, Bit2Me endpoints and response schemas for each tool.data/tools.json– Source metadata powering the landing page (includes request/response schemas and examples for each tool).
- Node.js: v18 or higher.
- Bit2Me Account: You need a verified Bit2Me account.
The recommended way to authenticate is using API Keys. This method is secure, granular, and designed for programmatic access.
- Go to your Bit2Me API Dashboard.
- Click on "New Key".
- Select the permissions you need (e.g., Wallets, Trading, Earn, Loans).
⚠️ Security Note: This MCP server does NOT support crypto withdrawals to external blockchain addresses or transfers to other users. For security best practices, please DO NOT enable "Withdrawal" permissions on your API Key. Internal transfers between your own Bit2Me wallets (Wallet ↔ Pro ↔ Earn) are fully supported.
All tools support an optional jwt parameter for session-based authentication. This is useful for:
- Multi-tenant applications: Where each request is made on behalf of a different user.
- Web integrations: Where users are already authenticated via the Bit2Me web interface.
When the jwt parameter is provided, the server will use cookie-based authentication instead of API Keys.
// Example: Using JWT session token
const result = await mcpClient.callTool("wallet_get_pockets", {
symbol: "BTC",
jwt: "user_session_token_here" // Optional - uses API keys if omitted
});📝 Note: API Keys are recommended for most use cases. The
jwtparameter should only be used when building multi-tenant applications or web integrations where users have existing Bit2Me sessions.
-
Clone the repository:
git clone https://github.com/bit2me-devs/bit2me-mcp.git cd bit2me-mcp -
Install dependencies:
npm install
-
Configure environment variables: Create a
.envfile in the root directory:cp .env.example .env
Edit
.envand add your keys:BIT2ME_API_KEY=YOUR_BIT2ME_ACCOUNT_API_KEY BIT2ME_API_SECRET=YOUR_BIT2ME_ACCOUNT_API_SECRET # Optional Configuration BIT2ME_GATEWAY_URL=https://gateway.bit2me.com # API Gateway URL (default: https://gateway.bit2me.com) BIT2ME_REQUEST_TIMEOUT=30000 # Request timeout in ms (default: 30000) BIT2ME_MAX_RETRIES=3 # Max retries for rate limits (default: 3) BIT2ME_RETRY_BASE_DELAY=1000 # Base delay for backoff in ms (default: 1000) BIT2ME_LOG_LEVEL=info # Log level: debug, info, warn, error (default: info)
💡 QA/Staging: Use
BIT2ME_GATEWAY_URLto point to different environments (e.g.,https://qa-gateway.bit2me.comfor QA testing). -
Build the project:
npm run build
To use this server with the Claude Desktop application, add the following configuration to your claude_desktop_config.json file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"bit2me": {
"command": "node",
"args": ["/absolute/path/to/bit2me-mcp/build/index.js"],
"env": {
"BIT2ME_API_KEY": "YOUR_BIT2ME_ACCOUNT_API_KEY",
"BIT2ME_API_SECRET": "YOUR_BIT2ME_ACCOUNT_API_SECRET"
}
}
}
}Note: Replace
/absolute/path/to/...with the actual full path to your project.
For testing against different environments, add the BIT2ME_GATEWAY_URL variable:
{
"mcpServers": {
"bit2me": {
"command": "node",
"args": ["/absolute/path/to/bit2me-mcp/build/index.js"],
"env": {
"BIT2ME_API_KEY": "YOUR_BIT2ME_ACCOUNT_API_KEY",
"BIT2ME_API_SECRET": "YOUR_BIT2ME_ACCOUNT_API_SECRET",
"BIT2ME_GATEWAY_URL": "https://qa-gateway.bit2me.com"
}
}
}
}For detailed information about reporting vulnerabilities and our security policy, please see SECURITY.md.
- API Keys: Never commit API keys to version control.
- Permissions: Use minimal permissions. Avoid "Withdrawal" permissions for MCP usage.
- Logging: The server automatically sanitizes sensitive data in logs.
The Bit2Me API enforces rate limits to ensure stability.
- 429 Too Many Requests: If the server hits a rate limit, it will automatically retry the request after a 1-second delay (up to 3 retries).
- Console Warnings: You may see warnings in the logs if rate limits are hit.
- Best Practice: Avoid asking for massive amounts of data in a very short loop.
- Exponential Backoff: The server now uses exponential backoff with jitter for retries to handle rate limits more gracefully.
The server implements a structured logging system that automatically sanitizes sensitive data (API keys, signatures).
You can control the verbosity using the BIT2ME_LOG_LEVEL environment variable:
debug: Detailed request/response logs (useful for development)info: Startup and operational events (default)warn: Rate limits and non-critical issueserror: API errors and failures
- Ensure the MCP server is running.
- Check that the path in
claude_desktop_config.jsonpoints correctly to thebuild/index.jsfile.
- Verify your keys in
.envor the Claude config. - Ensure your API keys have the necessary permissions (Wallet, Trade, Earn, etc.) enabled in the Bit2Me dashboard.
- Check that there are no extra spaces or quotes around the API key values.
- The Bit2Me API has rate limits. The server automatically retries with exponential backoff.
- If you're hitting rate limits frequently, reduce the number of concurrent requests.
- Consider adding delays between operations in your workflows.
- Restart Claude Desktop completely (quit and reopen).
- Check the Claude Desktop logs for initialization errors.
- Verify the configuration file syntax is valid JSON.
- Check your internet connection.
- Increase
BIT2ME_REQUEST_TIMEOUTin your environment variables (default: 30000ms). - Some Bit2Me API endpoints may be temporarily slow.
- When using
npx, environment variables must be set in the config file'senvsection. - For local development, ensure the
.envfile is in the project root. - The server prioritizes config-provided credentials over
.envfile values.
- The MCP server runs server-side and doesn't have CORS restrictions.
- Network errors usually indicate connectivity problems or API downtime.
- Check the Bit2Me status page or try again later.
- Run the server manually to see logs:
npm run dev
- Set
BIT2ME_LOG_LEVEL=debugfor detailed logging. - Check Claude Desktop logs:
- macOS:
~/Library/Logs/Claude/mcp*.log - Windows:
%APPDATA%\Claude\logs\mcp*.log
- macOS:
MCP Inspector is the official debugging tool for MCP servers. It provides a web interface to test your tools, view responses, and debug issues.
npm install -g @modelcontextprotocol/inspectorYou have two options to run the inspector:
Use the published package from npm - no build required:
export BIT2ME_API_KEY=YOUR_BIT2ME_ACCOUNT_API_KEY
export BIT2ME_API_SECRET=YOUR_BIT2ME_ACCOUNT_API_SECRET
npx -y @modelcontextprotocol/inspector npx @bit2me/mcp-serverFor development or testing unreleased changes:
# 1. Clone and build the project
git clone https://github.com/bit2me-devs/bit2me-mcp.git
cd bit2me-mcp
npm install
npm run build
# 2. Run the inspector
export BIT2ME_API_KEY=YOUR_BIT2ME_ACCOUNT_API_KEY
export BIT2ME_API_SECRET=YOUR_BIT2ME_ACCOUNT_API_SECRET
npx @modelcontextprotocol/inspector node build/index.jsNote: The inspector will automatically open at http://localhost:5173
The web interface provides:
-
Tools Tab:
- View all 47 available tools
- See input schemas for each tool
- Test tools with custom parameters
- View formatted responses
-
Resources Tab:
- Explore available resources (if any)
-
Prompts Tab:
- Test prompt templates (if configured)
-
Request/Response Logs:
- See all MCP protocol messages
- Debug communication issues
- View timing information
- Navigate to the Tools tab
- Select a tool (e.g.,
market_get_ticker) - Fill in the required parameters:
{ "base_symbol": "BTC", "quote_symbol": "EUR" } - Click Run to execute the tool
- View the formatted response in the output panel
The project's landing page is located in the /landing directory.
Deployment is automated using GitHub Actions.
How to update the website:
- Edit the HTML/CSS files in
/landing. - Push your changes to the
mainbranch. - The
.github/workflows/deploy.ymlaction will automatically publish the changes.
Domain:
The /landing/CNAME file manages the custom domain configuration.
We welcome contributions to improve this MCP server! Whether it's fixing bugs, adding new tools, or improving documentation, your help is appreciated.
Please read our Contributing Guidelines for details on:
- Setting up your development environment
- Running tests
- Commit conventions (Conventional Commits)
- Pull Request process
- Fork and Clone:
git clone https://github.com/bit2me-devs/bit2me-mcp.git
- Install Dependencies:
npm install
- Create a Branch:
git checkout -b feat/amazing-feature
For full details, check the CONTRIBUTING.md file.
Be respectful, inclusive, and constructive. We're all here to learn and build together.