offnadir-delta-mcp 1.2.0
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.
- package/LICENSE +201 -0
- package/README.md +83 -0
- package/dist/catalog.js +234 -0
- package/dist/index.js +85 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
+
Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Off-Nadir Lab
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Off-Nadir Delta — MCP server (stdio)
|
|
2
|
+
|
|
3
|
+
Local [Model Context Protocol](https://modelcontextprotocol.io) server for **[Off-Nadir Delta](https://offnadir-delta.com/mcp)** — live, geolocated world-event intelligence for AI agents.
|
|
4
|
+
|
|
5
|
+
It exposes the same tool surface as the hosted server and **forwards every call** to `https://offnadir-delta.com/api/v1/mcp` using your API key. Use this if your client prefers a local stdio server and a bearer key over the remote OAuth connector.
|
|
6
|
+
|
|
7
|
+
> Prefer zero-install? Point any MCP client straight at the hosted endpoint
|
|
8
|
+
> `https://offnadir-delta.com/api/v1/mcp` (OAuth 2.1 or a bearer key). See the
|
|
9
|
+
> [docs](https://offnadir-delta.com/docs/mcp). This package is the local option.
|
|
10
|
+
|
|
11
|
+
## Tools
|
|
12
|
+
|
|
13
|
+
| Tool | Cost | What it does |
|
|
14
|
+
|------|------|--------------|
|
|
15
|
+
| `query_signals` | 3 | Geolocated world-event signals by area / date / category, with severity, escalation, and GEOINT scores. |
|
|
16
|
+
| `query_stats` | 1 | Event counts by category and day for an area/window. |
|
|
17
|
+
| `query_hotspots` | 1 | Where activity is concentrating — grid-binned, ranked. |
|
|
18
|
+
| `search_imagery` | 2 | Satellite scenes (Sentinel-1/2, OPERA RTC-S1) over an area. |
|
|
19
|
+
| `get_world_brief` | **free** | The AI-synthesized Daily World Brief. |
|
|
20
|
+
| `get_usage` | **free** | Your remaining token balance and plan capabilities. |
|
|
21
|
+
| `assess_signal` | 5 / 15 | AI remote-sensing assessment for one signal (quick / deep). |
|
|
22
|
+
| `ask_analyst` | 5–45 | Agentic OSINT/GEOINT Q&A returning a structured, cited brief. |
|
|
23
|
+
|
|
24
|
+
Plus resources (`brief://latest`, `brief://{date}`, `signals://schema`, `usage://current`, `imagery://collections`) and prompts (`daily-situation-briefing`, `assess-top-signal`, `aoi-watch`, `market-exposure-check`).
|
|
25
|
+
|
|
26
|
+
Costs are token charges against your balance. Reading the brief and checking usage are free; only your token balance gates metered calls. **Free tier available** — start with `get_world_brief` (0 tokens).
|
|
27
|
+
|
|
28
|
+
## Setup
|
|
29
|
+
|
|
30
|
+
1. Get an API key at <https://offnadir-delta.com/account/api> (issued self-serve; format `ond_…`).
|
|
31
|
+
2. Add the server to your MCP client.
|
|
32
|
+
|
|
33
|
+
### Claude Desktop / Claude Code (`claude_desktop_config.json`)
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"mcpServers": {
|
|
38
|
+
"off-nadir-delta": {
|
|
39
|
+
"command": "npx",
|
|
40
|
+
"args": ["-y", "offnadir-delta-mcp"],
|
|
41
|
+
"env": { "OFFNADIR_DELTA_API_KEY": "ond_your_key_here" }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### From source
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git clone https://github.com/Off-Nadir-Lab/offnadir-delta-mcp.git
|
|
51
|
+
cd offnadir-delta-mcp
|
|
52
|
+
npm install && npm run build
|
|
53
|
+
OFFNADIR_DELTA_API_KEY=ond_... node dist/index.js
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Docker
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
docker build -t offnadir-delta-mcp .
|
|
60
|
+
docker run --rm -i -e OFFNADIR_DELTA_API_KEY=ond_... offnadir-delta-mcp
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Environment
|
|
64
|
+
|
|
65
|
+
| Variable | Required | Default | Notes |
|
|
66
|
+
|----------|----------|---------|-------|
|
|
67
|
+
| `OFFNADIR_DELTA_API_KEY` | for tool calls | — | Bearer key from `/account/api`. Not needed for `tools/list` introspection. |
|
|
68
|
+
| `OFFNADIR_DELTA_MCP_URL` | no | `https://offnadir-delta.com/api/v1/mcp` | Override the remote endpoint (testing). |
|
|
69
|
+
|
|
70
|
+
## How it works
|
|
71
|
+
|
|
72
|
+
Introspection (`initialize`, `tools/list`, `resources/list`, `prompts/list`) is answered from a bundled catalog with **no network and no credentials**. Execution (`tools/call`, `resources/read`, `prompts/get`) is forwarded to the hosted remote server over Streamable HTTP with your `OFFNADIR_DELTA_API_KEY`.
|
|
73
|
+
|
|
74
|
+
## Links
|
|
75
|
+
|
|
76
|
+
- MCP overview: <https://offnadir-delta.com/mcp>
|
|
77
|
+
- Docs / setup: <https://offnadir-delta.com/docs/mcp>
|
|
78
|
+
- Python SDK: <https://pypi.org/project/offnadir-delta/>
|
|
79
|
+
- Official MCP Registry: `com.offnadir-delta/mcp`
|
|
80
|
+
|
|
81
|
+
## License
|
|
82
|
+
|
|
83
|
+
[Apache-2.0](./LICENSE) © Off-Nadir Lab
|
package/dist/catalog.js
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static introspection catalog for the Off-Nadir Delta stdio MCP proxy.
|
|
3
|
+
*
|
|
4
|
+
* These tool / resource / prompt definitions mirror the live remote MCP server
|
|
5
|
+
* (https://offnadir-delta.com/api/v1/mcp) so that `tools/list`, `resources/list`,
|
|
6
|
+
* and `prompts/list` answer instantly and WITHOUT credentials — this is what
|
|
7
|
+
* lets registries (e.g. Glama) introspect the server in a bare container.
|
|
8
|
+
*
|
|
9
|
+
* Actual `tools/call` / `resources/read` / `prompts/get` requests are forwarded
|
|
10
|
+
* to the remote server with the caller's OFFNADIR_DELTA_API_KEY (see index.ts).
|
|
11
|
+
*
|
|
12
|
+
* Keep in sync with the source of truth: src/app/api/v1/mcp/route.ts in the
|
|
13
|
+
* Off-Nadir Delta app. Token costs and enums are inlined from that surface.
|
|
14
|
+
*/
|
|
15
|
+
const DELTA_CATEGORIES = [
|
|
16
|
+
'kinetic',
|
|
17
|
+
'armed_conflict',
|
|
18
|
+
'maritime',
|
|
19
|
+
'natural_disaster',
|
|
20
|
+
'infrastructure',
|
|
21
|
+
'aviation',
|
|
22
|
+
'humanitarian',
|
|
23
|
+
'protest',
|
|
24
|
+
'diplomacy',
|
|
25
|
+
'other',
|
|
26
|
+
];
|
|
27
|
+
const MARKET_IMPACTS = [
|
|
28
|
+
'oil',
|
|
29
|
+
'natural_gas',
|
|
30
|
+
'grain',
|
|
31
|
+
'shipping',
|
|
32
|
+
'defense',
|
|
33
|
+
'metals',
|
|
34
|
+
'semiconductors',
|
|
35
|
+
'fx',
|
|
36
|
+
'equities',
|
|
37
|
+
];
|
|
38
|
+
const IMAGERY_COLLECTIONS = [
|
|
39
|
+
'sentinel-1-grd',
|
|
40
|
+
'sentinel-1-rtc',
|
|
41
|
+
'sentinel-2-l2a',
|
|
42
|
+
'OPERA_L2_RTC-S1_V1',
|
|
43
|
+
];
|
|
44
|
+
const SIGNALS_MAX_DAYS = 30;
|
|
45
|
+
const SIGNALS_MAX_LIMIT = 500;
|
|
46
|
+
const BBOX = {
|
|
47
|
+
type: 'array',
|
|
48
|
+
items: { type: 'number' },
|
|
49
|
+
minItems: 4,
|
|
50
|
+
maxItems: 4,
|
|
51
|
+
};
|
|
52
|
+
export const TOOLS = [
|
|
53
|
+
{
|
|
54
|
+
name: 'query_signals',
|
|
55
|
+
annotations: { readOnlyHint: true },
|
|
56
|
+
description: 'Query geolocated world event signals (Delta Signals: geopolitical, security, disaster, and ' +
|
|
57
|
+
'infrastructure events distilled from global news media, AI-enriched with severity/GEOINT scores ' +
|
|
58
|
+
'and satellite-collection recommendations). Filter by bounding box, date window, and category. ' +
|
|
59
|
+
"Costs 3 token(s) per call, charged to the API key owner's balance.",
|
|
60
|
+
inputSchema: {
|
|
61
|
+
type: 'object',
|
|
62
|
+
properties: {
|
|
63
|
+
bbox: { ...BBOX, description: 'Bounding box [minLon, minLat, maxLon, maxLat] (WGS84). Omit for worldwide.' },
|
|
64
|
+
date: { type: 'string', description: 'Window end date, YYYY-MM-DD (UTC). Defaults to today.' },
|
|
65
|
+
days: { type: 'integer', minimum: 1, maximum: SIGNALS_MAX_DAYS, description: 'Window length in days ending on `date`. Defaults to 1.' },
|
|
66
|
+
categories: { type: 'array', items: { type: 'string', enum: [...DELTA_CATEGORIES] }, description: 'Restrict to these categories. Omit for all.' },
|
|
67
|
+
markets: {
|
|
68
|
+
type: 'array',
|
|
69
|
+
items: { type: 'string', enum: [...MARKET_IMPACTS] },
|
|
70
|
+
description: 'Restrict to signals AI-tagged as exposing these financial markets via a direct ' +
|
|
71
|
+
'physical/supply channel (informational only, not investment advice). Omit for all.',
|
|
72
|
+
},
|
|
73
|
+
limit: { type: 'integer', minimum: 1, maximum: SIGNALS_MAX_LIMIT, description: 'Maximum rows per page. Defaults to 100.' },
|
|
74
|
+
cursor: { type: 'string', description: "Opaque pagination cursor from a previous response's meta.next_cursor." },
|
|
75
|
+
minSeverity: { type: 'number', minimum: 0, maximum: 10, description: 'Keep only signals with severity_score >= this (0-10).' },
|
|
76
|
+
escalating: { type: 'boolean', description: 'Keep only signals whose escalation_trend is "escalating".' },
|
|
77
|
+
sort: { type: 'string', enum: ['severity', 'recent', 'sources'], description: "Result ordering. Omit for the feed's default ranking." },
|
|
78
|
+
updatedSince: { type: 'string', description: 'Differential fetch: only signals (re)enriched at/after this ISO 8601 timestamp. Ignores the date window.' },
|
|
79
|
+
createdSince: { type: 'string', description: 'Differential fetch: only signals first enriched at/after this ISO 8601 timestamp.' },
|
|
80
|
+
observability: { type: 'string', enum: ['observable', 'not-observable'], description: 'Keep only signals with this satellite observability (intelligence.satellite_observability).' },
|
|
81
|
+
openData: { type: 'string', enum: ['sufficient', 'commercial-recommended', 'not-applicable'], description: 'Keep only signals with this open-data sufficiency (intelligence.open_data_sufficiency).' },
|
|
82
|
+
minInformationGain: { type: 'number', minimum: 0, maximum: 1, description: 'Keep only signals whose intelligence.expected_information_gain >= this (0-1).' },
|
|
83
|
+
responseFormat: { type: 'string', enum: ['concise', 'detailed'], description: 'Per-signal field detail. "concise" (default) returns key decision + GEOINT fields; "detailed" returns the full Signal object.' },
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'query_stats',
|
|
89
|
+
annotations: { readOnlyHint: true },
|
|
90
|
+
description: 'Aggregate statistics over the signal corpus — total event count plus per-category and per-day ' +
|
|
91
|
+
'breakdown (trend) for a bounding box and date window. Cheaper than query_signals (returns ' +
|
|
92
|
+
'roll-ups, not rows). Costs 1 token(s) per call.',
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: 'object',
|
|
95
|
+
properties: {
|
|
96
|
+
bbox: { ...BBOX, description: 'Bounding box [minLon, minLat, maxLon, maxLat] (WGS84). Omit for worldwide.' },
|
|
97
|
+
date: { type: 'string', description: 'Window end date, YYYY-MM-DD (UTC). Defaults to today.' },
|
|
98
|
+
days: { type: 'integer', minimum: 1, maximum: SIGNALS_MAX_DAYS, description: 'Window length in days. Defaults to 1.' },
|
|
99
|
+
categories: { type: 'array', items: { type: 'string', enum: [...DELTA_CATEGORIES] }, description: 'Restrict to these categories. Omit for all.' },
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'query_hotspots',
|
|
105
|
+
annotations: { readOnlyHint: true },
|
|
106
|
+
description: 'Geographic hotspots — signal density grid-binned into cells, ranked by event count, each with ' +
|
|
107
|
+
'peak severity and the categories present. Use to find WHERE activity is concentrating. ' +
|
|
108
|
+
'Costs 1 token(s) per call.',
|
|
109
|
+
inputSchema: {
|
|
110
|
+
type: 'object',
|
|
111
|
+
properties: {
|
|
112
|
+
bbox: { ...BBOX, description: 'Bounding box [minLon, minLat, maxLon, maxLat] (WGS84). Omit for worldwide.' },
|
|
113
|
+
date: { type: 'string', description: 'Window end date, YYYY-MM-DD (UTC). Defaults to today.' },
|
|
114
|
+
days: { type: 'integer', minimum: 1, maximum: SIGNALS_MAX_DAYS, description: 'Window length in days. Defaults to 1.' },
|
|
115
|
+
categories: { type: 'array', items: { type: 'string', enum: [...DELTA_CATEGORIES] }, description: 'Restrict to these categories. Omit for all.' },
|
|
116
|
+
precision: { type: 'number', minimum: 0.1, maximum: 5, description: 'Grid cell size in decimal degrees. Defaults to 1.' },
|
|
117
|
+
minSeverity: { type: 'number', minimum: 0, maximum: 10, description: 'Keep only points with severity_score >= this.' },
|
|
118
|
+
limit: { type: 'integer', minimum: 1, maximum: SIGNALS_MAX_LIMIT, description: 'Max source points to bin. Defaults to 500.' },
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'get_world_brief',
|
|
124
|
+
annotations: { readOnlyHint: true },
|
|
125
|
+
description: "Fetch the Daily World Brief — an AI-synthesized OSINT/GEOINT digest of the previous UTC day's " +
|
|
126
|
+
'worldwide event signals (headline, executive summary, top developments with why-it-matters and ' +
|
|
127
|
+
'what-to-watch, per-theme roll-up, ranked signals). Free of token charges.',
|
|
128
|
+
inputSchema: {
|
|
129
|
+
type: 'object',
|
|
130
|
+
properties: {
|
|
131
|
+
date: { type: 'string', description: 'Brief date, YYYY-MM-DD (UTC). Defaults to the latest available.' },
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: 'get_usage',
|
|
137
|
+
annotations: { readOnlyHint: true },
|
|
138
|
+
description: "Check the calling key's remaining token balance and plan capabilities — monthly allocation, " +
|
|
139
|
+
'tokens used this period, tokens remaining, and whether the plan includes AI tools over the API ' +
|
|
140
|
+
'(assess_signal / ask_analyst). Use this to pre-flight a metered call. Free of token charges.',
|
|
141
|
+
inputSchema: { type: 'object', properties: {} },
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'search_imagery',
|
|
145
|
+
annotations: { readOnlyHint: true },
|
|
146
|
+
description: 'Search the satellite imagery catalog (Sentinel-1/2, OPERA RTC-S1) for scenes over an area and ' +
|
|
147
|
+
'date window — the natural follow-up to a signal (find imagery over the event location). Returns ' +
|
|
148
|
+
'minimal scene metadata (id, datetime, footprint, cloud cover, platform, preview) — no imagery ' +
|
|
149
|
+
'bytes. Costs 2 token(s) per call.',
|
|
150
|
+
inputSchema: {
|
|
151
|
+
type: 'object',
|
|
152
|
+
properties: {
|
|
153
|
+
bbox: { ...BBOX, description: 'Bounding box [minLon, minLat, maxLon, maxLat] (WGS84). Required.' },
|
|
154
|
+
collection: { type: 'string', enum: [...IMAGERY_COLLECTIONS], description: 'Catalog collection. Defaults to sentinel-2-l2a.' },
|
|
155
|
+
date: { type: 'string', description: 'Window end date, YYYY-MM-DD (UTC). Defaults to today.' },
|
|
156
|
+
days: { type: 'integer', minimum: 1, maximum: SIGNALS_MAX_DAYS, description: 'Window length in days. Defaults to 7.' },
|
|
157
|
+
cloudCoverMax: { type: 'number', minimum: 0, maximum: 100, description: 'Sentinel-2 only: max cloud cover %.' },
|
|
158
|
+
limit: { type: 'integer', minimum: 1, maximum: 100, description: 'Max scenes to return. Defaults to 25.' },
|
|
159
|
+
responseFormat: { type: 'string', enum: ['concise', 'detailed'], description: 'Per-scene field detail. "concise" (default) or "detailed" (adds footprint, constellation, polarizations).' },
|
|
160
|
+
},
|
|
161
|
+
required: ['bbox'],
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: 'assess_signal',
|
|
166
|
+
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
167
|
+
description: 'Run an AI RS (remote-sensing) deep-dive assessment for a specific signal: what to observe, ' +
|
|
168
|
+
'recommended sensors, and a collection window. `eventId` is the `id` from query_signals. ' +
|
|
169
|
+
"Costs 5 (quick) or 15 (deep) tokens, charged to the key owner's balance. A prior assessment for " +
|
|
170
|
+
'the same signal is cached (no re-charge). The exact charge and remaining balance are in meta.tokens.',
|
|
171
|
+
inputSchema: {
|
|
172
|
+
type: 'object',
|
|
173
|
+
properties: {
|
|
174
|
+
eventId: { type: 'integer', description: 'Signal id (global_event_id) from query_signals.' },
|
|
175
|
+
kind: { type: 'string', enum: ['quick', 'deep'], description: 'Assessment depth. Defaults to quick.' },
|
|
176
|
+
},
|
|
177
|
+
required: ['eventId'],
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'ask_analyst',
|
|
182
|
+
annotations: { readOnlyHint: true },
|
|
183
|
+
description: 'Ask the Delta Analyst an OSINT/GEOINT question. Runs an agentic multi-step analysis over the ' +
|
|
184
|
+
'signal corpus and returns a structured brief (summary, findings with collection recommendations, ' +
|
|
185
|
+
'assessment, citations). Costs 5–45 tokens (usage-based; the exact charge and remaining balance are ' +
|
|
186
|
+
'in meta.tokens). Synchronous — may take up to ~120s. Not cached — each call is charged.',
|
|
187
|
+
inputSchema: {
|
|
188
|
+
type: 'object',
|
|
189
|
+
properties: {
|
|
190
|
+
question: { type: 'string', description: 'The analytic question (≤ 500 chars).' },
|
|
191
|
+
bbox: { ...BBOX, description: 'Optional focus bounding box [minLon, minLat, maxLon, maxLat] (WGS84).' },
|
|
192
|
+
idempotencyKey: { type: 'string', description: 'Optional at-most-once key. Retry with the SAME key after a timeout to avoid a second charge; use a fresh key to ask again.' },
|
|
193
|
+
},
|
|
194
|
+
required: ['question'],
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
];
|
|
198
|
+
export const RESOURCES = [
|
|
199
|
+
{ uri: 'brief://latest', name: 'Daily World Brief (latest)', description: 'The most recent AI-synthesized Daily World Brief (JSON). Free.', mimeType: 'application/json' },
|
|
200
|
+
{ uri: 'signals://schema', name: 'Signal object schema', description: 'JSON Schema of the public Signal shape returned by query_signals.', mimeType: 'application/json' },
|
|
201
|
+
{ uri: 'usage://current', name: 'API usage & quota', description: 'Remaining token balance and plan capabilities for the calling key. Free.', mimeType: 'application/json' },
|
|
202
|
+
{ uri: 'imagery://collections', name: 'Imagery collections', description: 'The satellite catalog collections searchable via search_imagery. Free.', mimeType: 'application/json' },
|
|
203
|
+
];
|
|
204
|
+
export const RESOURCE_TEMPLATES = [
|
|
205
|
+
{ uriTemplate: 'brief://{date}', name: 'Daily World Brief by date', description: 'The Daily World Brief for a specific UTC date (YYYY-MM-DD). Free.', mimeType: 'application/json' },
|
|
206
|
+
];
|
|
207
|
+
export const PROMPTS = [
|
|
208
|
+
{
|
|
209
|
+
name: 'daily-situation-briefing',
|
|
210
|
+
description: 'Summarize the current world situation from the Daily World Brief.',
|
|
211
|
+
arguments: [{ name: 'date', description: 'UTC date YYYY-MM-DD (optional; defaults to latest).', required: false }],
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: 'assess-top-signal',
|
|
215
|
+
description: 'Find the highest-severity recent signal in an area/category and run an RS assessment (Pro).',
|
|
216
|
+
arguments: [
|
|
217
|
+
{ name: 'bbox', description: 'Bounding box "minLon,minLat,maxLon,maxLat" (optional).', required: false },
|
|
218
|
+
{ name: 'category', description: 'Category filter (optional).', required: false },
|
|
219
|
+
],
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: 'aoi-watch',
|
|
223
|
+
description: 'Scan an area of interest for recent escalations and recommend collection.',
|
|
224
|
+
arguments: [{ name: 'bbox', description: 'Bounding box "minLon,minLat,maxLon,maxLat".', required: true }],
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
name: 'market-exposure-check',
|
|
228
|
+
description: 'Find recent events that could plausibly move a given market (oil, grain, shipping, ...) and explain each transmission channel. Informational only — not investment advice.',
|
|
229
|
+
arguments: [
|
|
230
|
+
{ name: 'market', description: `Market to check: ${MARKET_IMPACTS.join(', ')}.`, required: true },
|
|
231
|
+
{ name: 'days', description: 'Lookback window in days (optional; default 3).', required: false },
|
|
232
|
+
],
|
|
233
|
+
},
|
|
234
|
+
];
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Off-Nadir Delta — stdio MCP server (thin proxy).
|
|
4
|
+
*
|
|
5
|
+
* A self-hostable, local (stdio) Model Context Protocol server that exposes the
|
|
6
|
+
* Off-Nadir Delta event-intelligence tools and forwards every call to the hosted
|
|
7
|
+
* remote server at https://offnadir-delta.com/api/v1/mcp using your API key.
|
|
8
|
+
*
|
|
9
|
+
* Why a proxy instead of connecting to the remote directly? Some clients and
|
|
10
|
+
* registries only speak local stdio, or prefer a bearer key over interactive
|
|
11
|
+
* OAuth. This binary gives them the same tool surface with a single env var.
|
|
12
|
+
*
|
|
13
|
+
* Introspection (initialize / tools/list / resources/list / prompts/list) is
|
|
14
|
+
* answered from a bundled catalog and needs NO credentials, so registries can
|
|
15
|
+
* inspect the server in a bare container. Only tools/call, resources/read and
|
|
16
|
+
* prompts/get reach the network, and those require OFFNADIR_DELTA_API_KEY.
|
|
17
|
+
*/
|
|
18
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
19
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
20
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
21
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
22
|
+
import { CallToolRequestSchema, GetPromptRequestSchema, ListPromptsRequestSchema, ListResourcesRequestSchema, ListResourceTemplatesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
23
|
+
import { PROMPTS, RESOURCES, RESOURCE_TEMPLATES, TOOLS } from './catalog.js';
|
|
24
|
+
const VERSION = '1.2.0';
|
|
25
|
+
const REMOTE_URL = new URL(process.env.OFFNADIR_DELTA_MCP_URL ?? 'https://offnadir-delta.com/api/v1/mcp');
|
|
26
|
+
/** Lazily-connected client to the hosted remote MCP server. */
|
|
27
|
+
let remote = null;
|
|
28
|
+
let connecting = null;
|
|
29
|
+
async function getRemote() {
|
|
30
|
+
if (remote)
|
|
31
|
+
return remote;
|
|
32
|
+
if (connecting)
|
|
33
|
+
return connecting;
|
|
34
|
+
const apiKey = process.env.OFFNADIR_DELTA_API_KEY;
|
|
35
|
+
if (!apiKey) {
|
|
36
|
+
throw new Error('OFFNADIR_DELTA_API_KEY is not set. Issue a key at https://offnadir-delta.com/account/api ' +
|
|
37
|
+
'and pass it as the OFFNADIR_DELTA_API_KEY environment variable.');
|
|
38
|
+
}
|
|
39
|
+
connecting = (async () => {
|
|
40
|
+
const transport = new StreamableHTTPClientTransport(REMOTE_URL, {
|
|
41
|
+
requestInit: { headers: { Authorization: `Bearer ${apiKey}` } },
|
|
42
|
+
});
|
|
43
|
+
const client = new Client({ name: 'offnadir-delta-mcp-proxy', version: VERSION }, { capabilities: {} });
|
|
44
|
+
await client.connect(transport);
|
|
45
|
+
remote = client;
|
|
46
|
+
connecting = null;
|
|
47
|
+
return client;
|
|
48
|
+
})();
|
|
49
|
+
try {
|
|
50
|
+
return await connecting;
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
connecting = null;
|
|
54
|
+
throw err;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const server = new Server({ name: 'off-nadir-delta', version: VERSION }, { capabilities: { tools: {}, resources: {}, prompts: {} } });
|
|
58
|
+
// --- Introspection: answered locally, no network, no credentials. ---
|
|
59
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
60
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => ({ resources: RESOURCES }));
|
|
61
|
+
server.setRequestHandler(ListResourceTemplatesRequestSchema, async () => ({ resourceTemplates: RESOURCE_TEMPLATES }));
|
|
62
|
+
server.setRequestHandler(ListPromptsRequestSchema, async () => ({ prompts: PROMPTS }));
|
|
63
|
+
// --- Execution: forwarded to the hosted remote server with the caller's key. ---
|
|
64
|
+
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
65
|
+
const client = await getRemote();
|
|
66
|
+
return client.callTool({ name: req.params.name, arguments: req.params.arguments ?? {} });
|
|
67
|
+
});
|
|
68
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (req) => {
|
|
69
|
+
const client = await getRemote();
|
|
70
|
+
return client.readResource({ uri: req.params.uri });
|
|
71
|
+
});
|
|
72
|
+
server.setRequestHandler(GetPromptRequestSchema, async (req) => {
|
|
73
|
+
const client = await getRemote();
|
|
74
|
+
return client.getPrompt({ name: req.params.name, arguments: req.params.arguments ?? {} });
|
|
75
|
+
});
|
|
76
|
+
async function main() {
|
|
77
|
+
const transport = new StdioServerTransport();
|
|
78
|
+
await server.connect(transport);
|
|
79
|
+
// Keep stderr for diagnostics only — stdout is the MCP transport.
|
|
80
|
+
console.error(`off-nadir-delta MCP proxy v${VERSION} ready (remote: ${REMOTE_URL.href})`);
|
|
81
|
+
}
|
|
82
|
+
main().catch((err) => {
|
|
83
|
+
console.error('Fatal:', err instanceof Error ? err.message : err);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "offnadir-delta-mcp",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Local (stdio) MCP server for Off-Nadir Delta — live, geolocated world-event intelligence, a Daily World Brief, satellite-imagery search, and an OSINT/GEOINT analyst. Forwards to the hosted server with your API key.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"offnadir-delta-mcp": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=18"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"start": "node dist/index.js",
|
|
18
|
+
"prepare": "tsc"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"mcp",
|
|
22
|
+
"model-context-protocol",
|
|
23
|
+
"osint",
|
|
24
|
+
"geoint",
|
|
25
|
+
"geospatial",
|
|
26
|
+
"satellite",
|
|
27
|
+
"intelligence",
|
|
28
|
+
"off-nadir-delta"
|
|
29
|
+
],
|
|
30
|
+
"author": "Off-Nadir Lab",
|
|
31
|
+
"license": "Apache-2.0",
|
|
32
|
+
"homepage": "https://offnadir-delta.com/mcp",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/Off-Nadir-Lab/offnadir-delta-mcp.git"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/Off-Nadir-Lab/offnadir-delta-mcp/issues"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@modelcontextprotocol/sdk": "^1.12.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^20.14.0",
|
|
45
|
+
"typescript": "^5.5.0"
|
|
46
|
+
}
|
|
47
|
+
}
|