-
-
Notifications
You must be signed in to change notification settings - Fork 886
MCP Overview
TREK includes a built-in Model Context Protocol (MCP) server. MCP is an open standard that lets AI assistants read and modify data in external services through a structured API. When the MCP addon is enabled on your TREK instance, AI clients such as Claude.ai, Claude Desktop, Cursor, VS Code, and others can connect directly to your trips.
Once connected, an AI assistant can work with your TREK data in a single conversation:
- Create and update trips, days, and itineraries
- Search for real-world places and add them to your trip
- Build and manage packing lists and to-do items
- Track budgets and expenses across trip members
- Create reservations, transport bookings, and accommodations
- Send collab messages and notes to other trip members
- Mark countries and regions as visited in Atlas
- Log vacation days in Vacay
- Write journey entries across multiple trips
Changes made through MCP are broadcast to all connected clients in real-time — exactly like changes made in the web UI.
| Use case | Method |
|---|---|
| Interactive client (Claude.ai, Cursor, VS Code…) | OAuth 2.1 with browser consent — TREK issues tokens after you approve scopes in a consent screen |
| AI agent or script running unattended | Machine client (client_credentials) — token obtained directly via client_id + client_secret, no browser ever opened |
| Legacy setups | Static API token — deprecated, full access, no scopes |
See MCP-Setup for step-by-step instructions for each method.
-
MCP addon enabled — an administrator must enable the MCP addon (
mcp) from the Admin Panel before the/mcpendpoint becomes available and the MCP section appears in user settings. -
APP_URLset — theAPP_URLenvironment variable must be configured to your TREK instance's public URL so that OAuth discovery works correctly. Without it, clients that use OAuth 2.1 cannot complete authentication.
| Setting | Default | Environment variable |
|---|---|---|
| Requests per minute per user | 300 | MCP_RATE_LIMIT |
| Max concurrent sessions per user | 20 | MCP_MAX_SESSION_PER_USER |
| Session idle timeout (seconds) | 3600 | MCP_SESSION_TTL |
| SSE keep-alive interval (seconds, 0 = off) | 25 | MCP_SSE_KEEPALIVE |
Rate limits are tracked per user–client pair, so each OAuth client has its own independent window. Sessions expire after 1 hour of inactivity by default (MCP_SESSION_TTL); an open SSE stream counts as activity. The server also sends an SSE comment ping every 25 seconds so reverse proxies with idle timeouts (e.g. nginx's default 60s) don't kill the stream between tool calls.
Reaching MCP_MAX_SESSION_PER_USER does not refuse the request: the server closes that user's least-recently-active session to make room for the new one. This keeps a client that cannot hold onto its session id from locking itself out of the server.
Reverse proxy: MCP sessions depend on the
Mcp-Session-Idheader travelling in both directions. A proxy that strips it makes every tool call open a new session instead of reusing one. Nginx and Caddy pass it through by default — see Reverse-Proxy if you have customised header handling.
Kubernetes / multi-replica: MCP sessions are held in memory per instance. With more than one replica you need sticky sessions (or a single replica), or clients will intermittently see
404 Session not found.
https://<your-trek-instance>/mcp
If the MCP addon is not enabled, this endpoint returns 403. If authentication fails, it returns 401.
Admin: Enable the MCP addon in Admin-Addons. Set
APP_URLfor OAuth discovery. Revoke tokens and manage OAuth clients from Admin-MCP-Tokens. Adjust rate and session limits withMCP_RATE_LIMITandMCP_MAX_SESSION_PER_USER— see Environment-Variables.
- MCP-Setup — connect your AI client
- MCP-Scopes — choose the right permissions
- MCP-Tools-and-Resources — browse available tools
- Home
- Quick Start
- Install: Docker
- Install: Docker Compose
- Install: Helm
- Install: Proxmox VE (LXC)
- Install: Unraid
- Install: Portainer
- Reverse Proxy
- Environment Variables
- Updating
- Login and Registration
- OIDC SSO
- Two-Factor Authentication
- Passkeys
- Password Reset
- User Settings
- General Settings
- Appearance Settings
- Map Settings
- Notifications
- Offline Mode and PWA
- Languages
- My Trips Dashboard
- Creating a Trip
- Trip Members and Sharing
- Trip Planner Overview
- Places and Search
- Day Plans and Notes
- Map Features
- Route Optimization
- Weather Forecasts
- Reservations and Bookings
- AI Booking Import
- Transport: Flights, Trains, Cars
- Accommodations
- Costs
- Currencies
- Packing Lists
- Packing Templates
- Todos and Tasks
- Documents and Files
- Tags and Categories
- Calendar Feeds
- Real-Time Collaboration
- Collab Chat
- Collab Notes
- Collab Polls
- What's Next Widget
- Public Share Links
- Invite Links