findymail-mcp 0.1.17 → 0.1.19
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 +21 -1
- package/package.json +1 -1
- package/src/http.js +10 -1
- package/src/tools.js +1 -1
package/README.md
CHANGED
|
@@ -130,6 +130,26 @@ PORT=3456 node src/http.js
|
|
|
130
130
|
|
|
131
131
|
Requests to `/mcp` without a valid `Authorization: Bearer <token>` header will be rejected with a 401 error.
|
|
132
132
|
|
|
133
|
+
#### OpenAI domain verification
|
|
134
|
+
|
|
135
|
+
Set `OPENAI_APPS_CHALLENGE_TOKEN` in the HTTP server environment to the exact
|
|
136
|
+
token shown in your OpenAI submission form, then restart the server with the
|
|
137
|
+
updated environment. The server exposes it without authentication at
|
|
138
|
+
`/.well-known/openai-apps-challenge` as plain text. Without a configured token,
|
|
139
|
+
the endpoint returns 404.
|
|
140
|
+
|
|
141
|
+
Make sure your reverse proxy forwards this path to the HTTP server, including
|
|
142
|
+
when it normally proxies only `/mcp`. Check the public endpoint before clicking
|
|
143
|
+
**Verify Domain** in the submission form:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
curl -i https://mcp.findymail.com/.well-known/openai-apps-challenge
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
It must return HTTP 200 with only the token in the response body. Leave the
|
|
150
|
+
form's Challenge Base URL blank to verify on the MCP hostname. Do not replace
|
|
151
|
+
another active app's token on the same hostname.
|
|
152
|
+
|
|
133
153
|
### Optional settings
|
|
134
154
|
|
|
135
155
|
| Variable | Default | Effect |
|
|
@@ -179,4 +199,4 @@ See [PUBLISHING.md](PUBLISHING.md) for the npm release process.
|
|
|
179
199
|
|
|
180
200
|
## License
|
|
181
201
|
|
|
182
|
-
MIT
|
|
202
|
+
MIT
|
package/package.json
CHANGED
package/src/http.js
CHANGED
|
@@ -24,6 +24,7 @@ try {
|
|
|
24
24
|
const PORT = process.env.PORT || 3456;
|
|
25
25
|
const BASE_URL = process.env.BASE_URL || `http://localhost:${PORT}`;
|
|
26
26
|
const AUTH_SERVER = process.env.AUTH_SERVER || "https://app.findymail.com";
|
|
27
|
+
const OPENAI_APPS_CHALLENGE_TOKEN = process.env.OPENAI_APPS_CHALLENGE_TOKEN?.trim();
|
|
27
28
|
|
|
28
29
|
const app = express();
|
|
29
30
|
|
|
@@ -112,6 +113,14 @@ app.use((req, res, next) => {
|
|
|
112
113
|
});
|
|
113
114
|
|
|
114
115
|
// =============================================================================
|
|
116
|
+
// Public domain ownership challenge; return only the configured token.
|
|
117
|
+
// Keep this outside /mcp so verification does not require authentication.
|
|
118
|
+
app.get("/.well-known/openai-apps-challenge", (req, res) => {
|
|
119
|
+
res.set("Cache-Control", "no-store");
|
|
120
|
+
if (!OPENAI_APPS_CHALLENGE_TOKEN) return res.status(404).end();
|
|
121
|
+
res.type("text/plain").send(OPENAI_APPS_CHALLENGE_TOKEN);
|
|
122
|
+
});
|
|
123
|
+
|
|
115
124
|
// OAuth 2.0 discovery (RFC 8414 + RFC 9728)
|
|
116
125
|
// This server is an OAuth Protected Resource, not an Authorization Server.
|
|
117
126
|
// The real OAuth 2.1 infra (Passport, PKCE, DCR) runs on AUTH_SERVER.
|
|
@@ -373,4 +382,4 @@ const server = app.listen(PORT, () => {
|
|
|
373
382
|
// (`server.timeout` is 0 by default and applies to the request, not the stream),
|
|
374
383
|
// so lean on TCP keepalive to notice the dead peer.
|
|
375
384
|
const KEEPALIVE_MS = Number(process.env.MCP_TCP_KEEPALIVE_MS) || 60 * 1000;
|
|
376
|
-
server.on("connection", socket => socket.setKeepAlive(true, KEEPALIVE_MS));
|
|
385
|
+
server.on("connection", socket => socket.setKeepAlive(true, KEEPALIVE_MS));
|
package/src/tools.js
CHANGED
|
@@ -7,7 +7,7 @@ import { log, apiPost, apiGet, apiDelete, resolveApiKey, formatResponse, formatE
|
|
|
7
7
|
// a client auto-approve a call, and a model looping a finder over a few hundred
|
|
8
8
|
// rows would spend real credits with no confirmation. Only the calls that cost
|
|
9
9
|
// nothing are read-only.
|
|
10
|
-
const READS = { readOnlyHint: true, openWorldHint: true };
|
|
10
|
+
const READS = { readOnlyHint: true, destructiveHint: false, openWorldHint: true };
|
|
11
11
|
const LOOKUP = { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true };
|
|
12
12
|
|
|
13
13
|
// MCP clients give up on a request after 60s by default (the SDK's
|