chore(assistant): drop Connect with Claude from the integration settings

The card that opened claude.ai's custom connector dialog for this instance
goes, with its phone twin, the line in the assistant setup that jumped to it,
its endpoint and its contract. Anyone who wants Claude uses TREK's MCP
server under Integrations, or an Anthropic key in the assistant. It came with
the assistant and never shipped in a release.
This commit is contained in:
Maurice
2026-10-24 17:06:41 +02:00
parent f6befaa6b2
commit 728a275fef
46 changed files with 8 additions and 721 deletions
@@ -1,26 +0,0 @@
import { ADDON_IDS } from '../../addons';
import { AddonGuard } from '../addons/addon.guard';
import { RequireAddon } from '../addons/require-addon.decorator';
import { JwtAuthGuard } from '../auth-core/jwt-auth.guard';
import { ResponseContract } from '../common/response-contract';
import { ClaudeConnectorService } from './claude-connector.service';
import { Controller, Get, UseGuards } from '@nestjs/common';
import { aiClaudeConnectorResponseSchema, type AiClaudeConnectorResponse } from '@trek/shared';
/**
* /api/integrations/claude-connector — what the settings card needs to add
* TREK to claude.ai as a custom connector. It follows the MCP addon (the
* connector is the MCP endpoint), not the in-app assistant's addon.
*/
@Controller('api/integrations/claude-connector')
@UseGuards(AddonGuard, JwtAuthGuard)
@RequireAddon(ADDON_IDS.MCP, 'MCP')
export class ClaudeConnectorController {
constructor(private readonly connector: ClaudeConnectorService) {}
@Get()
@ResponseContract(aiClaudeConnectorResponseSchema)
async get(): Promise<AiClaudeConnectorResponse> {
return await this.connector.describe();
}
}
@@ -1,31 +0,0 @@
import { OauthService } from './oauth.service';
import { Injectable } from '@nestjs/common';
import type { AiClaudeConnectorResponse } from '@trek/shared';
import QRCode from 'qrcode';
/** claude.ai's "add custom connector" dialog, prefilled through its query string. */
const CLAUDE_ADD_CONNECTOR_URL = 'https://claude.ai/customize/connectors';
/**
* "Connect with Claude": the link that opens claude.ai's custom-connector
* dialog with this instance's MCP endpoint filled in, and the same link as a QR
* code for the phone. claude.ai then runs the ordinary OAuth flow against
* /oauth/authorize; nothing here touches the user's data or calls Anthropic.
*/
@Injectable()
export class ClaudeConnectorService {
constructor(private readonly oauth: OauthService) {}
async describe(): Promise<AiClaudeConnectorResponse> {
const mcpUrl = `${this.oauth.mcpSafeUrl().replace(/(?<!\/)\/+$/, '')}/mcp`;
const params = new URLSearchParams({
modal: 'add-custom-connector',
connectorName: 'TREK',
connectorUrl: mcpUrl,
});
const deepLink = `${CLAUDE_ADD_CONNECTOR_URL}?${params.toString()}`;
const qrSvg = await QRCode.toString(deepLink, { type: 'svg', margin: 1 });
return { mcpUrl, deepLink, qrSvg };
}
}
+2 -6
View File
@@ -8,8 +8,6 @@ import { createMcpAddonGate } from '../addons/mcp-addon-gate';
import { AuditModule } from '../audit/audit.module';
import { RateLimitModule } from '../common/rate-limit.module';
import { SchedulingModule } from '../scheduling/scheduling.module';
import { ClaudeConnectorController } from './claude-connector.controller';
import { ClaudeConnectorService } from './claude-connector.service';
import { OauthApiController } from './oauth-api.controller';
import { CimdClientResolver } from './oauth-cimd';
import { OauthPublicController } from './oauth-public.controller';
@@ -49,8 +47,7 @@ import type { MiddlewareConsumer, NestModule } from '@nestjs/common';
* swapped provider too.
*
* Client ID Metadata Documents (oauth-cimd.ts) resolve through the injected
* CimdClientResolver; ClaudeConnectorController hands the settings page the
* claude.ai link to this instance's MCP endpoint.
* CimdClientResolver.
*
* Exports OauthService for AdminController (admin OAuth-session panel) and the
* MCP transport's token verification.
@@ -73,11 +70,10 @@ import type { MiddlewareConsumer, NestModule } from '@nestjs/common';
SchedulingModule,
MikroOrmModule.forFeature([OauthClients, OauthTokens, OauthConsents, Users]),
],
controllers: [OauthPublicController, OauthApiController, ClaudeConnectorController],
controllers: [OauthPublicController, OauthApiController],
providers: [
OauthService,
CimdClientResolver,
ClaudeConnectorService,
TrekClientsStore,
TrekOAuthProvider,
OauthTokenRetentionJob,