Skip to main content

AllocContext — BTC/ETH allocation context, drift, and rebalance facts

Project description

AllocContext

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alloc_context-0.1.0.tar.gz (106.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alloc_context-0.1.0-py3-none-any.whl (107.4 kB view details)

Uploaded Python 3

File details

Details for the file alloc_context-0.1.0.tar.gz.

File metadata

  • Download URL: alloc_context-0.1.0.tar.gz
  • Upload date:
  • Size: 106.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for alloc_context-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b24d953639429d6a3563c7984157ff999380d342e722d3b39464ed3fed67bd75
MD5 4f330bdc6526043739246f90a1b7bc7f
BLAKE2b-256 d2dc6c5af06e9686dce67327a3dfbda72a775feba53e08380c9e28181c35c6c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for alloc_context-0.1.0.tar.gz:

Publisher: release.yml on negillett/alloc-context

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file alloc_context-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: alloc_context-0.1.0-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

Hashes for alloc_context-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bd5ba8669fe85042b74dd549287cc41e3bb3c53d9a67e6917a327a7433b2ac7
MD5 a4e580421fc4b5301f385202f9568b16
BLAKE2b-256 d999e8cddd6da74e9b560533a3f3fe6d12f9ae3a94ffe0543b4c776717d7a816

See more details on using hashes here.

Provenance

The following attestation bundles were made for alloc_context-0.1.0-py3-none-any.whl:

Publisher: release.yml on negillett/alloc-context

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page