alloc-context 0.1.1__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. alloc_context-0.2.0/LICENSE +93 -0
  2. {alloc_context-0.1.1 → alloc_context-0.2.0}/PKG-INFO +96 -59
  3. alloc_context-0.2.0/README.md +149 -0
  4. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloc_context.egg-info/PKG-INFO +96 -59
  5. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloc_context.egg-info/SOURCES.txt +30 -4
  6. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloc_context.egg-info/requires.txt +3 -0
  7. alloc_context-0.2.0/alloccontext/__init__.py +3 -0
  8. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/__main__.py +7 -2
  9. alloc_context-0.2.0/alloccontext/constants.py +10 -0
  10. alloc_context-0.2.0/alloccontext/ingest/alt_quote_registry.py +98 -0
  11. alloc_context-0.2.0/alloccontext/ingest/alt_quote_store.py +146 -0
  12. alloc_context-0.2.0/alloccontext/ingest/alt_quotes.py +205 -0
  13. alloc_context-0.2.0/alloccontext/ingest/asset_registry.py +88 -0
  14. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/coinbase_client.py +6 -11
  15. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/coinbase_portfolio.py +29 -5
  16. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/coingecko.py +31 -2
  17. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/coinmarketcap.py +2 -2
  18. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/etf_flows.py +4 -2
  19. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/exchange/coinbase_adapter.py +6 -1
  20. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/exchange/kraken_adapter.py +6 -1
  21. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/exchange/live.py +23 -28
  22. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/fear_greed.py +3 -2
  23. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/fred.py +3 -1
  24. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/kraken_client.py +23 -26
  25. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/kraken_portfolio.py +72 -26
  26. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/macro_calendar.py +2 -1
  27. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/market_snapshots.py +3 -2
  28. alloc_context-0.2.0/alloccontext/ingest/portfolio_holdings.py +149 -0
  29. alloc_context-0.2.0/alloccontext/ingest/quote_resolver.py +177 -0
  30. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/runner.py +10 -7
  31. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/mcp/assets.py +99 -22
  32. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/mcp/bazaar.py +79 -34
  33. alloc_context-0.2.0/alloccontext/mcp/bridge.py +303 -0
  34. alloc_context-0.2.0/alloccontext/mcp/bridge_portfolio.py +220 -0
  35. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/mcp/contracts.py +21 -3
  36. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/mcp/handlers.py +199 -57
  37. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/mcp/http.py +10 -2
  38. alloc_context-0.2.0/alloccontext/mcp/instructions.py +16 -0
  39. alloc_context-0.2.0/alloccontext/mcp/payer.py +44 -0
  40. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/mcp/payment_middleware.py +15 -2
  41. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/mcp/server.py +26 -26
  42. alloc_context-0.2.0/alloccontext/mcp/setup.py +124 -0
  43. alloc_context-0.2.0/alloccontext/mcp/staleness.py +91 -0
  44. alloc_context-0.2.0/alloccontext/mcp/upstream.py +122 -0
  45. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/mcp/validation.py +3 -1
  46. alloc_context-0.2.0/alloccontext/rollup/allocation_analysis.py +29 -0
  47. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/band.py +1 -1
  48. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/context.py +8 -1
  49. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/delta.py +92 -13
  50. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/portfolio.py +55 -41
  51. alloc_context-0.2.0/alloccontext/rollup/portfolio_payload.py +50 -0
  52. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/rebalance.py +1 -1
  53. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/regime.py +113 -9
  54. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/store/db.py +39 -1
  55. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/store/retention.py +4 -0
  56. alloc_context-0.2.0/alloccontext/user_config.py +174 -0
  57. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/x402_production_check.py +49 -32
  58. {alloc_context-0.1.1 → alloc_context-0.2.0}/pyproject.toml +20 -4
  59. alloc_context-0.2.0/tests/test_bridge.py +265 -0
  60. alloc_context-0.2.0/tests/test_bridge_portfolio.py +99 -0
  61. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_bump_version.py +2 -2
  62. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_coinbase_portfolio.py +34 -0
  63. alloc_context-0.2.0/tests/test_context_bundle_schema.py +54 -0
  64. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_context_snapshots.py +63 -8
  65. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_db_schema.py +38 -0
  66. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_deploy.py +7 -1
  67. alloc_context-0.2.0/tests/test_holdings_scoped_delta_regime.py +357 -0
  68. alloc_context-0.2.0/tests/test_holdings_scoped_market.py +233 -0
  69. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_horizon.py +25 -0
  70. alloc_context-0.1.1/tests/test_adr005_ingest.py → alloc_context-0.2.0/tests/test_live_ingest_handlers.py +45 -6
  71. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_mcp_assets_regime.py +32 -8
  72. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_mcp_bazaar.py +9 -0
  73. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_mcp_contracts.py +27 -11
  74. alloc_context-0.2.0/tests/test_mcp_data_staleness.py +49 -0
  75. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_mcp_http_lifecycle.py +9 -8
  76. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_mcp_live_portfolio.py +56 -0
  77. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_mcp_validation.py +14 -1
  78. alloc_context-0.2.0/tests/test_payer.py +38 -0
  79. alloc_context-0.2.0/tests/test_portfolio_holdings.py +166 -0
  80. alloc_context-0.2.0/tests/test_quote_resolver.py +196 -0
  81. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_script_runtime.py +16 -0
  82. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_security_hardening.py +35 -19
  83. alloc_context-0.2.0/tests/test_setup.py +27 -0
  84. alloc_context-0.2.0/tests/test_user_config.py +66 -0
  85. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_workflows.py +64 -39
  86. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_x402_bazaar_dynamic.py +12 -2
  87. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_x402_production_check.py +47 -5
  88. alloc_context-0.1.1/LICENSE +0 -21
  89. alloc_context-0.1.1/README.md +0 -114
  90. alloc_context-0.1.1/alloccontext/__init__.py +0 -3
  91. alloc_context-0.1.1/alloccontext/mcp/staleness.py +0 -30
  92. alloc_context-0.1.1/tests/test_mcp_freshness.py +0 -18
  93. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloc_context.egg-info/dependency_links.txt +0 -0
  94. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloc_context.egg-info/entry_points.txt +0 -0
  95. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloc_context.egg-info/top_level.txt +0 -0
  96. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/config.py +0 -0
  97. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/horizon.py +0 -0
  98. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/__init__.py +0 -0
  99. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/cf_benchmarks.py +0 -0
  100. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/cf_history.py +0 -0
  101. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/env_keys.py +0 -0
  102. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/exchange/__init__.py +0 -0
  103. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/exchange/portfolio.py +0 -0
  104. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/exchange/registry.py +0 -0
  105. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/exchange/types.py +0 -0
  106. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/exchange_http.py +0 -0
  107. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/http_errors.py +0 -0
  108. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/kalshi.py +0 -0
  109. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/kalshi_api.py +0 -0
  110. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/kalshi_client.py +0 -0
  111. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/kalshi_files.py +0 -0
  112. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/kalshi_state.py +0 -0
  113. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/macro_normalize.py +0 -0
  114. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/outcome.py +0 -0
  115. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/ingest/parse_helpers.py +0 -0
  116. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/mcp/__init__.py +0 -0
  117. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/mcp/x402_bazaar_dynamic.py +0 -0
  118. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/mcp/x402_config.py +0 -0
  119. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/mcp/x402_pricing.py +0 -0
  120. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/mcp/x402_stables.py +0 -0
  121. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/__init__.py +0 -0
  122. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/breadth.py +0 -0
  123. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/cf_math.py +0 -0
  124. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/cluster.py +0 -0
  125. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/cluster_config.py +0 -0
  126. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/comparison.py +0 -0
  127. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/etf.py +0 -0
  128. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/fear_greed.py +0 -0
  129. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/macro.py +0 -0
  130. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/sentiment.py +0 -0
  131. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/snapshots.py +0 -0
  132. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/rollup/tape.py +0 -0
  133. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/status_report.py +0 -0
  134. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/store/__init__.py +0 -0
  135. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/store/jsonutil.py +0 -0
  136. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/store/meta.py +0 -0
  137. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/store/status.py +0 -0
  138. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/timeutil.py +0 -0
  139. {alloc_context-0.1.1 → alloc_context-0.2.0}/alloccontext/x402_smoke_redact.py +0 -0
  140. {alloc_context-0.1.1 → alloc_context-0.2.0}/setup.cfg +0 -0
  141. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_backup_sqlite.py +0 -0
  142. /alloc_context-0.1.1/tests/test_scaffold.py → /alloc_context-0.2.0/tests/test_config_cli.py +0 -0
  143. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_dev_stack.py +0 -0
  144. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_etf.py +0 -0
  145. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_exchanges_config.py +0 -0
  146. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_fear_greed.py +0 -0
  147. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_fred.py +0 -0
  148. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_ingest_outcome.py +0 -0
  149. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_ingest_runner.py +0 -0
  150. /alloc_context-0.1.1/tests/test_qa_ingest_store.py → /alloc_context-0.2.0/tests/test_ingest_store_integration.py +0 -0
  151. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_kalshi_api.py +0 -0
  152. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_kraken_portfolio.py +0 -0
  153. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_macro.py +0 -0
  154. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_market_breadth.py +0 -0
  155. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_mcp_handlers.py +0 -0
  156. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_mcp_health.py +0 -0
  157. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_mcp_server.py +0 -0
  158. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_mcp_x402.py +0 -0
  159. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_mcp_x402_http.py +0 -0
  160. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_mcp_x402_pricing.py +0 -0
  161. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_mcp_x402_stables.py +0 -0
  162. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_rebalance.py +0 -0
  163. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_rollup.py +0 -0
  164. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_server_json.py +0 -0
  165. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_snapshots_and_delta.py +0 -0
  166. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_status_report.py +0 -0
  167. {alloc_context-0.1.1 → alloc_context-0.2.0}/tests/test_x402_smoke_redact.py +0 -0
@@ -0,0 +1,93 @@
1
+ Elastic License 2.0
2
+
3
+ URL: https://www.elastic.co/licensing/elastic-license
4
+
5
+ ## Acceptance
6
+
7
+ By using the software, you agree to all of the terms and conditions below.
8
+
9
+ ## Copyright License
10
+
11
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
12
+ non-sublicensable, non-transferable license to use, copy, distribute, make
13
+ available, and prepare derivative works of the software, in each case subject to
14
+ the limitations and conditions below.
15
+
16
+ ## Limitations
17
+
18
+ You may not provide the software to third parties as a hosted or managed
19
+ service, where the service provides users with access to any substantial set of
20
+ the features or functionality of the software.
21
+
22
+ You may not move, change, disable, or circumvent the license key functionality
23
+ in the software, and you may not remove or obscure any functionality in the
24
+ software that is protected by the license key.
25
+
26
+ You may not alter, remove, or obscure any licensing, copyright, or other notices
27
+ of the licensor in the software. Any use of the licensor’s trademarks is subject
28
+ to applicable law.
29
+
30
+ ## Patents
31
+
32
+ The licensor grants you a license, under any patent claims the licensor can
33
+ license, or becomes able to license, to make, have made, use, sell, offer for
34
+ sale, import and have imported the software, in each case subject to the
35
+ limitations and conditions in this license. This license does not cover any
36
+ patent claims that you cause to be infringed by modifications or additions to
37
+ the software. If you or your company make any written claim that the software
38
+ infringes or contributes to infringement of any patent, your patent license for
39
+ the software granted under these terms ends immediately. If your company makes
40
+ such a claim, your patent license ends immediately for work on behalf of your
41
+ company.
42
+
43
+ ## Notices
44
+
45
+ You must ensure that anyone who gets a copy of any part of the software from you
46
+ also gets a copy of these terms.
47
+
48
+ If you modify the software, you must include in any modified copies of the
49
+ software prominent notices stating that you have modified the software.
50
+
51
+ ## No Other Rights
52
+
53
+ These terms do not imply any licenses other than those expressly granted in
54
+ these terms.
55
+
56
+ ## Termination
57
+
58
+ If you use the software in violation of these terms, such use is not licensed,
59
+ and your licenses will automatically terminate. If the licensor provides you
60
+ with a notice of your violation, and you cease all violation of this license no
61
+ later than 30 days after you receive that notice, your licenses will be
62
+ reinstated retroactively. However, if you violate these terms after such
63
+ reinstatement, any additional violation of these terms will cause your licenses
64
+ to terminate automatically and permanently.
65
+
66
+ ## No Liability
67
+
68
+ *As far as the law allows, the software comes as is, without any warranty or
69
+ condition, and the licensor will not be liable to you for any damages arising
70
+ out of these terms or the use or nature of the software, under any kind of
71
+ legal claim.*
72
+
73
+ ## Definitions
74
+
75
+ The **licensor** is the entity offering these terms, and the **software** is the
76
+ software the licensor makes available under these terms, including any portion
77
+ of it.
78
+
79
+ **you** refers to the individual or entity agreeing to these terms.
80
+
81
+ **your company** is any legal entity, sole proprietorship, or other kind of
82
+ organization that you work for, plus all organizations that have control over,
83
+ are under the control of, or are under common control with that
84
+ organization. **control** means ownership of substantially all the assets of an
85
+ entity, or the power to direct its management and policies by vote, contract, or
86
+ otherwise. Control can be direct or indirect.
87
+
88
+ **your licenses** are all the licenses granted to you for the software under
89
+ these terms.
90
+
91
+ **use** means anything you do with the software requiring one of your licenses.
92
+
93
+ **trademark** means trademarks, service marks, and similar rights.
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alloc-context
3
- Version: 0.1.1
4
- Summary: AllocContext BTC/ETH allocation context, drift, and rebalance facts
5
- License: MIT
3
+ Version: 0.2.0
4
+ Summary: Portfolio-aware crypto context for agents — holdings, market, optional allocation analysis
5
+ License: Elastic-2.0
6
6
  Project-URL: Homepage, https://github.com/negillett/alloc-context
7
7
  Project-URL: Documentation, https://github.com/negillett/alloc-context/blob/main/docs/agent-integration.md
8
8
  Project-URL: Repository, https://github.com/negillett/alloc-context
@@ -12,7 +12,6 @@ Project-URL: MCP Server, https://mcp.alloc-context.com/mcp
12
12
  Keywords: mcp,x402,bitcoin,ethereum,portfolio,allocation,agents,crypto,rebalance
13
13
  Classifier: Development Status :: 4 - Beta
14
14
  Classifier: Intended Audience :: Developers
15
- Classifier: License :: OSI Approved :: MIT License
16
15
  Classifier: Programming Language :: Python :: 3
17
16
  Classifier: Programming Language :: Python :: 3.11
18
17
  Classifier: Programming Language :: Python :: 3.12
@@ -34,6 +33,9 @@ Requires-Dist: cdp-sdk>=1.46; extra == "hosted"
34
33
  Requires-Dist: uvicorn[standard]>=0.30; extra == "hosted"
35
34
  Provides-Extra: dev
36
35
  Requires-Dist: pytest>=8.0; extra == "dev"
36
+ Requires-Dist: pytest-cov>=6.0; extra == "dev"
37
+ Requires-Dist: bandit>=1.8; extra == "dev"
38
+ Requires-Dist: pip-audit>=2.9; extra == "dev"
37
39
  Requires-Dist: mcp>=1.6; extra == "dev"
38
40
  Requires-Dist: x402[evm,fastapi]>=2.0; extra == "dev"
39
41
  Requires-Dist: cdp-sdk>=1.46; extra == "dev"
@@ -44,16 +46,63 @@ Dynamic: license-file
44
46
 
45
47
  mcp-name: io.github.negillett/alloc-context
46
48
 
47
- **Allocation context for BTC/ETH** — drift, band checks, USD rebalance moves,
48
- and a fused market backdrop (Fear & Greed, Kalshi, ETF flows, macro) as
49
- deterministic JSON over MCP.
49
+ **Portfolio-aware crypto context for agents** — discover holdings, market,
50
+ sentiment, macro, and regime; optional allocation analysis. Deterministic
51
+ JSON over MCP with x402 pay-per-call on Base.
50
52
 
51
- The product is an **agent-native MCP API** with x402 pay-per-call on Base
52
- see [docs/mcp.md](docs/mcp.md).
53
+ > **Privacy:** nothing stored · one-time read-only · pass-through only your
54
+ > keys and portfolio never persist on our servers. See [USE.md](docs/USE.md).
53
55
 
54
- ## Hosted MCP (production)
56
+ ## Quick start (Cursor)
55
57
 
56
- Try the public endpoint without self-hosting:
58
+ **1. Install**
59
+
60
+ ```bash
61
+ pip install "alloc-context[mcp,hosted]"
62
+ # From source: pip install -e ".[mcp,hosted]"
63
+ ```
64
+
65
+ **2. User config**
66
+
67
+ Copy [config/user.example.yaml](config/user.example.yaml) to
68
+ `~/.config/alloc-context/user.yaml`. Add read-only exchange keys for portfolio
69
+ discovery (optional) and an x402 payer for hosted market context. See
70
+ [user-config.md](docs/user-config.md).
71
+
72
+ **3. MCP config**
73
+
74
+ Add to your Cursor `mcp.json` (or project `.cursor/mcp.json`):
75
+
76
+ ```json
77
+ {
78
+ "mcpServers": {
79
+ "alloc-context": {
80
+ "command": "alloc-context",
81
+ "args": [
82
+ "mcp",
83
+ "--user-config",
84
+ "/Users/you/.config/alloc-context/user.yaml"
85
+ ]
86
+ }
87
+ }
88
+ }
89
+ ```
90
+
91
+ Use an absolute path for `--user-config`. Example:
92
+ [cursor-mcp-bridge.example.json](docs/cursor-mcp-bridge.example.json).
93
+
94
+ **4. Ask your agent**
95
+
96
+ Call `get_context_bundle` for a full snapshot (holdings when keys are set,
97
+ market/sentiment/macro via hosted upstream). Pure math tools
98
+ (`check_allocation_band`, `get_rebalance_plan`) work without exchange keys.
99
+
100
+ Full setup guide: [cursor-mcp.md](docs/cursor-mcp.md). Sample responses:
101
+ [examples.md](docs/examples.md).
102
+
103
+ Not financial advice.
104
+
105
+ ## Hosted MCP
57
106
 
58
107
  | | |
59
108
  |--|--|
@@ -62,31 +111,37 @@ Try the public endpoint without self-hosting:
62
111
  | **Pricing** | **$0.02** cached context/math · **$0.05** live ingest or portfolio |
63
112
  | **Payment** | x402 on Base — USDC or EURC |
64
113
 
65
- Agents find the service via [CDP Bazaar](docs/mcp-discovery.md). Integration
66
- guide: [docs/agent-integration.md](docs/agent-integration.md). Example JSON:
67
- [docs/examples.md](docs/examples.md).
114
+ Agents and wallets connect directly to the hosted endpoint see
115
+ [agent-integration.md](docs/agent-integration.md). The Cursor bridge above
116
+ combines local portfolio reads with this upstream for market context.
68
117
 
69
- **Try free locally** (no payment): `./scripts/dev-up.sh` — see
70
- [docs/local-dev.md](docs/local-dev.md).
118
+ ## MCP tools
71
119
 
72
- Optional live portfolio reads use read-only exchange credentials passed in
73
- each request. Not financial advice.
120
+ | Tool | Purpose |
121
+ |------|---------|
122
+ | `get_context_bundle` | Full ContextBundle — holdings, market, sentiment, macro, delta, regime; optional `allocation_analysis` |
123
+ | `get_market_context` | Sentiment, macro, ETF, breadth, and market fields (no portfolio) |
124
+ | `get_context_at` | Saved snapshot from ingest history at a given `as_of` |
125
+ | `get_context_delta` | Notable shifts between two saved snapshots |
126
+ | `get_rebalance_plan` | USD rebalance moves from allocation, target, and NAV |
127
+ | `check_allocation_band` | Drift vs target and whether allocation is outside the band |
128
+ | `check_allocation_bands` | Batch band checks for multiple target scenarios |
129
+ | `get_portfolio_state` | Live NAV and holdings from Kraken or Coinbase |
74
130
 
75
- ```text
76
- ingest → store → rollup → MCP tools (+ optional x402 HTTP)
77
- ```
131
+ See [mcp.md](docs/mcp.md) for arguments, pricing, and resources.
78
132
 
79
- This package is **facts and MCP only** — ingest, rollups, and agent tools.
80
- Email, LLM synthesis, and alert delivery are out of scope for this repository.
133
+ ## Self-host and development
81
134
 
82
- ## Try it locally
135
+ Run ingest and MCP entirely on your machine — no x402 upstream required.
136
+ See [self-hosting.md](docs/self-hosting.md) (`self_host: true` in user config)
137
+ or [local-dev.md](docs/local-dev.md) for the dev stack.
83
138
 
84
139
  ```bash
85
140
  git clone git@github.com:negillett/alloc-context.git
86
141
  cd alloc-context
87
142
  python3.11 -m venv .venv && source .venv/bin/activate
88
143
  pip install -e ".[dev]"
89
- cp .env.example .env # fill locally; never commit
144
+ cp .env.example .env
90
145
  cp config/config.example.yaml config/config.yaml
91
146
 
92
147
  python -m alloccontext ingest --dry-run
@@ -94,19 +149,6 @@ python -m alloccontext rollup --scope daily --stdout
94
149
  pytest
95
150
  ```
96
151
 
97
- **MCP (stdio):** `pip install -e ".[mcp]"` then `alloc-context mcp`.
98
- See [docs/cursor-mcp.md](docs/cursor-mcp.md).
99
-
100
- **Hosted MCP + x402:** `pip install -e ".[hosted]"` then
101
- `alloc-context mcp --transport http --x402`. See [docs/mcp-http.md](docs/mcp-http.md).
102
-
103
- **Local dev stack (internal MCP on :8001):** `./scripts/dev-up.sh`.
104
- See [docs/local-dev.md](docs/local-dev.md).
105
-
106
- CLI entry point: `alloc-context` (same as `python -m alloccontext`).
107
-
108
- ## Commands
109
-
110
152
  | Command | Purpose |
111
153
  |---------|---------|
112
154
  | `python -m alloccontext ingest` | Pull configured sources → SQLite |
@@ -114,37 +156,29 @@ CLI entry point: `alloc-context` (same as `python -m alloccontext`).
114
156
  | `python -m alloccontext status` | Per-source ingest ages, snapshots, MCP `/health` |
115
157
  | `alloc-context mcp` | MCP server (stdio or HTTP) |
116
158
 
117
- ## MCP tools
118
-
119
- | Tool | Purpose |
120
- |------|---------|
121
- | `get_context_bundle` | Full ContextBundle — portfolio, market, sentiment, macro, delta, regime |
122
- | `get_market_context` | Sentiment, macro, ETF, breadth, and market fields (no portfolio) |
123
- | `get_context_at` | Saved snapshot from ingest history at a given `as_of` |
124
- | `get_context_delta` | Notable shifts between two saved snapshots |
125
- | `get_rebalance_plan` | USD rebalance moves from allocation, target, and NAV |
126
- | `check_allocation_band` | Drift vs target and whether allocation is outside the band |
127
- | `check_allocation_bands` | Batch band checks for multiple target scenarios |
128
- | `get_portfolio_state` | Live NAV and allocation from Kraken or Coinbase (credentials in request) |
129
-
130
- See [docs/mcp.md](docs/mcp.md) for arguments, pricing, and resources.
159
+ HTTP MCP + x402: [mcp-http.md](docs/mcp-http.md). CLI entry point:
160
+ `alloc-context` (same as `python -m alloccontext`).
131
161
 
132
162
  ## Documentation
133
163
 
134
164
  | Document | Purpose |
135
165
  |----------|---------|
166
+ | [docs/cursor-mcp.md](docs/cursor-mcp.md) | Cursor stdio MCP (bridge default) |
167
+ | [docs/user-config.md](docs/user-config.md) | Bridge `user.yaml` reference |
136
168
  | [docs/mcp.md](docs/mcp.md) | MCP tools and x402 |
137
- | [docs/mcp-http.md](docs/mcp-http.md) | HTTP MCP + x402 setup |
138
- | [docs/mcp-discovery.md](docs/mcp-discovery.md) | Bazaar and agent discovery |
139
- | [docs/distribution.md](docs/distribution.md) | GitHub, PyPI, MCP Registry, directories |
140
169
  | [docs/agent-integration.md](docs/agent-integration.md) | Paid HTTP MCP + Bazaar for agents |
141
- | [docs/cursor-mcp.md](docs/cursor-mcp.md) | Cursor stdio MCP |
142
170
  | [docs/examples.md](docs/examples.md) | Sample tool JSON (redacted) |
143
171
  | [docs/context-bundle.md](docs/context-bundle.md) | ContextBundle schema |
144
- | [docs/architecture.md](docs/architecture.md) | Pipeline and trust boundaries |
145
- | [docs/data-sources.md](docs/data-sources.md) | Ingest sources |
172
+ | [docs/USE.md](docs/USE.md) | Self-host vs hosted MCP (plain language) |
173
+ | [docs/mcp-http.md](docs/mcp-http.md) | HTTP MCP + x402 setup |
174
+ | [docs/mcp-discovery.md](docs/mcp-discovery.md) | Bazaar and agent discovery |
146
175
  | [docs/self-hosting.md](docs/self-hosting.md) | Optional Linux/systemd ingest + MCP |
147
176
  | [docs/local-dev.md](docs/local-dev.md) | Local internal MCP + dev ingest |
177
+ | [docs/architecture.md](docs/architecture.md) | Pipeline and trust boundaries |
178
+ | [docs/data-sources.md](docs/data-sources.md) | Ingest sources |
179
+ | [docs/distribution.md](docs/distribution.md) | GitHub, PyPI, MCP Registry, directories |
180
+ | [docs/publishing.md](docs/publishing.md) | Release workflow and version bumps |
181
+ | [docs/security-ci.md](docs/security-ci.md) | CI coverage, Bandit, and pip-audit gates |
148
182
 
149
183
  ## Contributing
150
184
 
@@ -153,4 +187,7 @@ Unsolicited pull requests are not expected — see [CONTRIBUTING.md](CONTRIBUTIN
153
187
 
154
188
  ## License
155
189
 
156
- MIT see [LICENSE](LICENSE).
190
+ [Elastic License 2.0](LICENSE) — source-available, self-host friendly. See
191
+ [docs/USE.md](docs/USE.md) for plain-language allowed uses.
192
+
193
+ **Official hosted MCP:** `https://mcp.alloc-context.com/mcp`
@@ -0,0 +1,149 @@
1
+ # AllocContext
2
+
3
+ mcp-name: io.github.negillett/alloc-context
4
+
5
+ **Portfolio-aware crypto context for agents** — discover holdings, market,
6
+ sentiment, macro, and regime; optional allocation analysis. Deterministic
7
+ JSON over MCP with x402 pay-per-call on Base.
8
+
9
+ > **Privacy:** nothing stored · one-time read-only · pass-through only — your
10
+ > keys and portfolio never persist on our servers. See [USE.md](docs/USE.md).
11
+
12
+ ## Quick start (Cursor)
13
+
14
+ **1. Install**
15
+
16
+ ```bash
17
+ pip install "alloc-context[mcp,hosted]"
18
+ # From source: pip install -e ".[mcp,hosted]"
19
+ ```
20
+
21
+ **2. User config**
22
+
23
+ Copy [config/user.example.yaml](config/user.example.yaml) to
24
+ `~/.config/alloc-context/user.yaml`. Add read-only exchange keys for portfolio
25
+ discovery (optional) and an x402 payer for hosted market context. See
26
+ [user-config.md](docs/user-config.md).
27
+
28
+ **3. MCP config**
29
+
30
+ Add to your Cursor `mcp.json` (or project `.cursor/mcp.json`):
31
+
32
+ ```json
33
+ {
34
+ "mcpServers": {
35
+ "alloc-context": {
36
+ "command": "alloc-context",
37
+ "args": [
38
+ "mcp",
39
+ "--user-config",
40
+ "/Users/you/.config/alloc-context/user.yaml"
41
+ ]
42
+ }
43
+ }
44
+ }
45
+ ```
46
+
47
+ Use an absolute path for `--user-config`. Example:
48
+ [cursor-mcp-bridge.example.json](docs/cursor-mcp-bridge.example.json).
49
+
50
+ **4. Ask your agent**
51
+
52
+ Call `get_context_bundle` for a full snapshot (holdings when keys are set,
53
+ market/sentiment/macro via hosted upstream). Pure math tools
54
+ (`check_allocation_band`, `get_rebalance_plan`) work without exchange keys.
55
+
56
+ Full setup guide: [cursor-mcp.md](docs/cursor-mcp.md). Sample responses:
57
+ [examples.md](docs/examples.md).
58
+
59
+ Not financial advice.
60
+
61
+ ## Hosted MCP
62
+
63
+ | | |
64
+ |--|--|
65
+ | **URL** | `https://mcp.alloc-context.com/mcp` |
66
+ | **Discovery** | [llms.txt](https://mcp.alloc-context.com/llms.txt), [x402 manifest](https://mcp.alloc-context.com/.well-known/x402.json) |
67
+ | **Pricing** | **$0.02** cached context/math · **$0.05** live ingest or portfolio |
68
+ | **Payment** | x402 on Base — USDC or EURC |
69
+
70
+ Agents and wallets connect directly to the hosted endpoint — see
71
+ [agent-integration.md](docs/agent-integration.md). The Cursor bridge above
72
+ combines local portfolio reads with this upstream for market context.
73
+
74
+ ## MCP tools
75
+
76
+ | Tool | Purpose |
77
+ |------|---------|
78
+ | `get_context_bundle` | Full ContextBundle — holdings, market, sentiment, macro, delta, regime; optional `allocation_analysis` |
79
+ | `get_market_context` | Sentiment, macro, ETF, breadth, and market fields (no portfolio) |
80
+ | `get_context_at` | Saved snapshot from ingest history at a given `as_of` |
81
+ | `get_context_delta` | Notable shifts between two saved snapshots |
82
+ | `get_rebalance_plan` | USD rebalance moves from allocation, target, and NAV |
83
+ | `check_allocation_band` | Drift vs target and whether allocation is outside the band |
84
+ | `check_allocation_bands` | Batch band checks for multiple target scenarios |
85
+ | `get_portfolio_state` | Live NAV and holdings from Kraken or Coinbase |
86
+
87
+ See [mcp.md](docs/mcp.md) for arguments, pricing, and resources.
88
+
89
+ ## Self-host and development
90
+
91
+ Run ingest and MCP entirely on your machine — no x402 upstream required.
92
+ See [self-hosting.md](docs/self-hosting.md) (`self_host: true` in user config)
93
+ or [local-dev.md](docs/local-dev.md) for the dev stack.
94
+
95
+ ```bash
96
+ git clone git@github.com:negillett/alloc-context.git
97
+ cd alloc-context
98
+ python3.11 -m venv .venv && source .venv/bin/activate
99
+ pip install -e ".[dev]"
100
+ cp .env.example .env
101
+ cp config/config.example.yaml config/config.yaml
102
+
103
+ python -m alloccontext ingest --dry-run
104
+ python -m alloccontext rollup --scope daily --stdout
105
+ pytest
106
+ ```
107
+
108
+ | Command | Purpose |
109
+ |---------|---------|
110
+ | `python -m alloccontext ingest` | Pull configured sources → SQLite |
111
+ | `python -m alloccontext rollup --scope daily --stdout` | ContextBundle JSON (facts) |
112
+ | `python -m alloccontext status` | Per-source ingest ages, snapshots, MCP `/health` |
113
+ | `alloc-context mcp` | MCP server (stdio or HTTP) |
114
+
115
+ HTTP MCP + x402: [mcp-http.md](docs/mcp-http.md). CLI entry point:
116
+ `alloc-context` (same as `python -m alloccontext`).
117
+
118
+ ## Documentation
119
+
120
+ | Document | Purpose |
121
+ |----------|---------|
122
+ | [docs/cursor-mcp.md](docs/cursor-mcp.md) | Cursor stdio MCP (bridge default) |
123
+ | [docs/user-config.md](docs/user-config.md) | Bridge `user.yaml` reference |
124
+ | [docs/mcp.md](docs/mcp.md) | MCP tools and x402 |
125
+ | [docs/agent-integration.md](docs/agent-integration.md) | Paid HTTP MCP + Bazaar for agents |
126
+ | [docs/examples.md](docs/examples.md) | Sample tool JSON (redacted) |
127
+ | [docs/context-bundle.md](docs/context-bundle.md) | ContextBundle schema |
128
+ | [docs/USE.md](docs/USE.md) | Self-host vs hosted MCP (plain language) |
129
+ | [docs/mcp-http.md](docs/mcp-http.md) | HTTP MCP + x402 setup |
130
+ | [docs/mcp-discovery.md](docs/mcp-discovery.md) | Bazaar and agent discovery |
131
+ | [docs/self-hosting.md](docs/self-hosting.md) | Optional Linux/systemd ingest + MCP |
132
+ | [docs/local-dev.md](docs/local-dev.md) | Local internal MCP + dev ingest |
133
+ | [docs/architecture.md](docs/architecture.md) | Pipeline and trust boundaries |
134
+ | [docs/data-sources.md](docs/data-sources.md) | Ingest sources |
135
+ | [docs/distribution.md](docs/distribution.md) | GitHub, PyPI, MCP Registry, directories |
136
+ | [docs/publishing.md](docs/publishing.md) | Release workflow and version bumps |
137
+ | [docs/security-ci.md](docs/security-ci.md) | CI coverage, Bandit, and pip-audit gates |
138
+
139
+ ## Contributing
140
+
141
+ GitHub Issues are welcome for bugs, schema feedback, and MCP API suggestions.
142
+ Unsolicited pull requests are not expected — see [CONTRIBUTING.md](CONTRIBUTING.md).
143
+
144
+ ## License
145
+
146
+ [Elastic License 2.0](LICENSE) — source-available, self-host friendly. See
147
+ [docs/USE.md](docs/USE.md) for plain-language allowed uses.
148
+
149
+ **Official hosted MCP:** `https://mcp.alloc-context.com/mcp`