AllocContext

السجل الرسمي المالية والمدفوعات

Self-host MCP: portfolio crypto context for agents. PyPI stdio; MIT.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

PYPI package alloc-context
Claude Code
claude mcp add alloccontext -- uvx alloc-context==0.3.0 mcp
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "alloccontext": {
            "command": "uvx",
            "args": [
                "alloc-context==0.3.0",
                "mcp"
            ]
        }
    }
}

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. AllocContext
  2. Quick start (Cursor, self-host)
  3. MCP tools
  4. Self-host and development
  5. Documentation
  6. Contributing
  7. License

AllocContext

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. Config and secrets

Copy config/config.example.yaml to config/config.yaml. Copy .env.example to .env and add read-only exchange keys when you want portfolio ingest or macro feeds. See self-hosting.md.

3. MCP config

Add to your global ~/.cursor/mcp.json:

{
  "mcpServers": {
    "alloc-context": {
      "command": "alloc-context",
      "args": [
        "--config",
        "/absolute/path/to/alloc-context/config/config.yaml",
        "mcp"
      ],
      "env": {
        "ALLOC_CONTEXT_DB": "/absolute/path/to/alloc-context/state/alloccontext.db"
      }
    }
  }
}

Use absolute paths. See cursor-mcp.example.json.

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

ToolPurpose
get_context_bundleFull ContextBundle — holdings, market, sentiment, macro, delta, regime; optional allocation_analysis
get_market_contextSentiment, macro, ETF, breadth, and market fields (no portfolio)
get_context_atSaved snapshot from ingest history at a given as_of
get_context_deltaNotable shifts between two saved snapshots
get_rebalance_planUSD rebalance moves from allocation, target, and NAV
check_allocation_bandDrift vs target and whether allocation is outside the band
check_allocation_bandsBatch band checks for multiple target scenarios
get_portfolio_stateLive NAV and holdings (CEX keys or public EVM wallet address)
get_expectation_reviewScore 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
CommandPurpose
python -m alloccontext ingestPull configured sources → SQLite
python -m alloccontext rollup --scope daily --stdoutContextBundle JSON (facts)
python -m alloccontext statusPer-source ingest ages, snapshots, MCP /health
alloc-context mcpMCP server (stdio or HTTP)

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

AllocContext is self-host only — we do not operate mcp.alloc-context.com. Quickstart: agent-onramp.md · cursor-mcp.md.

Documentation

DocumentPurpose
docs/agent-onramp.md~2 min quickstart
docs/cursor-mcp.mdCursor stdio MCP
docs/self-hosting.mdLocal ingest + MCP
docs/deterministic-context-mcp-pattern.mdIngest → rollup → MCP pattern
docs/mcp.mdMCP tools
docs/examples.mdSample tool JSON (redacted)
docs/context-bundle.mdContextBundle schema
docs/USE.mdLicense and use policy
docs/local-dev.mdLocal internal MCP + dev ingest
docs/docker-self-host.mdDocker Compose self-host
docs/distribution.mdPyPI and MCP Registry
docs/publishing.mdRelease workflow
docs/mcp-http.mdOptional HTTP + x402 (your host)
docs/user-config.mdBridge user.yaml (legacy archive)

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.

الأسئلة الشائعة

ما هو AllocContext؟

Self-host MCP: portfolio crypto context for agents. PyPI stdio; MIT.

كيف أثبّت AllocContext؟

يعمل على جهازك. في Claude Code: claude mcp add alloccontext -- uvx alloc-context==0.3.0 mcp. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج AllocContext إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل AllocContext مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون AllocContext؟

ينشره AllocContext. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.