Skip to main content

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: GET and DELETE on /mcp answer 405.
  • Protocol versions: 2025-06-18, 2025-03-26 and 2024-11-05, negotiated in initialize.
  • Methods: initialize, ping, tools/list and tools/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.

WhatWhere
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)
AuthorizationGET /oauth/authorize (continues on the app's consent page)
TokenPOST /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.

TokenLifetimeNotes
Authorization code5 minutesSingle use; a failed attempt burns it.
Access token (l7at_…)1 hourSent as Authorization: Bearer.
Refresh token (l7rt_…)30 daysReplaced 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, so localhost can't work. To try it locally, put a tunnel in front of port 8080 and use its address as API_URL.
  • APP_BASE_URL set to the web app's address: the consent page lives there.
  • CORS: the metadata, /oauth/** and /mcp accept any origin (no cookies are involved; every call needs a token or a PKCE verifier).

Settings​

VariableDefaultMeaning
API_URLhttp://localhost:8080The public address of the API. The connector address is this plus /mcp.
APP_BASE_URLhttp://localhost:5173The web app, where the consent page is.
MCP_ALLOWED_REDIRECT_HOSTSclaude.ai,claude.com,chatgpt.com,platform.openai.comHosts an AI app may be sent back to. Add one to allow another MCP client.
MCP_CALLS_PER_MINUTE120Requests 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.