For administrators and developers
This page is for whoever runs Linear7, or wants to connect an MCP client other than ChatGPT and Claude.
What it is
Linear7 serves a Model Context Protocol server at:
POST https://<your-api-host>/mcp
- Transport: Streamable HTTP, stateless, JSON responses. There is no event stream:
GETandDELETEon/mcpanswer 405. - Protocol versions:
2025-06-18,2025-03-26and2024-11-05, negotiated ininitialize. - Methods:
initialize,ping,tools/listandtools/call. Notifications are answered with 202. - Batches: up to 20 messages.
- Only tools are offered. There are no resources or prompts.
The tools are the ones in the tool reference. Tools whose names start with find or list are marked read-only; issueInvoice is marked destructive. A tool failure caused by the request (for example missing access) comes back as a tool result with isError: true and a plain message; anything else is a generic message, so nothing internal leaks.
Signing in (OAuth 2.1)
Both ChatGPT and Claude require OAuth for a custom connector, so Linear7 is its own authorization server.
| What | Where |
|---|---|
| Protected-resource metadata (RFC 9728) | /.well-known/oauth-protected-resource and /.well-known/oauth-protected-resource/mcp |
| Authorization-server metadata (RFC 8414) | /.well-known/oauth-authorization-server |
| Dynamic client registration (RFC 7591) | POST /oauth/register (30 an hour per IP) |
| Authorization | GET /oauth/authorize (continues on the app's consent page) |
| Token | POST /oauth/token |
A request without a valid token gets 401 with a WWW-Authenticate: Bearer resource_metadata="…" header pointing at the metadata, which is how a client finds everything else:
curl -i -X POST https://<your-api-host>/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"ping"}'
The flow: authorization code with PKCE (S256 only). Client authentication may be client_secret_basic, client_secret_post or none. The one scope is mcp.
| Token | Lifetime | Notes |
|---|---|---|
| Authorization code | 5 minutes | Single use; a failed attempt burns it. |
Access token (l7at_…) | 1 hour | Sent as Authorization: Bearer. |
Refresh token (l7rt_…) | 30 days | Replaced on every use. Using an already-replaced one cancels the whole connection. |
Tokens are random and stored only as SHA-256 hashes. A connection belongs to one user and one workspace, chosen on the consent page. Access is re-read from the database on every call, so removing a member or changing their grants applies at once. An ordinary app session token is not accepted on /mcp, and an MCP token is not accepted on /api.
Redirect addresses must be https on an allowed host, or http on a loopback address, with no user information or fragment. They are checked at registration, at authorization, and again when the person approves.
Requirements
- A public https address for the API (
API_URL). ChatGPT and Claude call it from their own servers, solocalhostcan't work. To try it locally, put a tunnel in front of port 8080 and use its address asAPI_URL. APP_BASE_URLset to the web app's address: the consent page lives there.- CORS: the metadata,
/oauth/**and/mcpaccept any origin (no cookies are involved; every call needs a token or a PKCE verifier).
Settings
| Variable | Default | Meaning |
|---|---|---|
API_URL | http://localhost:8080 | The public address of the API. The connector address is this plus /mcp. |
APP_BASE_URL | http://localhost:5173 | The web app, where the consent page is. |
MCP_ALLOWED_REDIRECT_HOSTS | claude.ai,claude.com,chatgpt.com,platform.openai.com | Hosts an AI app may be sent back to. Add one to allow another MCP client. |
MCP_CALLS_PER_MINUTE | 120 | Requests per person per minute (HTTP 429 / a JSON-RPC error beyond it). |
MCP calls don't use the in-app assistant's allowance or the OpenAI key: they have their own limit above.
PDFs
A model can't receive bytes, so generatePdf returns a signed link to GET /mcp/files/{token}. It is valid for 10 minutes, and when it is opened the person's access is checked again, so a link can't outlive someone's access.
Not offered
Scopes beyond mcp, server-initiated messages, resources and prompts.