Coding agents

Platform MCP server

Connect your coding agent to Polylane and query your context graph, telemetry, and code from your editor.

Polylane runs a Model Context Protocol server at:

https://mcp.polylane.com/mcp

The transport is streamable HTTP. Connect a coding agent and it gets two kinds of capability:

  1. The Polylane REST API over two tools (search and execute): threads, issues, automations, memories, repositories, cloud resources, change records, and everything else in the API reference.
  2. Polylane's agent tools over three tools (searchTools, runTool, runCode): the same tools Polylane's own agent uses. Query observability across every connected provider (Cloudflare, AWS, Datadog, Sentry, Axiom, Honeycomb, Vercel, Fly, Render), traverse the context graph, search code and change records, and read deployments and audit logs.

The tools

  • search: query the Polylane OpenAPI specification. You write a small async function; the server runs it in a sandbox against a pre-resolved copy of the spec. Read-only.
  • execute: call the REST API. Your function calls codemode.request({ method, path, query, body }).
  • searchTools: discover the agent tools available to your workspace and fetch their input schemas. Call this first. Results are filtered to what your credential can access.
  • runTool: run one agent tool by name. Pass the exact toolName and its arguments as a nested params object.
  • runCode: chain several agent tools in one call by writing TypeScript against a tools.<name>(args) namespace.

A tool only appears in searchTools if the workspace has the backing integration connected and your credential holds the matching scope.

Read-only by default

Agent tools are read-only unless you opt in. Reads (telemetry queries, graph traversal, code search) always work. Write tools stay hidden unless both hold:

  1. your API key or OAuth token carries the agent_tools:write scope, and
  2. the session sends the header x-polylane-allow-writes: true.

Even then, every write is screened by a safety model, and egregious writes are refused. If your client supports MCP elicitation, the server also asks you to approve each write before it runs; clients without elicitation fall back to the safety screen alone.

Authentication

The server accepts two credential forms.

OAuth (recommended). The server is a full OAuth 2.0 provider with dynamic client registration (/authorize, /token, /register). Connect without any headers and your client opens a browser: you approve the client, sign in to Polylane, and the client stores the tokens. An OAuth session can span several workspaces, so pass workspaceId (id or slug) on agent-tool calls.

API key (for headless setups). Where a browser sign-in is not possible, such as continuous integration or a remote machine, create a key in the console under Settings > API keys, or use the Create an API key button under Settings > Coding agents (see API keys and OAuth). Send it as x-api-key: <key> or as Authorization: Bearer <key> (keys start with sk_). An API key is bound to one workspace, so you can omit workspaceId.

Install in your editor

Add the server; your client opens a browser to sign in to Polylane on first use:

Terminal
claude mcp add --transport http polylane https://mcp.polylane.com/mcp

To authenticate with an API key instead, add --header "x-api-key: YOUR_API_KEY".

If you use an API key, create one first: in the console, go to Settings > API keys and create a key with the agent_tools:read scope. The key is shown once and starts with sk_. Replace YOUR_API_KEY with it.

To allow writes for a session, add the header x-polylane-allow-writes: true alongside your credential, and use a key or token with the agent_tools:write scope.

Example prompts

Once connected, ask your agent things like:

  • "Use Polylane to show me the error rate for the worker this branch deploys, over the last hour."
  • "What changed in production for the checkout service in the last day? Check Polylane's change records."
  • "Find the api-gateway node in the topology and list what it depends on."

The agent calls searchTools to find the right tool, then runTool to run it, or runCode to chain several.

Checking the connection

A healthy server responds to:

Terminal
curl https://mcp.polylane.com/

with a JSON status document. A machine-readable server card is at https://mcp.polylane.com/.well-known/mcp/server-card.json.

For a raw MCP request with an API key:

Terminal
curl -X POST https://mcp.polylane.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}},"id":1}'

Other MCP entry points

  • To map a repository with no account, connect the anonymous maps server at https://maps.polylane.com/mcp instead. It exposes a separate, map-only tool roster (startMapping, getNextStep, publishMap, getMapStatus, submitMapDelta), takes no credential, and can touch nothing in Polylane but its own map. See Map.
  • To let Polylane's agents call tools from a server you run, connect it as an MCP integration instead.
  • The documentation site runs a separate MCP server so coding agents can search and read these docs. See Docs MCP.
  • For a command-line interface instead of MCP, see the CLI.