AllocContext — BTC/ETH allocation context, drift, and rebalance facts
Project description
AllocContext
mcp-name: io.github.negillett/alloc-context
Allocation context for BTC/ETH — drift, band checks, USD rebalance moves, and a fused market backdrop (Fear & Greed, Kalshi, ETF flows, macro) as deterministic JSON over MCP.
The product is an agent-native MCP API with x402 pay-per-call on Base — see docs/mcp.md.
Hosted MCP (production)
Try the public endpoint without self-hosting:
| URL | https://mcp.alloc-context.com/mcp |
| Discovery | llms.txt, x402 manifest |
| Pricing | $0.02 cached context/math · $0.05 live ingest or portfolio |
| Payment | x402 on Base — USDC or EURC |
Agents find the service via CDP Bazaar. Integration guide: docs/agent-integration.md. Example JSON: docs/examples.md.
Try free locally (no payment): ./scripts/dev-up.sh — see
docs/local-dev.md.
Optional live portfolio reads use read-only exchange credentials passed in each request. Not financial advice.
ingest → store → rollup → MCP tools (+ optional x402 HTTP)
This package is facts and MCP only — ingest, rollups, and agent tools. Email, LLM synthesis, and alert delivery are out of scope for this repository.
Try it locally
git clone git@github.com:negillett/alloc-context.git
cd alloc-context
python3.11 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
cp .env.example .env # fill locally; never commit
cp config/config.example.yaml config/config.yaml
python -m alloccontext ingest --dry-run
python -m alloccontext rollup --scope daily --stdout
pytest
MCP (stdio): pip install -e ".[mcp]" then alloc-context mcp.
See docs/cursor-mcp.md.
Hosted MCP + x402: pip install -e ".[hosted]" then
alloc-context mcp --transport http --x402. See docs/mcp-http.md.
Local dev stack (internal MCP on :8001): ./scripts/dev-up.sh.
See docs/local-dev.md.
CLI entry point: alloc-context (same as python -m alloccontext).
Commands
| Command | Purpose |
|---|---|
python -m alloccontext ingest |
Pull configured sources → SQLite |
python -m alloccontext rollup --scope daily --stdout |
ContextBundle JSON (facts) |
python -m alloccontext status |
Per-source ingest ages, snapshots, MCP /health |
alloc-context mcp |
MCP server (stdio or HTTP) |
MCP tools
| Tool | Purpose |
|---|---|
get_context_bundle |
Full ContextBundle — portfolio, market, sentiment, macro, delta, regime |
get_market_context |
Sentiment, macro, ETF, breadth, and market fields (no portfolio) |
get_context_at |
Saved snapshot from ingest history at a given as_of |
get_context_delta |
Notable shifts between two saved snapshots |
get_rebalance_plan |
USD rebalance moves from allocation, target, and NAV |
check_allocation_band |
Drift vs target and whether allocation is outside the band |
check_allocation_bands |
Batch band checks for multiple target scenarios |
get_portfolio_state |
Live NAV and allocation from Kraken or Coinbase (credentials in request) |
See docs/mcp.md for arguments, pricing, and resources.
Documentation
| Document | Purpose |
|---|---|
| docs/mcp.md | MCP tools and x402 |
| docs/mcp-http.md | HTTP MCP + x402 setup |
| docs/mcp-discovery.md | Bazaar and agent discovery |
| docs/distribution.md | GitHub, PyPI, MCP Registry, directories |
| docs/agent-integration.md | Paid HTTP MCP + Bazaar for agents |
| docs/cursor-mcp.md | Cursor stdio MCP |
| docs/examples.md | Sample tool JSON (redacted) |
| docs/context-bundle.md | ContextBundle schema |
| docs/architecture.md | Pipeline and trust boundaries |
| docs/data-sources.md | Ingest sources |
| docs/self-hosting.md | Optional Linux/systemd ingest + MCP |
| docs/local-dev.md | Local internal MCP + dev ingest |
Contributing
GitHub Issues are welcome for bugs, schema feedback, and MCP API suggestions. Unsolicited pull requests are not expected — see CONTRIBUTING.md.
License
MIT — see LICENSE.
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 alloc_context-0.1.2.tar.gz.
File metadata
- Download URL: alloc_context-0.1.2.tar.gz
- Upload date:
- Size: 106.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ffc43eab566e29899f8d6fdc5c29a5a0683f88937aeede0bc78168a0a8b6a22
|
|
| MD5 |
6c8225eb0850cebbec5398d54cc3bcea
|
|
| BLAKE2b-256 |
22651b5097a2c4dbcb94412d05b80556abaea605b4fe9ff6b05fc0213366dc5c
|
Provenance
The following attestation bundles were made for alloc_context-0.1.2.tar.gz:
Publisher:
release.yml on negillett/alloc-context
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
alloc_context-0.1.2.tar.gz -
Subject digest:
0ffc43eab566e29899f8d6fdc5c29a5a0683f88937aeede0bc78168a0a8b6a22 - Sigstore transparency entry: 1671186165
- Sigstore integration time:
-
Permalink:
negillett/alloc-context@5370e4559ad748903a4fb291466bbc1aa0833589 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/negillett
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5370e4559ad748903a4fb291466bbc1aa0833589 -
Trigger Event:
push
-
Statement type:
File details
Details for the file alloc_context-0.1.2-py3-none-any.whl.
File metadata
- Download URL: alloc_context-0.1.2-py3-none-any.whl
- Upload date:
- Size: 107.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2c092b8e205be31ae19d1a8bdf57e0fd1e06f5bd61749e627af39d7d3862e99
|
|
| MD5 |
902030491b013d1f9529539a658adccd
|
|
| BLAKE2b-256 |
ac2f9e0308f42a49e39f0d6ccdda6bd1a02efb6d09e07b34482059a969c32549
|
Provenance
The following attestation bundles were made for alloc_context-0.1.2-py3-none-any.whl:
Publisher:
release.yml on negillett/alloc-context
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
alloc_context-0.1.2-py3-none-any.whl -
Subject digest:
b2c092b8e205be31ae19d1a8bdf57e0fd1e06f5bd61749e627af39d7d3862e99 - Sigstore transparency entry: 1671186275
- Sigstore integration time:
-
Permalink:
negillett/alloc-context@5370e4559ad748903a4fb291466bbc1aa0833589 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/negillett
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5370e4559ad748903a4fb291466bbc1aa0833589 -
Trigger Event:
push
-
Statement type: