Crates.io | brk_mcp |
lib.rs | brk_mcp |
version | 0.0.95 |
created_at | 2025-06-24 10:02:14.391835+00 |
updated_at | 2025-08-28 10:48:03.879813+00 |
description | A bridge for LLMs to access BRK |
homepage | https://bitcoinresearchkit.org |
repository | https://github.com/bitcoinresearchkit/brk |
max_upload_size | |
id | 1724103 |
size | 84,817 |
Model Context Protocol (MCP) bridge for LLM integration with BRK
brk_mcp
provides a Model Context Protocol server that enables Large Language Models (LLMs) to access Bitcoin blockchain data through BRK's interface layer. It implements the MCP specification to expose BRK's analytics capabilities as tools that LLMs can call.
Based on the actual implementation, the following tools are available:
get_index_count
Get the count of all existing indexes.
Parameters: None Returns: Number of available time indices
get_vecid_count
Get the count of all existing vector IDs.
Parameters: None Returns: Number of available dataset identifiers
get_vec_count
Get the count of all existing vectors (sum of supported indexes for each vector ID).
Parameters: None Returns: Total number of vector/index combinations
get_indexes
Get the list of all existing indexes.
Parameters: None Returns: Array of available index names (height, date, week, month, etc.)
get_accepted_indexes
Get an object with all existing indexes as keys and their accepted variants as values.
Parameters: None Returns: Object mapping indexes to their accepted variant names
get_vecids
Get a paginated list of all existing vector IDs.
Parameters:
page
(optional number): Page number (default: 0, up to 1,000 results per page)Returns: Array of dataset identifiers
get_index_to_vecids
Get a paginated list of all vector IDs which support a given index.
Parameters:
index
(string): Index name to querypage
(optional number): Page number (default: 0)Returns: Array of vector IDs that support the specified index
get_vecid_to_indexes
Get a list of all indexes supported by a given vector ID.
Parameters:
id
(string): Vector ID to queryReturns: Array of indexes supported by the vector ID (empty if ID doesn't exist)
get_vecs
Get one or multiple vectors depending on given parameters.
Parameters:
index
(string): Time dimension (height, date, week, month, etc.)ids
(string): Dataset identifiers (comma or space separated)from
(optional i64): Start index (negative = from end)to
(optional i64): End index (exclusive)count
(optional usize): Maximum resultsformat
(optional string): Output format (json, csv, tsv, md)Response format depends on parameters:
from=-1
)from=-100&count=100
)get_version
Get the running version of the Bitcoin Research Kit.
Parameters: None Returns: Version string (e.g., "v0.0.88")
1. Call get_indexes to see available time dimensions
2. Call get_vecids to see available datasets (paginated)
3. Call get_index_to_vecids to find datasets for specific timeframes
4. Call get_vecs to query actual data
// Get latest Bitcoin price
{
"tool": "get_vecs",
"parameters": {
"index": "date",
"ids": "close",
"from": -1
}
}
// Get last 30 days of OHLC data
{
"tool": "get_vecs",
"parameters": {
"index": "date",
"ids": "open,high,low,close",
"from": -30,
"format": "csv"
}
}
// Discover what's available
{
"tool": "get_accepted_indexes"
}
// Find datasets for weekly analysis
{
"tool": "get_index_to_vecids",
"parameters": {
"index": "week"
}
}
The MCP server is stateless and integrates with BRK's HTTP server:
// In brk_server routes
router.add_mcp_routes(interface, true) // Enable MCP at /mcp endpoint
Server Info:
The MCP server provides structured error responses following MCP specification:
MCP is exposed at the /mcp
endpoint when enabled:
POST /mcp
Content-Type: application/json
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "get_vecs",
"arguments": {
"index": "height",
"ids": "timestamp,size",
"from": -1
}
}
}
The server provides context to LLMs:
brk_interface
- Data access and formatting layerbrk_rmcp
- Rust MCP implementationaxum
- HTTP router integrationlog
- Request loggingThis README was generated by Claude Code