@pilot-status/mcp-server 0.1.0 → 0.1.2
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/README.md +60 -105
- package/dist/index.js +9 -29
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts +2 -2
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +2 -2
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/config.d.ts +5 -11
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +4 -22
- package/dist/lib/config.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,48 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
A [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server that
|
|
4
4
|
exposes the **Pilot Status public `/v1` API** as MCP tools, so any MCP-capable
|
|
5
|
-
client (Claude Desktop, Cursor, custom agents, …) can
|
|
6
|
-
manage numbers/templates, read conversations, and more —
|
|
7
|
-
API key.
|
|
5
|
+
client (Claude Desktop, Cursor, the claude.ai connector, custom agents, …) can
|
|
6
|
+
send WhatsApp messages, manage numbers/templates, read conversations, and more —
|
|
7
|
+
using a Pilot Status API key.
|
|
8
8
|
|
|
9
|
-
It speaks
|
|
9
|
+
It speaks the **streamable HTTP** transport (`POST /mcp`). Clients connect over
|
|
10
|
+
HTTP and authenticate either with an `x-api-key` header **or** with an OAuth 2.1
|
|
11
|
+
bearer token (for the [claude.ai custom connector](#remote-oauth--claudeai-connector)).
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- **
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
There are two ways to use it:
|
|
14
|
+
|
|
15
|
+
- **Self-host via npm** — run the server and point a client at your own HTTP
|
|
16
|
+
endpoint (default `http://localhost:8787/mcp`), sending an `x-api-key` header.
|
|
17
|
+
- **Hosted (available)** — the managed instance at `https://mcp.pilotstatuss.com`,
|
|
18
|
+
used as a [claude.ai custom connector](#remote-oauth--claudeai-connector) over
|
|
19
|
+
OAuth.
|
|
18
20
|
|
|
19
21
|
## Install
|
|
20
22
|
|
|
21
23
|
```bash
|
|
22
|
-
# Run straight from npm (no
|
|
23
|
-
npx @pilot-status/mcp-server
|
|
24
|
-
npx @pilot-status/mcp-server http # streamable HTTP transport
|
|
24
|
+
# Run straight from npm (no install needed) — starts the HTTP server:
|
|
25
|
+
npx @pilot-status/mcp-server # listens on http://0.0.0.0:8787/mcp
|
|
25
26
|
|
|
26
27
|
# Or install the binary globally:
|
|
27
28
|
npm install -g @pilot-status/mcp-server
|
|
28
|
-
pilot-status-mcp
|
|
29
|
+
pilot-status-mcp
|
|
29
30
|
```
|
|
30
31
|
|
|
31
|
-
The published package exposes the `pilot-status-mcp` bin
|
|
32
|
-
environment variables (see
|
|
32
|
+
The published package exposes the `pilot-status-mcp` bin, which starts the
|
|
33
|
+
streamable HTTP server. Configuration is via environment variables (see
|
|
34
|
+
[`.env.example`](./.env.example) / [Configuration](#configuration)). The API key
|
|
35
|
+
is sent per-request via the `x-api-key` header; you can optionally set a
|
|
36
|
+
process-wide fallback:
|
|
33
37
|
|
|
34
38
|
```bash
|
|
35
|
-
|
|
39
|
+
PORT=8787 npx @pilot-status/mcp-server
|
|
36
40
|
```
|
|
37
41
|
|
|
38
42
|
## Authentication
|
|
39
43
|
|
|
40
44
|
There are two ways to authenticate against the public `/v1` API:
|
|
41
45
|
|
|
42
|
-
1. **API key** (`x-api-key`) — a `ps_*` key,
|
|
43
|
-
|
|
44
|
-
2. **OAuth 2.1 bearer token** — used by the claude.ai custom connector
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
1. **API key** (`x-api-key`) — a `ps_*` key, sent per-request by HTTP clients
|
|
47
|
+
(optionally falling back to `PILOT_STATUS_API_KEY` set on the server).
|
|
48
|
+
2. **OAuth 2.1 bearer token** — used by the claude.ai custom connector.
|
|
49
|
+
claude.ai handles the login, so no API key is shared with the client.
|
|
50
|
+
See [Remote (OAuth)](#remote-oauth--claudeai-connector).
|
|
47
51
|
|
|
48
52
|
Scope matters (same rules as the REST API):
|
|
49
53
|
|
|
@@ -55,9 +59,9 @@ Scope matters (same rules as the REST API):
|
|
|
55
59
|
surfaced as a tool error.)
|
|
56
60
|
|
|
57
61
|
Under an OAuth/tenant token there is no number scope, so number-scoped tools
|
|
58
|
-
accept an optional `whatsappNumberId` argument
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
accept an optional `whatsappNumberId` argument so the backend can resolve the
|
|
63
|
+
target number. It is ignored when the API key is already scoped to a single
|
|
64
|
+
number.
|
|
61
65
|
|
|
62
66
|
Token-based pairing/connect routes (interactive browser flows) are intentionally
|
|
63
67
|
**not** exposed as tools.
|
|
@@ -101,41 +105,25 @@ See [`.env.example`](./.env.example). Key variables:
|
|
|
101
105
|
| Variable | Default | Notes |
|
|
102
106
|
| --- | --- | --- |
|
|
103
107
|
| `PILOT_STATUS_API_URL` | `https://pilotstatuss.com` | Public API base URL (no trailing slash). |
|
|
104
|
-
| `PILOT_STATUS_API_KEY` | — | `ps_*` key.
|
|
108
|
+
| `PILOT_STATUS_API_KEY` | — | `ps_*` key. Optional per-request fallback (clients normally send `x-api-key`). |
|
|
105
109
|
| `PILOT_STATUS_API_KEY_ID` | — | Optional `x-api-key-id` companion. |
|
|
106
|
-
| `MCP_RESOURCE_URL` | `https://mcp.pilotstatuss.com` | Public URL of
|
|
110
|
+
| `MCP_RESOURCE_URL` | `https://mcp.pilotstatuss.com` | Public URL of this server (OAuth `resource`). |
|
|
107
111
|
| `PILOT_STATUS_AUTH_SERVER_URL` | `https://pilotstatuss.com` | OAuth authorization server (the backend). |
|
|
108
|
-
| `
|
|
109
|
-
| `
|
|
110
|
-
| `HOST` | `0.0.0.0` | HTTP transport bind host. |
|
|
111
|
-
|
|
112
|
-
## Running
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
npm install # from the repo root (workspaces)
|
|
116
|
-
npm --workspace @pilot-status/mcp-server run build
|
|
117
|
-
|
|
118
|
-
# stdio (default)
|
|
119
|
-
PILOT_STATUS_API_KEY=ps_xxx node apps/mcp-server/dist/index.js
|
|
112
|
+
| `PORT` | `8787` | HTTP listen port. |
|
|
113
|
+
| `HOST` | `0.0.0.0` | HTTP bind host. |
|
|
120
114
|
|
|
121
|
-
|
|
122
|
-
MCP_TRANSPORT=http PORT=8787 node apps/mcp-server/dist/index.js
|
|
123
|
-
# or: node apps/mcp-server/dist/index.js http
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Dev mode (no build): `npm --workspace @pilot-status/mcp-server run dev`.
|
|
115
|
+
## HTTP endpoint
|
|
127
116
|
|
|
128
|
-
|
|
117
|
+
When running the HTTP transport, the server exposes:
|
|
129
118
|
|
|
130
119
|
- `POST /mcp` — JSON-RPC over Streamable HTTP. Authenticate with `x-api-key:
|
|
131
120
|
ps_xxx` **or** `Authorization: Bearer <oauth-token>`. With no credentials it
|
|
132
121
|
replies `401` + `WWW-Authenticate`, which starts the OAuth flow.
|
|
133
122
|
- `GET /.well-known/oauth-protected-resource` — OAuth 2.1 protected-resource
|
|
134
123
|
metadata (RFC 9728); points discovery at the authorization server.
|
|
135
|
-
- `GET /health` — liveness probe.
|
|
136
124
|
|
|
137
125
|
```bash
|
|
138
|
-
curl -s
|
|
126
|
+
curl -s https://mcp.pilotstatuss.com/mcp \
|
|
139
127
|
-H "content-type: application/json" \
|
|
140
128
|
-H "accept: application/json, text/event-stream" \
|
|
141
129
|
-H "x-api-key: ps_xxx" \
|
|
@@ -144,32 +132,26 @@ curl -s http://localhost:8787/mcp \
|
|
|
144
132
|
|
|
145
133
|
## Configuring MCP clients
|
|
146
134
|
|
|
147
|
-
###
|
|
135
|
+
### Self-hosted (npm, HTTP)
|
|
148
136
|
|
|
149
|
-
|
|
150
|
-
|
|
137
|
+
Run the server with `npx @pilot-status/mcp-server` and point the client at your
|
|
138
|
+
own HTTP endpoint, supplying the API key as a header:
|
|
151
139
|
|
|
152
140
|
```json
|
|
153
141
|
{
|
|
154
142
|
"mcpServers": {
|
|
155
143
|
"pilot-status": {
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
"
|
|
159
|
-
"PILOT_STATUS_API_KEY": "ps_your_key_here",
|
|
160
|
-
"PILOT_STATUS_API_URL": "https://pilotstatuss.com"
|
|
161
|
-
}
|
|
144
|
+
"type": "http",
|
|
145
|
+
"url": "http://localhost:8787/mcp",
|
|
146
|
+
"headers": { "x-api-key": "ps_your_key_here" }
|
|
162
147
|
}
|
|
163
148
|
}
|
|
164
149
|
}
|
|
165
150
|
```
|
|
166
151
|
|
|
167
|
-
|
|
168
|
-
(`node /absolute/path/to/apps/mcp-server/dist/index.js`).
|
|
169
|
-
|
|
170
|
-
### Remote / HTTP clients (API key)
|
|
152
|
+
### Hosted / remote (API key header)
|
|
171
153
|
|
|
172
|
-
Point the client at the
|
|
154
|
+
Point the client at the hosted URL and supply the API key as a header:
|
|
173
155
|
|
|
174
156
|
```json
|
|
175
157
|
{
|
|
@@ -185,46 +167,19 @@ Point the client at the deployed URL and supply the API key as a header:
|
|
|
185
167
|
|
|
186
168
|
### Remote (OAuth) — claude.ai connector
|
|
187
169
|
|
|
188
|
-
For the [claude.ai](https://claude.ai) **Custom Connector**,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
1. Deploy with `MCP_TRANSPORT=http` and set:
|
|
193
|
-
- `MCP_RESOURCE_URL` — the public URL of this server, e.g.
|
|
194
|
-
`https://mcp.pilotstatuss.com`.
|
|
195
|
-
- `PILOT_STATUS_AUTH_SERVER_URL` — the Pilot Status backend, e.g.
|
|
196
|
-
`https://pilotstatuss.com` (the default).
|
|
197
|
-
- Leave `PILOT_STATUS_API_KEY` **unset** so unauthenticated requests return a
|
|
198
|
-
`401` challenge (otherwise the env key would short-circuit OAuth).
|
|
199
|
-
2. In claude.ai → **Settings → Connectors → Add custom connector**, set the URL
|
|
200
|
-
to `https://mcp.pilotstatuss.com/mcp`.
|
|
201
|
-
3. claude.ai fetches `GET /.well-known/oauth-protected-resource`, discovers the
|
|
202
|
-
authorization server (`PILOT_STATUS_AUTH_SERVER_URL`), and runs the OAuth
|
|
203
|
-
2.1 login (Pilot Status SSO). The resulting access token is sent on every
|
|
204
|
-
`POST /mcp` as `Authorization: Bearer <token>`.
|
|
205
|
-
|
|
206
|
-
This server is a **dumb forwarder**: it does not verify the token. It forwards
|
|
207
|
-
the bearer token to the public `/v1` API, which validates it. If `/v1` rejects
|
|
208
|
-
the token (`401`), the response is relayed as `401` + `WWW-Authenticate` so the
|
|
209
|
-
client re-authenticates. The authorization server itself (`/api/oauth/*` and
|
|
210
|
-
`/.well-known/oauth-authorization-server`) lives in the Pilot Status backend.
|
|
211
|
-
|
|
212
|
-
## Deployment
|
|
213
|
-
|
|
214
|
-
`MCP_TRANSPORT=http` behind HTTPS at `MCP_RESOURCE_URL`. A container image +
|
|
215
|
-
generator entry + Traefik host (`mcp.pilotstatuss.com`) and the backend
|
|
216
|
-
authorization-server endpoints are tracked as follow-up tasks. The server is
|
|
217
|
-
stateless, so it can run with multiple replicas behind the load balancer.
|
|
218
|
-
|
|
219
|
-
## Tests
|
|
170
|
+
For the [claude.ai](https://claude.ai) **Custom Connector**, point claude.ai at
|
|
171
|
+
the hosted HTTPS URL and let it run the OAuth login — no API key is shared with
|
|
172
|
+
the client.
|
|
220
173
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
`
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
174
|
+
1. In claude.ai → **Settings → Connectors → Add custom connector**, set the URL
|
|
175
|
+
to `https://mcp.pilotstatuss.com/mcp`.
|
|
176
|
+
2. claude.ai fetches `GET /.well-known/oauth-protected-resource`, discovers the
|
|
177
|
+
authorization server, and runs the OAuth 2.1 login (Pilot Status SSO). The
|
|
178
|
+
resulting access token is sent on every `POST /mcp` as
|
|
179
|
+
`Authorization: Bearer <token>`.
|
|
180
|
+
|
|
181
|
+
If you run your own instance, serve the HTTP transport at a public HTTPS URL and
|
|
182
|
+
set `MCP_RESOURCE_URL` to that URL and `PILOT_STATUS_AUTH_SERVER_URL` to the
|
|
183
|
+
Pilot Status backend (`https://pilotstatuss.com`). Leave `PILOT_STATUS_API_KEY`
|
|
184
|
+
unset so unauthenticated requests return the `401` challenge that starts the
|
|
185
|
+
OAuth flow.
|
package/dist/index.js
CHANGED
|
@@ -2,41 +2,21 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Pilot Status MCP server entrypoint.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
*
|
|
5
|
+
* Always starts the streamable HTTP transport (see {@link resolveConfig}):
|
|
6
|
+
* - Listens on PORT (default 8787) and serves POST /mcp.
|
|
7
|
+
* - API key is supplied per-request via the `x-api-key` header (falls back to
|
|
8
|
+
* PILOT_STATUS_API_KEY if set), or an OAuth 2.1 bearer token is forwarded
|
|
9
|
+
* verbatim for the hosted claude.ai custom connector.
|
|
9
10
|
*
|
|
10
11
|
* Usage:
|
|
11
|
-
* pilot-status-mcp #
|
|
12
|
-
*
|
|
13
|
-
* MCP_TRANSPORT=http PORT=8787 node dist/index.js
|
|
12
|
+
* pilot-status-mcp # streamable HTTP on PORT (default 8787)
|
|
13
|
+
* PORT=8787 node dist/index.js
|
|
14
14
|
*/
|
|
15
15
|
import { resolveConfig } from "./lib/config.js";
|
|
16
16
|
async function main() {
|
|
17
17
|
const config = resolveConfig();
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
await startHttpServer(config);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
// stdio transport
|
|
24
|
-
if (!config.apiKey && !config.apiKeyId) {
|
|
25
|
-
console.error("[mcp] PILOT_STATUS_API_KEY is required for the stdio transport. " +
|
|
26
|
-
"Set it in the environment (or use the HTTP transport with per-request keys).");
|
|
27
|
-
process.exit(1);
|
|
28
|
-
}
|
|
29
|
-
const { StdioServerTransport } = await import("@modelcontextprotocol/sdk/server/stdio.js");
|
|
30
|
-
const { buildServer } = await import("./lib/server.js");
|
|
31
|
-
const server = buildServer({
|
|
32
|
-
baseUrl: config.baseUrl,
|
|
33
|
-
apiKey: config.apiKey,
|
|
34
|
-
apiKeyId: config.apiKeyId,
|
|
35
|
-
});
|
|
36
|
-
const transport = new StdioServerTransport();
|
|
37
|
-
await server.connect(transport);
|
|
38
|
-
// stdout is reserved for the JSON-RPC protocol; log to stderr.
|
|
39
|
-
console.error(`[mcp] Pilot Status MCP server (stdio) connected → ${config.baseUrl}/v1`);
|
|
18
|
+
const { startHttpServer } = await import("./lib/http-transport.js");
|
|
19
|
+
await startHttpServer(config);
|
|
40
20
|
}
|
|
41
21
|
main().catch((err) => {
|
|
42
22
|
console.error("[mcp] fatal:", err instanceof Error ? err.stack ?? err.message : err);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,KAAK,UAAU,IAAI;IACf,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,KAAK,UAAU,IAAI;IACf,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;IACpE,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACrF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
package/dist/lib/api-client.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* to its internal `/api/v1/*` routes).
|
|
7
7
|
* Authentication is one of two modes:
|
|
8
8
|
* - **API key** — `x-api-key` (+ optional `x-api-key-id`) from a constructor
|
|
9
|
-
* value (
|
|
9
|
+
* value (process default) or a per-request override (the `x-api-key` header).
|
|
10
10
|
* - **Bearer** — an OAuth 2.1 access token, forwarded verbatim as
|
|
11
11
|
* `Authorization: Bearer <token>` (and `x-api-key` is NOT sent). The public
|
|
12
12
|
* `/v1` API validates the token; this client never inspects it.
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
export interface ApiClientOptions {
|
|
22
22
|
/** Base URL without trailing slash (e.g. https://pilotstatuss.com). */
|
|
23
23
|
baseUrl: string;
|
|
24
|
-
/** Default `x-api-key` value (
|
|
24
|
+
/** Default `x-api-key` value (process fallback). Optional; per-request header wins. */
|
|
25
25
|
apiKey?: string;
|
|
26
26
|
/** Optional `x-api-key-id` companion header. */
|
|
27
27
|
apiKeyId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../src/lib/api-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WAAW,gBAAgB;IAC7B,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../src/lib/api-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WA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api-key` (+ optional `x-api-key-id`) from a constructor
|
|
9
|
-
* value (
|
|
9
|
+
* value (process default) or a per-request override (the `x-api-key` header).
|
|
10
10
|
* - **Bearer** — an OAuth 2.1 access token, forwarded verbatim as
|
|
11
11
|
* `Authorization: Bearer <token>` (and `x-api-key` is NOT sent). The public
|
|
12
12
|
* `/v1` API validates the token; this client never inspects it.
|
|
@@ -113,7 +113,7 @@ export class ApiClient {
|
|
|
113
113
|
const usingBearer = Boolean(bearer);
|
|
114
114
|
if (!usingBearer && !apiKey && !apiKeyId) {
|
|
115
115
|
throw new ApiError({
|
|
116
|
-
message: "Missing credentials. Provide an OAuth bearer token,
|
|
116
|
+
message: "Missing credentials. Provide an OAuth bearer token, send an x-api-key header, or set PILOT_STATUS_API_KEY on the server.",
|
|
117
117
|
status: 401,
|
|
118
118
|
code: "MISSING_API_KEY",
|
|
119
119
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/lib/api-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAyCH,gFAAgF;AAChF,MAAM,YAAY,GAA2B;IACzC,GAAG,EAAE,aAAa;IAClB,GAAG,EAAE,mCAAmC;IACxC,GAAG,EAAE,mDAAmD;IACxD,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,uCAAuC;IAC5C,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,yBAAyB;IAC9B,GAAG,EAAE,qBAAqB;CAC7B,CAAC;AAEF,MAAM,OAAO,QAAS,SAAQ,KAAK;IACtB,MAAM,CAAS;IACf,IAAI,CAAU;IACd,OAAO,CAAW;IAC3B,mEAAmE;IAC1D,IAAI,CAAW;IAExB,YAAY,IAMX;QACG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,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IACpD,CAAC;CACJ"}
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Runtime configuration for the Pilot Status MCP server.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* 1. a positional CLI arg or flag: `stdio` | `http` | `--stdio` | `--http`
|
|
6
|
-
* 2. the `MCP_TRANSPORT` env var (`stdio` | `http`)
|
|
7
|
-
* 3. default: `stdio`
|
|
4
|
+
* The server always runs the streamable HTTP transport (POST /mcp).
|
|
8
5
|
*
|
|
9
6
|
* The public API base URL defaults to production (`https://pilotstatuss.com`).
|
|
10
|
-
* The API key is
|
|
11
|
-
*
|
|
12
|
-
* incoming `x-api-key` header, falling back to `PILOT_STATUS_API_KEY` if set.
|
|
7
|
+
* The API key is taken per-request from the incoming `x-api-key` header,
|
|
8
|
+
* falling back to `PILOT_STATUS_API_KEY` if set on the process.
|
|
13
9
|
*
|
|
14
10
|
* OAuth 2.1 (claude.ai custom connector): this process is the *resource server*.
|
|
15
11
|
* It is a "dumb forwarder" — it does NOT verify access tokens. A `Bearer` token
|
|
@@ -19,12 +15,10 @@
|
|
|
19
15
|
* - `MCP_RESOURCE_URL` — the public URL of THIS resource server.
|
|
20
16
|
* - `PILOT_STATUS_AUTH_SERVER_URL` — the authorization server (the backend).
|
|
21
17
|
*/
|
|
22
|
-
export type McpTransport = "stdio" | "http";
|
|
23
18
|
export interface ResolvedConfig {
|
|
24
|
-
transport: McpTransport;
|
|
25
19
|
/** Public API base URL, no trailing slash (e.g. https://pilotstatuss.com). */
|
|
26
20
|
baseUrl: string;
|
|
27
|
-
/** Raw `ps_*` API key (
|
|
21
|
+
/** Raw `ps_*` API key (per-process fallback for the `x-api-key` header). May be undefined. */
|
|
28
22
|
apiKey?: string;
|
|
29
23
|
/** Optional `x-api-key-id` companion header value. */
|
|
30
24
|
apiKeyId?: string;
|
|
@@ -48,7 +42,7 @@ export declare const DEFAULT_HTTP_HOST = "0.0.0.0";
|
|
|
48
42
|
* is a hint to clients about the granularity available.
|
|
49
43
|
*/
|
|
50
44
|
export declare const SCOPES_SUPPORTED: readonly ["messages:send", "messages:read", "conversations:read", "numbers:read", "numbers:write", "templates:read", "templates:write", "analytics:read"];
|
|
51
|
-
export declare function resolveConfig(
|
|
45
|
+
export declare function resolveConfig(env?: NodeJS.ProcessEnv): ResolvedConfig;
|
|
52
46
|
export declare const SERVER_NAME = "pilot-status";
|
|
53
47
|
export declare const SERVER_VERSION = "0.1.0";
|
|
54
48
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,cAAc;IAC3B,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oFAAoF;IACpF,WAAW,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,aAAa,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAC1D,eAAO,MAAM,uBAAuB,6BAA6B,CAAC;AAClE,eAAO,MAAM,oBAAoB,iCAAiC,CAAC;AACnE,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,2JASnB,CAAC;AAMX,wBAAgB,aAAa,CACzB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACrC,cAAc,CAwBhB;AAED,eAAO,MAAM,WAAW,iBAAiB,CAAC;AAC1C,eAAO,MAAM,cAAc,UAAU,CAAC"}
|
package/dist/lib/config.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Runtime configuration for the Pilot Status MCP server.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* 1. a positional CLI arg or flag: `stdio` | `http` | `--stdio` | `--http`
|
|
6
|
-
* 2. the `MCP_TRANSPORT` env var (`stdio` | `http`)
|
|
7
|
-
* 3. default: `stdio`
|
|
4
|
+
* The server always runs the streamable HTTP transport (POST /mcp).
|
|
8
5
|
*
|
|
9
6
|
* The public API base URL defaults to production (`https://pilotstatuss.com`).
|
|
10
|
-
* The API key is
|
|
11
|
-
*
|
|
12
|
-
* incoming `x-api-key` header, falling back to `PILOT_STATUS_API_KEY` if set.
|
|
7
|
+
* The API key is taken per-request from the incoming `x-api-key` header,
|
|
8
|
+
* falling back to `PILOT_STATUS_API_KEY` if set on the process.
|
|
13
9
|
*
|
|
14
10
|
* OAuth 2.1 (claude.ai custom connector): this process is the *resource server*.
|
|
15
11
|
* It is a "dumb forwarder" — it does NOT verify access tokens. A `Bearer` token
|
|
@@ -42,20 +38,7 @@ export const SCOPES_SUPPORTED = [
|
|
|
42
38
|
function stripTrailingSlash(url) {
|
|
43
39
|
return url.replace(/\/+$/, "");
|
|
44
40
|
}
|
|
45
|
-
function
|
|
46
|
-
const flags = argv.map((a) => a.trim().toLowerCase());
|
|
47
|
-
if (flags.includes("http") || flags.includes("--http"))
|
|
48
|
-
return "http";
|
|
49
|
-
if (flags.includes("stdio") || flags.includes("--stdio"))
|
|
50
|
-
return "stdio";
|
|
51
|
-
const fromEnv = (env.MCP_TRANSPORT ?? "").trim().toLowerCase();
|
|
52
|
-
if (fromEnv === "http")
|
|
53
|
-
return "http";
|
|
54
|
-
if (fromEnv === "stdio")
|
|
55
|
-
return "stdio";
|
|
56
|
-
return "stdio";
|
|
57
|
-
}
|
|
58
|
-
export function resolveConfig(argv = process.argv.slice(2), env = process.env) {
|
|
41
|
+
export function resolveConfig(env = process.env) {
|
|
59
42
|
const baseUrl = stripTrailingSlash((env.PILOT_STATUS_API_URL ?? "").trim() || DEFAULT_API_URL);
|
|
60
43
|
const apiKey = (env.PILOT_STATUS_API_KEY ?? "").trim() || undefined;
|
|
61
44
|
const apiKeyId = (env.PILOT_STATUS_API_KEY_ID ?? "").trim() || undefined;
|
|
@@ -64,7 +47,6 @@ export function resolveConfig(argv = process.argv.slice(2), env = process.env) {
|
|
|
64
47
|
const port = Number.parseInt(env.PORT ?? "", 10) || DEFAULT_HTTP_PORT;
|
|
65
48
|
const host = (env.HOST ?? "").trim() || DEFAULT_HTTP_HOST;
|
|
66
49
|
return {
|
|
67
|
-
transport: resolveTransport(argv, env),
|
|
68
50
|
baseUrl,
|
|
69
51
|
apiKey,
|
|
70
52
|
apiKeyId,
|
package/dist/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAmBH,MAAM,CAAC,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAC1D,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAClE,MAAM,CAAC,MAAM,oBAAoB,GAAG,8BAA8B,CAAC;AACnE,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AACtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAE3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,eAAe;IACf,eAAe;IACf,oBAAoB;IACpB,cAAc;IACd,eAAe;IACf,gBAAg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}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pilot-status/mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Model Context Protocol (MCP) server exposing the Pilot Status public /v1 API as tools
|
|
5
|
+
"description": "Model Context Protocol (MCP) server exposing the Pilot Status public /v1 API as tools over streamable HTTP (with OAuth 2.1 for the claude.ai custom connector).",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Pilot Status",
|
|
8
8
|
"homepage": "https://github.com/oismaelash/pilot-status/tree/main/apps/mcp-server#readme",
|