Linear

Lightweight, dependency-free, in-memory fake of the Linear GraphQL API for testing code that uses the real @linear/sdk client or raw GraphQL requests against https://api.linear.app/graphql.

Default port: 4788

The fake includes a minimal but real GraphQL parser: the query string is tokenised, the operation type (query/mutation) and top-level fields + arguments are extracted, $variables are substituted from the request variables map, and each field is dispatched to an in-memory resolver.

Quick start

import { LinearServer } from "./services/linear/src/server.js";

const server = new LinearServer(4788);
await server.start();
// ... run your app/tests ...
await server.stop();
const res = await fetch("http://127.0.0.1:4788/graphql", {
  method: "POST",
  headers: { Authorization: "lin_api_xxx", "Content-Type": "application/json" },
  body: JSON.stringify({
    query: `mutation { issueCreate(input: { title: "Hello" }) { success lastSyncId issue { id identifier title } } }`,
  }),
});
// => 200 { data: { issueCreate: { success: true, lastSyncId: 1, issue: { id, identifier: "PAR-1", title } } } }

Access via MCP / preview URL

Point your MCP server / agent tooling at the preview URL printed by the parlel pool (defaults to http://127.0.0.1:4788). Set LINEAR_BASE_URL to that URL and provide any non-empty LINEAR_API_KEY — like real Linear, the fake accepts a raw personal API key (Authorization: lin_api_xxx, no Bearer prefix) or an OAuth Bearer token. Only POST /graphql is served.

Implemented operations

POST /graphql is the only API endpoint and requires a non-empty Authorization header.

Queries

Mutations

Service & inspection

Surface coverage

This emulator faithfully replicates the API surface most application code and agents exercise. Anything below the supported lines is either an intentional design choice for a fast, zero-cost local emulator (✓ By design) or a candidate for a future release (⟳ Roadmap) — never a silent inaccuracy.

Legend: ✅ supported · ◐ accepted (stored, not strictly enforced) · ✓ by design · ⟳ on the roadmap.

FeatureStatus
viewer, teams, issues, issue, comment queries✅ Supported
issueCreate / issueUpdate / issueDelete / commentCreate mutations✅ Supported
Mutation payloads return success + lastSyncId + entity✅ Supported
Issue fields number, priorityLabel, updatedAt, branchName, nested team/creator/assignee✅ Supported
Relay pageInfo (startCursor, endCursor, hasPreviousPage, hasNextPage)✅ Supported
GraphQL parsing (variables, args, aliases, nested selections)✅ Supported (minimal real parser)
Auth via raw API key or Bearer (any non-empty credential)✅ Required
Missing/invalid auth → HTTP 400 + GraphQL errors (extensions.type: "authentication error")✅ Supported
issueUpdate / issueDelete on unknown id → GraphQL entity-not-found error✅ Supported
List args (first, after, filter, orderBy)◐ Accepted-not-enforced
Field-level selection pruning (returning only requested fields)◐ Returns full resolver objects
Fragments, directives, introspection⟳ Roadmap
Projects, cycles, labels CRUD, workflow-state transitions⟳ Roadmap
Webhooks / file upload / OAuth actor authorization⟳ Roadmap
API key validity / scope enforcement✓ By design — any non-empty credential is accepted — no real secrets needed

Error codes & shapes

Like the real Linear API, errors use the GraphQL { "errors": [ { "message", "extensions", "path" } ] } envelope:

Manifest

See services/linear/manifest.json:

<!-- parlel:testenv:start -->

Configuration — test.env

Copy these into your test.env (used by the bridge sidecar flow). Tokens are Parlel's seeded test credentials — any non-empty value is accepted by the emulator, so you rarely need to change them. Swap in real credentials only when pointing at the live service in prod.env.

LINEAR_API_KEY=lin_api_parlel
LINEAR_BASE_URL=http://parlel-bridge:4788
<!-- parlel:testenv:end -->