Crypto Transactions
БесплатноНе проверенMCP server for tracking crypto transactions (trades, swaps, transfers) with exact Decimal precision, allowing LLM agents to log and query historical records wit
Описание
MCP server for tracking crypto transactions (trades, swaps, transfers) with exact Decimal precision, allowing LLM agents to log and query historical records with JSON or Notion persistence.
README
MCP server per tracciare transazioni e ordini eseguiti nel mercato crypto.
Espone tool MCP che permettono a un agent LLM (Claude, agy, ecc.) di
registrare trade, swap e trasferimenti con precisione Decimal esatta, e di
interrogare lo storico — con persistenza intercambiabile su un file JSON
locale o su un database Notion.
Quick Start
uv syncper installare le dipendenze.- Scegli un backend:
- JSON (default, zero config) — salta al punto 3.
- Notion — segui prima la sezione "Setup Notion da zero" qui sotto.
- Aggiungi il server alla configurazione del tuo host MCP: vedi "Configurazione Claude Desktop" o "Configurazione agy".
- Riavvia l'host e prova, ad esempio: "Ho comprato 0.1 BTC su Binance a 65000 USDT, fee 0.0001 BTC, registralo con log_transaction."
Architettura onion:
domain/— entitàCryptoTransaction(Pydantic v2, campi monetari inDecimal).sideèBUY/SELL(trade, incluso uno swap crypto/crypto) oppureTRANSFER(spostamento dello stesso asset tra due custodie); i due casi hanno requisiti diversi validati nel modello stesso (BUY/SELL richiedonoprice/value, TRANSFER richiedeto_exchange)interfaces/— portTransactionRepositoryeTransactionFiltersusecases/—LogTransactionUseCase(trade, upsert con merge parziale),LogTransferUseCase(transfer, stessa semantica di upsert),GetTransactionHistoryUseCaseinfrastructure/— adapter concreti del portTransactionRepository:JsonTransactionRepository, file JSON locale, path fissodata/crypto_transactions.jsonNotionTransactionRepository, database Notion (vedi sotto)
delivery/— serverFastMCP, tool MCP (log_transaction,log_transfer,get_transaction_history), wiring delle dipendenze infactories.py
Tool MCP
log_transaction— trade BUY/SELL, incluso uno swap tra due crypto (es. ETH/BTC): stessa forma di un trade normale, non serve un tool a parte. Supportafiat_value/fiat_currencyopzionali per fissare il controvalore fiat al momento dello scambio — fortemente consigliato per gli swap crypto/crypto, dove il soloprice(cambio relativo tra le due crypto) non permette di calcolare a posteriori il P&L realizzato né il cost-basis fiat del nuovo asset ricevuto.log_transfer— spostamento dello stesso asset tra due custodie (exchange→to_exchange), non un trade: nienteside/price, ma richiedeto_exchange.get_transaction_history— storico di entrambi, con filtri opzionali (symbol,exchange,sideincluso"TRANSFER",date_from/date_to).
Setup
uv sync
Copia .env.example in .env e valorizzalo: viene caricato automaticamente
all'avvio (main.py chiama load_dotenv()). Questo funziona anche quando il
server è lanciato da un host esterno (Claude Desktop, agy, ...) con
uv run --directory <path> main.py, perché --directory imposta la working
directory del processo sulla root del progetto, dove load_dotenv() cerca
.env di default — non serve duplicare i secret nel JSON di config
dell'host, che spesso è meno protetto di un .env locale gitignored.
Backend di persistenza
Selezionabile con la variabile d'ambiente TRANSACTION_REPOSITORY_BACKEND:
json(default) — nessuna configurazione aggiuntiva richiesta.notion— richiedeNOTION_TOKEN(token dell'integration Notion) eNOTION_DATABASE_ID.
Setup Notion da zero
Se non hai già un'integration Notion collegata a questo progetto, segui questi passi in ordine (richiede un account Notion con permessi di creare integration nel workspace):
- Crea l'integration — vai su notion.so/my-integrations → "+ New integration" → dai un nome (es. "Crypto Transactions MCP") → scegli il workspace → tipo "Internal".
- Abilita le capabilities — nella pagina di configurazione dell'integration, sotto "Capabilities", abilita: Read content, Update content, Insert content.
- Copia il token — tab "Secrets" → copia il valore di "Internal
Integration Secret" (inizia con
secret_ontn_). Questo è il tuoNOTION_TOKEN. - Crea il database — in Notion, crea un nuovo database (full-page o
inline) e configuralo con esattamente le property elencate nella tabella
sotto. La colonna "title" che Notion crea di default (di solito "Name")
va rinominata in
Transaction ID: ogni database Notion ne ha obbligatoriamente una, non è il nome del database ma la colonna che identifica ogni riga. - Condividi il database con l'integration — apri la pagina del database → menu "..." in alto a destra → "Connections" → cerca e collega l'integration creata al punto 1. Senza questo passaggio l'API risponde 404 anche con un token valido, perché i permessi Notion sono per-pagina, non workspace-wide.
- Trova il database ID — è nell'URL della pagina del database:
https://www.notion.so/<ID-senza-trattini>?v=.... Ad esempio, dahttps://www.notion.so/abcdef0123456789abcdef0123456789?v=...l'ID èabcdef0123456789abcdef0123456789. Questo è il tuoNOTION_DATABASE_ID. - Configura le variabili — nel tuo
.env(vedi sopra), o nel bloccoenvdell'host MCP:TRANSACTION_REPOSITORY_BACKEND=notion NOTION_TOKEN=<il secret del punto 3> NOTION_DATABASE_ID=<l'id del punto 6>
Il database Notion deve avere queste property (nome esatto e tipo):
| Property | Tipo |
|---|---|
Transaction ID |
title |
Tx Hash |
rich_text |
Exchange |
select |
To Exchange |
select |
Symbol |
select |
Side |
select (BUY, SELL, TRANSFER) |
Timestamp |
date (con orario, UTC) |
Amount |
number |
Price |
number |
Value |
number |
Fee Amount |
number |
Fee Asset |
select |
Fiat Value |
number |
Fiat Currency |
select |
Notes |
rich_text |
To Exchange, Price, Value, Fiat Value, Fiat Currency possono essere
vuoti (non si applicano a un TRANSFER, o sono opzionali su un trade).
Nota: i campi numerici su Notion sono number nativi (float64), non Decimal
esatti come nel backend JSON — sufficiente per gli importi reali di trading,
ma soggetto ai limiti di precisione di un float a doppia precisione.
Test
uv run pytest
Esecuzione manuale
uv run main.py
Configurazione Claude Desktop
Aggiungi al file claude_desktop_config.json (su macOS:
~/Library/Application Support/Claude/claude_desktop_config.json). Con un
.env già configurato alla root del progetto (vedi sopra) basta questo,
nessun secret nel JSON:
{
"mcpServers": {
"crypto-transactions": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/crypto-transactions-mcp",
"main.py"
]
}
}
}
In alternativa, se preferisci non usare un file .env, puoi passare le
variabili direttamente nel blocco env (sovrascrivono quelle di .env se
presenti entrambe):
{
"mcpServers": {
"crypto-transactions": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/crypto-transactions-mcp",
"main.py"
],
"env": {
"TRANSACTION_REPOSITORY_BACKEND": "notion",
"NOTION_TOKEN": "secret_...",
"NOTION_DATABASE_ID": "abcdef0123456789abcdef0123456789"
}
}
}
}
Configurazione agy
Stesso schema mcpServers, ma nel file .agents/mcp_config.json alla root del
progetto in cui usi agy (aggiungi la voce crypto-transactions accanto agli
altri server già presenti, senza rimuoverli). Vale la stessa cosa: con .env
configurato non serve il blocco env:
{
"mcpServers": {
"crypto-transactions": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/crypto-transactions-mcp",
"main.py"
]
}
}
}
Установка Crypto Transactions
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/bolesk/crypto-transactions-mcpFAQ
Crypto Transactions MCP бесплатный?
Да, Crypto Transactions MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Crypto Transactions?
Нет, Crypto Transactions работает без API-ключей и переменных окружения.
Crypto Transactions — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Crypto Transactions в Claude Desktop, Claude Code или Cursor?
Открой Crypto Transactions на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Stripe
Payments, customers, subscriptions
автор: Stripemalamutemayhem/unclick-agent-native-endpoints
110+ tools for AI agents spanning social media, finance, gaming, music, AU-specific services, and utilities. Zero-config local tools plus platform connectors. n
автор: malamutemayhemwhiteknightonhorse/APIbase
Unified API hub for AI agents with 56+ tools across travel (Amadeus, Sabre), prediction markets (Polymarket), crypto, and weather. Pay-per-call via x402 micropa
автор: whiteknightonhorsetrackerfitness729-jpg/sitelauncher-mcp-server
Deploy live HTTPS websites in seconds. Instant subdomains ($1 USDC) or custom .xyz domains ($10 USDC) on Base chain. Templates for crypto tokens and AI agent pr
Compare Crypto Transactions with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории finance
