Skip to main content

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


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.1.tar.gz (106.5 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.1-py3-none-any.whl (107.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alloc_context-0.1.1.tar.gz
  • Upload date:
  • Size: 106.5 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.1.tar.gz
Algorithm Hash digest
SHA256 52176273780a9f7c9ed78865b7b1c5b62816e534215cad5fb46c5462a72b05aa
MD5 c5a387d86d696364b43f770e72c62da4
BLAKE2b-256 6530754a2701a16f8ac812f4f5e03561108c8361e5545bd304fb87ec931d8d3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for alloc_context-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: alloc_context-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d38b65599c7212e7d84a695e01e92569831c8dcfa0427e1c2505b267018f1c4
MD5 fa97ff0d1206b3e38e91ebc4f0d78f67
BLAKE2b-256 872361792cac233f90c0aa711d41d8b45e93e3c0248314570d99c1fb61237553

See more details on using hashes here.

Provenance

The following attestation bundles were made for alloc_context-0.1.1-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