togello-mcp-server 1.0.28 → 1.0.30
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 +2 -0
- package/build/index.js +3 -0
- package/build/remoteServer.js +20 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,6 +51,8 @@ https://your-domain.example/mcp
|
|
|
51
51
|
|
|
52
52
|
ChatGPT developer mode can add remote MCP servers that use SSE. For production ChatGPT apps or connectors, use `passthrough` auth or a deployment that authenticates each user separately before forwarding requests to Togello.
|
|
53
53
|
|
|
54
|
+
For OpenAI Apps domain verification, set `TOGELLO_MCP_OPENAI_APPS_CHALLENGE_TOKEN` to the verification token. Remote mode then serves it from `/.well-known/openai-apps-challenge` as `text/plain`. If both `TOGELLO_MCP_OPENAI_APPS_CHALLENGE_TOKEN` and `OPENAI_APPS_CHALLENGE_TOKEN` are set, the Togello-scoped variable takes precedence.
|
|
55
|
+
|
|
54
56
|
## Tools
|
|
55
57
|
|
|
56
58
|
Read-only tools include MCP `readOnlyHint` annotations and return stable JSON in both `structuredContent` and text content.
|
package/build/index.js
CHANGED
|
@@ -31,6 +31,8 @@ async function main() {
|
|
|
31
31
|
}
|
|
32
32
|
const publicBaseUrl = getRemotePublicBaseUrl(port);
|
|
33
33
|
const oauthIssuer = getRemoteOAuthIssuer();
|
|
34
|
+
const openaiAppsChallengeToken = getEnvValue('TOGELLO_MCP_OPENAI_APPS_CHALLENGE_TOKEN') ??
|
|
35
|
+
getEnvValue('OPENAI_APPS_CHALLENGE_TOKEN');
|
|
34
36
|
await startRemoteServer({
|
|
35
37
|
host,
|
|
36
38
|
port,
|
|
@@ -38,6 +40,7 @@ async function main() {
|
|
|
38
40
|
publicBaseUrl,
|
|
39
41
|
oauthIssuer,
|
|
40
42
|
sseKeepAliveMs: keepAliveMs,
|
|
43
|
+
openaiAppsChallengeToken,
|
|
41
44
|
});
|
|
42
45
|
return;
|
|
43
46
|
}
|
package/build/remoteServer.js
CHANGED
|
@@ -6,6 +6,7 @@ import { isInitializeRequest } from '@modelcontextprotocol/sdk/types.js';
|
|
|
6
6
|
import { parseBearerToken } from './bearerToken.js';
|
|
7
7
|
import { createMcpServer } from './mcpServer.js';
|
|
8
8
|
const protectedResourceMetadataPath = '/.well-known/oauth-protected-resource';
|
|
9
|
+
const openaiAppsChallengePath = '/.well-known/openai-apps-challenge';
|
|
9
10
|
const maxRequestBodyBytes = 1_000_000;
|
|
10
11
|
const supportedScopes = [
|
|
11
12
|
'offline_access',
|
|
@@ -22,6 +23,7 @@ export async function startRemoteServer(options) {
|
|
|
22
23
|
const publicBaseUrl = trimTrailingSlash(options.publicBaseUrl);
|
|
23
24
|
const oauthIssuer = options.oauthIssuer;
|
|
24
25
|
const protectedResourceMetadataUrl = `${publicBaseUrl}${protectedResourceMetadataPath}`;
|
|
26
|
+
const openaiAppsChallengeToken = options.openaiAppsChallengeToken?.trim();
|
|
25
27
|
const sseSessions = new Map();
|
|
26
28
|
const streamableSessions = new Map();
|
|
27
29
|
const resolveUpstreamToken = (sessionId) => {
|
|
@@ -34,6 +36,16 @@ export async function startRemoteServer(options) {
|
|
|
34
36
|
const server = createServer(async (req, res) => {
|
|
35
37
|
try {
|
|
36
38
|
const requestUrl = new URL(req.url ?? '/', `http://${req.headers.host ?? 'localhost'}`);
|
|
39
|
+
if (requestUrl.pathname === openaiAppsChallengePath) {
|
|
40
|
+
if (req.method === 'OPTIONS') {
|
|
41
|
+
writeOptionsResponse(res);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (req.method === 'GET' && openaiAppsChallengeToken) {
|
|
45
|
+
writeTextResponse(res, openaiAppsChallengeToken);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
37
49
|
if (requestUrl.pathname === protectedResourceMetadataPath) {
|
|
38
50
|
if (req.method === 'OPTIONS') {
|
|
39
51
|
writeOptionsResponse(res);
|
|
@@ -239,6 +251,14 @@ function writeJsonResponse(res, body) {
|
|
|
239
251
|
});
|
|
240
252
|
res.end(JSON.stringify(body));
|
|
241
253
|
}
|
|
254
|
+
function writeTextResponse(res, body) {
|
|
255
|
+
res.writeHead(200, {
|
|
256
|
+
'Access-Control-Allow-Origin': '*',
|
|
257
|
+
'Cache-Control': 'no-store',
|
|
258
|
+
'Content-Type': 'text/plain; charset=utf-8',
|
|
259
|
+
});
|
|
260
|
+
res.end(body);
|
|
261
|
+
}
|
|
242
262
|
function writeOptionsResponse(res) {
|
|
243
263
|
res.writeHead(204, {
|
|
244
264
|
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
|
package/package.json
CHANGED