mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 21:31:46 +00:00
830f6c0706
OAuth 2.1 authentication for MCP:
- Add OAuth 2.1 authorization server with PKCE support (routes/oauth.ts)
- Add OAuth service for client CRUD, auth-code flow, and token management (services/oauthService.ts)
- Add typed scope definitions and enforcement helpers (mcp/scopes.ts)
- Add OAuth consent UI page (OAuthAuthorizePage.tsx)
- Add client-side scope labels and descriptions (api/oauthScopes.ts)
- Integrate OAuth token auth into MCP handler alongside existing static tokens
- All OAuth endpoints gated on `mcp` addon
Addon gating across MCP tools, resources, and prompts:
- Add typed ADDON_IDS constant (server/src/addons.ts) replacing all string literals
- Gate budget tools and resources (trip-budget, per-person, settlement) on `budget` addon
- Gate packing tools and resources (trip-packing, trip-packing-bags, trip-todos) on `packing` addon
- Gate todos tools on `packing` addon (mirrors web UI Lists tab behavior)
- Expand atlas gate to cover full tool body (bucket-list + country tools no longer leak)
- Expand collab gate to cover full tool body (collab notes no longer leak)
- Gate packing-list and budget-overview MCP prompts on their respective addons
- Gate get_trip_summary sections per addon; blank packing/budget/collab_notes/todos when disabled
- Remove trip-files resource and files field from get_trip_summary
- Replace all isAddonEnabled('literal') calls with ADDON_IDS constants
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 lines
1.7 KiB
TypeScript
49 lines
1.7 KiB
TypeScript
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp';
|
|
import { registerTodoTools } from './tools/todos';
|
|
import { registerAssignmentTools } from './tools/assignments';
|
|
import { registerReservationTools } from './tools/reservations';
|
|
import { registerTagTools } from './tools/tags';
|
|
import { registerMapsWeatherTools } from './tools/mapsWeather';
|
|
import { registerNotificationTools } from './tools/notifications';
|
|
import { registerAtlasTools } from './tools/atlas';
|
|
import { registerPlaceTools } from './tools/places';
|
|
import { registerDayTools } from './tools/days';
|
|
import { registerBudgetTools } from './tools/budget';
|
|
import { registerPackingTools } from './tools/packing';
|
|
import { registerCollabTools } from './tools/collab';
|
|
import { registerTripTools } from './tools/trips';
|
|
import { registerVacayTools } from './tools/vacay';
|
|
import { registerMcpPrompts } from './tools/prompts';
|
|
|
|
export function registerTools(server: McpServer, userId: number, scopes: string[] | null, isStaticToken = false): void {
|
|
registerTripTools(server, userId, scopes);
|
|
|
|
registerPlaceTools(server, userId, scopes);
|
|
|
|
registerBudgetTools(server, userId, scopes);
|
|
|
|
registerPackingTools(server, userId, scopes);
|
|
|
|
registerReservationTools(server, userId, scopes);
|
|
|
|
registerDayTools(server, userId, scopes);
|
|
|
|
registerAssignmentTools(server, userId, scopes);
|
|
|
|
registerTagTools(server, userId, scopes);
|
|
|
|
registerMapsWeatherTools(server, userId, scopes);
|
|
|
|
registerNotificationTools(server, userId, scopes);
|
|
|
|
registerAtlasTools(server, userId, scopes);
|
|
|
|
registerCollabTools(server, userId, scopes);
|
|
|
|
registerVacayTools(server, userId, scopes);
|
|
|
|
registerTodoTools(server, userId, scopes);
|
|
|
|
registerMcpPrompts(server, userId, isStaticToken);
|
|
}
|