macropulse-mcp 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.
@@ -0,0 +1,12 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.egg-info/
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .coverage
8
+ htmlcov/
9
+ dist/
10
+ build/
11
+ .env
12
+ uv.lock
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MacroPulse Lab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,154 @@
1
+ Metadata-Version: 2.4
2
+ Name: macropulse-mcp
3
+ Version: 0.2.0
4
+ Summary: MCP server for MacroPulse: the daily macro regime (Statistical Jump Model) as tools for AI agents
5
+ Project-URL: Homepage, https://macropulse.live
6
+ Project-URL: Documentation, https://macropulse.live/api-docs
7
+ Project-URL: Repository, https://github.com/macropulse-lab/macropulse-mcp
8
+ Project-URL: Issues, https://github.com/macropulse-lab/macropulse-mcp/issues
9
+ Author-email: MacroPulse <support@macropulse.live>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: agents,claude,finance,llm,macro,mcp,regime
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Financial and Insurance Industry
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Office/Business :: Financial :: Investment
20
+ Requires-Python: >=3.12
21
+ Requires-Dist: httpx<1,>=0.27
22
+ Requires-Dist: mcp<3,>=2.3
23
+ Provides-Extra: dev
24
+ Requires-Dist: black>=24.0; extra == 'dev'
25
+ Requires-Dist: isort>=5.13; extra == 'dev'
26
+ Requires-Dist: jsonschema>=4.20; extra == 'dev'
27
+ Requires-Dist: mypy>=1.9; extra == 'dev'
28
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
29
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
30
+ Requires-Dist: pytest>=8.0; extra == 'dev'
31
+ Requires-Dist: pyyaml>=6.0; extra == 'dev'
32
+ Requires-Dist: ruff>=0.4; extra == 'dev'
33
+ Description-Content-Type: text/markdown
34
+
35
+ <div align="center">
36
+ <img src="https://raw.githubusercontent.com/macropulse-lab/macropulse-mcp/master/.github/brand/logo.svg" alt="MacroPulse" width="64" height="64">
37
+ </div>
38
+
39
+ # macropulse-mcp
40
+
41
+ <!-- mcp-name: io.github.macropulse-lab/macropulse-mcp -->
42
+
43
+ An [MCP](https://modelcontextprotocol.io) server for [MacroPulse](https://macropulse.live): the daily US macro regime as tools for any MCP client that runs local (stdio) servers. Example configs for Claude Code, Claude Desktop and Cursor below. No code to write.
44
+
45
+ Ask *"what macro regime are we in, and what does it mean?"* and the agent answers from the live MacroPulse feed.
46
+
47
+ MacroPulse assigns one of four regimes (expansion, recovery, tightening, risk-off) to every calendar day, weekends included, with a frozen, versioned model: PCA over 13 daily macro and market features, followed by a Statistical Jump Model (v4). The pipeline runs once a day at 21:00 UTC, after the US close.
48
+
49
+ ## Requirements
50
+
51
+ [uv](https://docs.astral.sh/uv/getting-started/installation/), which provides `uvx` and fetches a suitable Python for you. Alternatively `pipx install macropulse-mcp` or `pip install macropulse-mcp` on Python 3.12 or newer, then use `macropulse-mcp` as the command instead of `uvx macropulse-mcp`.
52
+
53
+ ## Configure
54
+
55
+ The API key is optional: the public tools work without one. A free key (no credit card) unlocks regime history; forecast, scorecard and liquidity need the Starter or Pro plan. Get a key at [macropulse.live](https://macropulse.live).
56
+
57
+ ### Claude Code
58
+
59
+ ```bash
60
+ claude mcp add --transport stdio macropulse -- uvx macropulse-mcp
61
+ # with a key:
62
+ claude mcp add --env MACROPULSE_API_KEY=mp_your_key --transport stdio macropulse -- uvx macropulse-mcp
63
+ ```
64
+
65
+ ### Claude Desktop
66
+
67
+ Edit `claude_desktop_config.json` (Settings → Developer → Edit Config):
68
+
69
+ ```json
70
+ {
71
+ "mcpServers": {
72
+ "macropulse": {
73
+ "command": "uvx",
74
+ "args": ["macropulse-mcp"],
75
+ "env": { "MACROPULSE_API_KEY": "mp_your_key" }
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ Leave out `env` to use only the public tools. Claude Desktop on macOS does not inherit your shell's `PATH`; if it reports `spawn uvx ENOENT`, replace `"uvx"` with the output of `which uvx` (macOS/Linux) or `where uvx` (Windows).
82
+
83
+ ### Cursor
84
+
85
+ Add the same block to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (one project):
86
+
87
+ ```json
88
+ {
89
+ "mcpServers": {
90
+ "macropulse": {
91
+ "command": "uvx",
92
+ "args": ["macropulse-mcp"],
93
+ "env": { "MACROPULSE_API_KEY": "mp_your_key" }
94
+ }
95
+ }
96
+ }
97
+ ```
98
+
99
+ ## Tools
100
+
101
+ All tools are read-only.
102
+
103
+ | Tool | Needs | Returns |
104
+ | --- | --- | --- |
105
+ | `get_current_regime` | nothing | The latest published regime, risk score, the regime's target equity exposure and MacroPulse's fixed one-line description of that regime (a characterization, not advice) |
106
+ | `get_signed_regime` | nothing | The current regime as MacroPulse's Ed25519-signed payload, returned exactly as served (the tool does not verify the signature) |
107
+ | `get_market_snapshot` | nothing | Regime with confidence and persistence, net Fed liquidity z-score and trend |
108
+ | `explain_regimes` | nothing (offline) | What the four regimes mean, their ids and target exposures, how and when the model runs |
109
+ | `get_regime_history` | key (Free: up to 30 rows) | Daily regime, risk score and regime probabilities, newest first; rows before 2026-07-03 are a hindsight backfill; optional `limit`, `start`, `end` |
110
+ | `get_forecast` | key, Starter or Pro | ARIMA projection of the regime probabilities for 1-10 business days (`horizon`) |
111
+ | `get_scorecard` | key, Starter or Pro | Five normalized macro signals on a -1 to 1 scale |
112
+ | `get_liquidity` | key, Starter or Pro | Net Fed liquidity time series (`limit`, 1-500) |
113
+
114
+ API results come back under `data`, next to a `source` field that marks them as third-party data rather than instructions for the agent. When a call fails, the tool returns a one-line error; for a missing or invalid key, a plan that lacks the data, a rate limit or an outage it says what to do next. The key is sent only in the `X-MacroPulse-Key` header and is never logged or echoed.
115
+
116
+ ## The four regimes
117
+
118
+ | Regime | id | Target equity exposure |
119
+ | --- | --- | --- |
120
+ | Expansion | 0 | 100% |
121
+ | Recovery | 1 | 75% |
122
+ | Tightening | 2 | 25% |
123
+ | Risk-Off | 3 | 0% |
124
+
125
+ The exposure is a rule of thumb attached to each label, not a recommendation for any portfolio. Regimes for dates before 2026-07-03, when v4 went live, are a backfill computed with hindsight.
126
+
127
+ ## Environment
128
+
129
+ | Variable | Default | Purpose |
130
+ | --- | --- | --- |
131
+ | `MACROPULSE_API_KEY` | unset | API key for the keyed tools |
132
+ | `MACROPULSE_API_BASE` | `https://api.macropulse.live` | API URL override for testing (https only; plain http only for localhost) |
133
+
134
+ **`MACROPULSE_API_BASE` receives your API key.** Every keyed call sends `MACROPULSE_API_KEY` to that host, so point it only at hosts you trust (normally leave it unset). Redirects are never followed.
135
+
136
+ ## Development
137
+
138
+ ```bash
139
+ pip install -e ".[dev]"
140
+ pytest # offline: the API is mocked
141
+ MACROPULSE_LIVE_SMOKE=1 pytest -m live # optional: read-only, public endpoints, no key
142
+ ```
143
+
144
+ ## Disclaimer
145
+
146
+ MacroPulse data is informational only and is not investment advice.
147
+
148
+ ## Links
149
+
150
+ [macropulse.live](https://macropulse.live) · [API docs](https://macropulse.live/api-docs) · [IRL](https://norve.dev), pre-execution compliance for trading agents, which uses the signed MacroPulse regime
151
+
152
+ ## License
153
+
154
+ MIT
@@ -0,0 +1,120 @@
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/macropulse-lab/macropulse-mcp/master/.github/brand/logo.svg" alt="MacroPulse" width="64" height="64">
3
+ </div>
4
+
5
+ # macropulse-mcp
6
+
7
+ <!-- mcp-name: io.github.macropulse-lab/macropulse-mcp -->
8
+
9
+ An [MCP](https://modelcontextprotocol.io) server for [MacroPulse](https://macropulse.live): the daily US macro regime as tools for any MCP client that runs local (stdio) servers. Example configs for Claude Code, Claude Desktop and Cursor below. No code to write.
10
+
11
+ Ask *"what macro regime are we in, and what does it mean?"* and the agent answers from the live MacroPulse feed.
12
+
13
+ MacroPulse assigns one of four regimes (expansion, recovery, tightening, risk-off) to every calendar day, weekends included, with a frozen, versioned model: PCA over 13 daily macro and market features, followed by a Statistical Jump Model (v4). The pipeline runs once a day at 21:00 UTC, after the US close.
14
+
15
+ ## Requirements
16
+
17
+ [uv](https://docs.astral.sh/uv/getting-started/installation/), which provides `uvx` and fetches a suitable Python for you. Alternatively `pipx install macropulse-mcp` or `pip install macropulse-mcp` on Python 3.12 or newer, then use `macropulse-mcp` as the command instead of `uvx macropulse-mcp`.
18
+
19
+ ## Configure
20
+
21
+ The API key is optional: the public tools work without one. A free key (no credit card) unlocks regime history; forecast, scorecard and liquidity need the Starter or Pro plan. Get a key at [macropulse.live](https://macropulse.live).
22
+
23
+ ### Claude Code
24
+
25
+ ```bash
26
+ claude mcp add --transport stdio macropulse -- uvx macropulse-mcp
27
+ # with a key:
28
+ claude mcp add --env MACROPULSE_API_KEY=mp_your_key --transport stdio macropulse -- uvx macropulse-mcp
29
+ ```
30
+
31
+ ### Claude Desktop
32
+
33
+ Edit `claude_desktop_config.json` (Settings → Developer → Edit Config):
34
+
35
+ ```json
36
+ {
37
+ "mcpServers": {
38
+ "macropulse": {
39
+ "command": "uvx",
40
+ "args": ["macropulse-mcp"],
41
+ "env": { "MACROPULSE_API_KEY": "mp_your_key" }
42
+ }
43
+ }
44
+ }
45
+ ```
46
+
47
+ Leave out `env` to use only the public tools. Claude Desktop on macOS does not inherit your shell's `PATH`; if it reports `spawn uvx ENOENT`, replace `"uvx"` with the output of `which uvx` (macOS/Linux) or `where uvx` (Windows).
48
+
49
+ ### Cursor
50
+
51
+ Add the same block to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (one project):
52
+
53
+ ```json
54
+ {
55
+ "mcpServers": {
56
+ "macropulse": {
57
+ "command": "uvx",
58
+ "args": ["macropulse-mcp"],
59
+ "env": { "MACROPULSE_API_KEY": "mp_your_key" }
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ ## Tools
66
+
67
+ All tools are read-only.
68
+
69
+ | Tool | Needs | Returns |
70
+ | --- | --- | --- |
71
+ | `get_current_regime` | nothing | The latest published regime, risk score, the regime's target equity exposure and MacroPulse's fixed one-line description of that regime (a characterization, not advice) |
72
+ | `get_signed_regime` | nothing | The current regime as MacroPulse's Ed25519-signed payload, returned exactly as served (the tool does not verify the signature) |
73
+ | `get_market_snapshot` | nothing | Regime with confidence and persistence, net Fed liquidity z-score and trend |
74
+ | `explain_regimes` | nothing (offline) | What the four regimes mean, their ids and target exposures, how and when the model runs |
75
+ | `get_regime_history` | key (Free: up to 30 rows) | Daily regime, risk score and regime probabilities, newest first; rows before 2026-07-03 are a hindsight backfill; optional `limit`, `start`, `end` |
76
+ | `get_forecast` | key, Starter or Pro | ARIMA projection of the regime probabilities for 1-10 business days (`horizon`) |
77
+ | `get_scorecard` | key, Starter or Pro | Five normalized macro signals on a -1 to 1 scale |
78
+ | `get_liquidity` | key, Starter or Pro | Net Fed liquidity time series (`limit`, 1-500) |
79
+
80
+ API results come back under `data`, next to a `source` field that marks them as third-party data rather than instructions for the agent. When a call fails, the tool returns a one-line error; for a missing or invalid key, a plan that lacks the data, a rate limit or an outage it says what to do next. The key is sent only in the `X-MacroPulse-Key` header and is never logged or echoed.
81
+
82
+ ## The four regimes
83
+
84
+ | Regime | id | Target equity exposure |
85
+ | --- | --- | --- |
86
+ | Expansion | 0 | 100% |
87
+ | Recovery | 1 | 75% |
88
+ | Tightening | 2 | 25% |
89
+ | Risk-Off | 3 | 0% |
90
+
91
+ The exposure is a rule of thumb attached to each label, not a recommendation for any portfolio. Regimes for dates before 2026-07-03, when v4 went live, are a backfill computed with hindsight.
92
+
93
+ ## Environment
94
+
95
+ | Variable | Default | Purpose |
96
+ | --- | --- | --- |
97
+ | `MACROPULSE_API_KEY` | unset | API key for the keyed tools |
98
+ | `MACROPULSE_API_BASE` | `https://api.macropulse.live` | API URL override for testing (https only; plain http only for localhost) |
99
+
100
+ **`MACROPULSE_API_BASE` receives your API key.** Every keyed call sends `MACROPULSE_API_KEY` to that host, so point it only at hosts you trust (normally leave it unset). Redirects are never followed.
101
+
102
+ ## Development
103
+
104
+ ```bash
105
+ pip install -e ".[dev]"
106
+ pytest # offline: the API is mocked
107
+ MACROPULSE_LIVE_SMOKE=1 pytest -m live # optional: read-only, public endpoints, no key
108
+ ```
109
+
110
+ ## Disclaimer
111
+
112
+ MacroPulse data is informational only and is not investment advice.
113
+
114
+ ## Links
115
+
116
+ [macropulse.live](https://macropulse.live) · [API docs](https://macropulse.live/api-docs) · [IRL](https://norve.dev), pre-execution compliance for trading agents, which uses the signed MacroPulse regime
117
+
118
+ ## License
119
+
120
+ MIT
@@ -0,0 +1,88 @@
1
+ [project]
2
+ name = "macropulse-mcp"
3
+ dynamic = ["version"]
4
+ description = "MCP server for MacroPulse: the daily macro regime (Statistical Jump Model) as tools for AI agents"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ requires-python = ">=3.12"
9
+ authors = [{ name = "MacroPulse", email = "support@macropulse.live" }]
10
+ keywords = ["mcp", "macro", "regime", "finance", "claude", "llm", "agents"]
11
+ classifiers = [
12
+ "Development Status :: 3 - Alpha",
13
+ "Intended Audience :: Developers",
14
+ "Intended Audience :: Financial and Insurance Industry",
15
+ "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3.12",
17
+ "Programming Language :: Python :: 3.13",
18
+ "Topic :: Office/Business :: Financial :: Investment",
19
+ ]
20
+ dependencies = [
21
+ "mcp>=2.3,<3",
22
+ "httpx>=0.27,<1",
23
+ ]
24
+
25
+ [project.urls]
26
+ Homepage = "https://macropulse.live"
27
+ Documentation = "https://macropulse.live/api-docs"
28
+ Repository = "https://github.com/macropulse-lab/macropulse-mcp"
29
+ Issues = "https://github.com/macropulse-lab/macropulse-mcp/issues"
30
+
31
+ [project.scripts]
32
+ macropulse-mcp = "macropulse_mcp.server:main"
33
+
34
+ [project.optional-dependencies]
35
+ dev = [
36
+ "pytest>=8.0",
37
+ "pytest-asyncio>=0.23",
38
+ "pytest-cov>=5.0",
39
+ "jsonschema>=4.20",
40
+ "pyyaml>=6.0",
41
+ "black>=24.0",
42
+ "isort>=5.13",
43
+ "ruff>=0.4",
44
+ "mypy>=1.9",
45
+ ]
46
+
47
+ [build-system]
48
+ requires = ["hatchling>=1.27"]
49
+ build-backend = "hatchling.build"
50
+
51
+ [tool.hatch.version]
52
+ path = "src/macropulse_mcp/__init__.py"
53
+
54
+ [tool.hatch.build.targets.wheel]
55
+ packages = ["src/macropulse_mcp"]
56
+
57
+ [tool.hatch.build.targets.sdist]
58
+ include = ["src", "tests", "README.md", "LICENSE", "server.json", "pyproject.toml"]
59
+
60
+ [tool.pytest.ini_options]
61
+ testpaths = ["tests"]
62
+ asyncio_mode = "auto"
63
+ asyncio_default_fixture_loop_scope = "function"
64
+ markers = [
65
+ "live: read-only smoke test against the public production API (set MACROPULSE_LIVE_SMOKE=1)",
66
+ ]
67
+
68
+ [tool.black]
69
+ target-version = ["py312"]
70
+ line-length = 100
71
+
72
+ [tool.isort]
73
+ profile = "black"
74
+ line_length = 100
75
+
76
+ [tool.ruff]
77
+ line-length = 100
78
+
79
+ [tool.ruff.lint]
80
+ select = ["E", "F", "W", "B", "UP", "S", "BLE"]
81
+
82
+ [tool.ruff.lint.per-file-ignores]
83
+ "tests/*" = ["S101", "S105", "S106", "S603"]
84
+
85
+ [tool.mypy]
86
+ python_version = "3.12"
87
+ ignore_missing_imports = true
88
+ strict = true
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.macropulse-lab/macropulse-mcp",
4
+ "title": "MacroPulse",
5
+ "description": "Daily US macro regime (expansion, recovery, tightening, risk-off) from MacroPulse.",
6
+ "repository": {
7
+ "url": "https://github.com/macropulse-lab/macropulse-mcp",
8
+ "source": "github"
9
+ },
10
+ "websiteUrl": "https://macropulse.live",
11
+ "version": "0.2.0",
12
+ "packages": [
13
+ {
14
+ "registryType": "pypi",
15
+ "identifier": "macropulse-mcp",
16
+ "version": "0.2.0",
17
+ "runtimeHint": "uvx",
18
+ "transport": {
19
+ "type": "stdio"
20
+ },
21
+ "environmentVariables": [
22
+ {
23
+ "name": "MACROPULSE_API_KEY",
24
+ "description": "MacroPulse API key. Optional: public tools work without it. Free key at https://macropulse.live; forecast, scorecard and liquidity need Starter or Pro.",
25
+ "isRequired": false,
26
+ "isSecret": true
27
+ },
28
+ {
29
+ "name": "MACROPULSE_API_BASE",
30
+ "description": "API URL override for testing (https only). Default: https://api.macropulse.live",
31
+ "isRequired": false
32
+ }
33
+ ]
34
+ }
35
+ ]
36
+ }
@@ -0,0 +1,3 @@
1
+ """MacroPulse MCP server: the daily macro regime as MCP tools."""
2
+
3
+ __version__ = "0.2.0"
@@ -0,0 +1,3 @@
1
+ from macropulse_mcp.server import main
2
+
3
+ main()