Skip to main content

Portfolio-aware crypto context — CEX or wallet holdings, holdings-scoped market, optional allocation analysis

Project description

AllocContext

smithery badge

mcp-name: io.github.AllocContext/alloc-context

Portfolio-aware crypto context for whatever you hold — discover your holdings, holdings-scoped market data, sentiment, macro, and regime; optional allocation analysis when you supply targets. Deterministic JSON over MCP.

New here? Cursor MCP setup — stdio in your editor, or self-hosting with local ingest. Organization: AllocContext on GitHub.

Privacy: nothing stored · one-time read-only · pass-through only when using live portfolio reads. See USE.md.

Quick start (Cursor, self-host)

1. Install

pip install "alloc-context[mcp]"
# From source: pip install -e ".[mcp]"

2. User config

Copy config/user.example.yaml to ~/.config/alloc-context/user.yaml and enable self-host:

self_host: true
config: /absolute/path/to/alloc-context/config/config.yaml

Copy config/config.example.yaml to config/config.yaml, add API keys via .env when you want exchange or macro feeds, then run ingest. See user-config.md and self-hosting.md.

3. MCP config

Add to your Cursor mcp.json (or project .cursor/mcp.json):

{
  "mcpServers": {
    "alloc-context": {
      "command": "alloc-context",
      "args": [
        "mcp",
        "--user-config",
        "/Users/you/.config/alloc-context/user.yaml"
      ]
    }
  }
}

Use an absolute path for --user-config.

4. Refresh facts (optional)

python -m alloccontext --config config/config.yaml ingest

Run before a session or when you want fresh macro/regime data. No cron required.

5. Ask your agent

Call get_context_bundle for a full snapshot. Pure math tools (check_allocation_band, get_rebalance_plan) work without portfolio credentials.

Full setup: cursor-mcp.md. Samples: examples.md.

Not financial advice.

MCP tools

Tool Purpose
get_context_bundle Full ContextBundle — holdings, market, sentiment, macro, delta, regime; optional allocation_analysis
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 holdings (CEX keys or public EVM wallet address)
get_expectation_review Score optional local theses against context (pass-through)

Market context is holdings-scoped: band assets (BTC/ETH) use OHLC bars; alt holdings (e.g. HYPE) use quote snapshots when cached. See context-bundle.md#market-coverage.

See mcp.md for arguments and resources.

Self-host and development

Run ingest and MCP on your machine — the primary supported path.

See self-hosting.md, local-dev.md (./scripts/dev-up.sh), or docker-self-host.md.

git clone git@github.com:AllocContext/alloc-context.git
cd alloc-context
python3.11 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev,mcp]"
cp .env.example .env
cp config/config.example.yaml config/config.yaml

python -m alloccontext ingest --dry-run
python -m alloccontext rollup --scope daily --stdout
pytest
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)

Optional HTTP MCP + x402 on your host: mcp-http.md.

Hosted MCP (retired)

AllocContext is self-host only. We no longer operate mcp.alloc-context.com. Legacy bridge/hosted docs: agent-integration.md.

Documentation

Document Purpose
docs/cursor-mcp.md Start here — Cursor stdio MCP
docs/self-hosting.md Local ingest + MCP
docs/user-config.md user.yaml reference
docs/deterministic-context-mcp-pattern.md Ingest → rollup → MCP pattern
docs/mcp.md MCP tools
docs/examples.md Sample tool JSON (redacted)
docs/context-bundle.md ContextBundle schema
docs/USE.md License and use policy
docs/local-dev.md Local internal MCP + dev ingest
docs/docker-self-host.md Docker Compose self-host
docs/distribution.md PyPI and MCP Registry
docs/publishing.md Release workflow
docs/agent-integration.md Legacy hosted HTTP + x402 (retired)

Contributing

GitHub Issues are welcome for bugs, schema feedback, and MCP API suggestions. Unsolicited pull requests are not expected — see CONTRIBUTING.md.

License

MIT License. Self-host via PyPI. See docs/USE.md.

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.2.17.tar.gz (185.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.2.17-py3-none-any.whl (174.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alloc_context-0.2.17.tar.gz
  • Upload date:
  • Size: 185.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.2.17.tar.gz
Algorithm Hash digest
SHA256 d9f1a5aab32ee3d1ab592c6ee00ebfc79b7d919605c854fcd5021e08d9decea9
MD5 6cdc29028646c6634d5c42516c61c6de
BLAKE2b-256 7cc5e1d9677c1ff362d12cbbeab74d4aa4a831fd012a778240b58dab0cde7cad

See more details on using hashes here.

Provenance

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

Publisher: release.yml on AllocContext/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.2.17-py3-none-any.whl.

File metadata

  • Download URL: alloc_context-0.2.17-py3-none-any.whl
  • Upload date:
  • Size: 174.8 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.2.17-py3-none-any.whl
Algorithm Hash digest
SHA256 30824fa9804ef6fef920d331aba38a7e706276b11f040ad7dad5f6e3c30e7687
MD5 b0f164fa7f4d137556926e327f8bb41b
BLAKE2b-256 cb1c1f65ebbff6fc25862e24142f0eb21ce988089ebb968722c747541fb647fb

See more details on using hashes here.

Provenance

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

Publisher: release.yml on AllocContext/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