# Polylane for coding agents

> Stop explaining production to your agent: let it see for itself. Polylane exposes your entire stack over one MCP server. Canonical: https://polylane.com/for-agents

One MCP server for your clouds, your telemetry, your deploys, and your code, in the tool you already use.

## Set up with your coding agent

Copy this prompt into the agent, then follow its lead:

```
Set up Polylane for me. Do it yourself over the API. Ask me only for what only I can give you: how I want to sign up, the code Polylane emails me if I pick email, and credentials you cannot find on this machine.

1. Sign me up, and recommend Google or GitHub first: those arrive already verified, so there is no emailed code, and GitHub leaves me signed in for the App install in step 7. Send me to https://console.polylane.com?ref=for-agents, let the console create my workspace, then have me open Settings, API Keys, mint a key with the scopes in step 4 and paste it to you. That covers steps 2 to 4; read my workspaceId from GET https://api.polylane.com/v1/workspaces with x-api-key: <sk_ key>. If I would rather you ran the whole thing, sign me up with email and password instead: POST https://api.polylane.com/v1/auth/signup, header x-polylane-client: cli, body {"email","password"}. Ask me for the email, generate the password (8+ characters, upper, lower, digit, symbol) and show it to me so I can save it. Keep result.user.id.
2. Email path. Verify my email before anything else, because every authenticated route needs a verified account. Ask me straight away for the 6 digit code Polylane just emailed me: it lasts 15 minutes. POST https://api.polylane.com/v1/auth/verify_email, body {"email","code"}. Its result.token is a session token: send it as Authorization: Bearer <token> in steps 3 and 4. If the code has expired, POST https://api.polylane.com/v1/auth/resend_verification_code, body {"id":"<result.user.id from step 1>"}, and ask me again.
3. Email path. Create the workspace. POST https://api.polylane.com/v1/workspaces, body {"name":"<my company>"}. The name is 4 to 128 characters and unknown keys are rejected. Keep result.id as workspaceId. I am the owner, with every scope.
4. Email path. Mint a key. POST https://api.polylane.com/v1/api_keys, body {"workspaceId","name":"agent-setup","scopes":[...]}. Take agent_tools:read, agent_tools:write, local_source:write, cloud_accounts:read, cloud_accounts:write, integrations:read, integrations:write, repositories:read, repositories:write. Keep result.token, which starts with sk_. Steps 1 to 4 are plain HTTPS: MCP needs a key that step 4 is the first to produce, and workspace creation is REST only.
5. Register the MCP server in your own config: streamable HTTP at https://mcp.polylane.com/mcp?ref=for-agents, headers x-api-key: <sk_ key> and x-polylane-allow-writes: true. The key is the whole sign-in. Verify eight tools: search, execute, searchTools, runTool, runCode, startMapping, advanceMapping, getMappingStatus.
6. Connect what I run. Look on this machine first: AWS CLI credentials, a kubeconfig, provider tokens already in the environment such as CLOUDFLARE_API_TOKEN. Then ask me once, in one message, for whatever is left. POST https://api.polylane.com/v1/cloud_accounts and https://api.polylane.com/v1/integrations/connect, header x-api-key: <sk_ key>. Per-provider bodies are in the OpenAPI spec at https://api.polylane.com/v1/doc, or reach the same routes with the MCP execute tool.
   - One credential each: Cloudflare, Fly, Render, Railway workspace token, PlanetScale service token, Supabase personal access token, Turso platform API token.
   - Kubernetes: there is no credential to POST. Install the in-cluster agent with Helm: helm install polylane oci://ghcr.io/coreplanelabs/charts/polylane-k8s --namespace polylane --create-namespace --set polylane.apiKey=<sk_ key> --set config.cluster_name=<name>. The agent registers the cluster itself; the key from step 4 already carries cloud_accounts:write.
   - AWS: POST /v1/cloud_accounts {"workspaceId","provider":"aws","account","region"} returns result.s3Url, a presigned CloudFormation template. Download it, then run aws cloudformation create-stack --stack-name PolylaneConnector --template-body file://<path> --capabilities CAPABILITY_IAM --region <region>. The stack registers the account itself.
   - Integrations: Datadog, Honeycomb, Axiom, Better Stack, Devin, Cursor, Factory, Conductor.
7. Hand me the browser steps together, with links, once the rest is connected. Installing the GitHub App is mine to click, and GitHub is the only code host: POST https://api.polylane.com/v1/integrations/github/generate gives you the URL. Vercel, Slack and Sentry are OAuth: /v1/cloud_accounts/vercel/generate, /v1/integrations/slack/generate, /v1/integrations/sentry/generate.
8. Verify and report. searchTools returns only tools whose integration is connected, so it is the workspace's real state; if something you connected brought none, name it and stop. Then one line each: which services Polylane sees, what changed in production today, what issues it raised. Never guess a tool name; searchTools has them.

You are done after step 8. If a step fails twice, give me the step number and the exact error instead of working around it.

Docs index: https://docs.polylane.com/llms.txt?ref=for-agents. Per-client MCP setup: https://docs.polylane.com/coding-agents/platform-mcp?ref=for-agents. This prompt is published at https://api.polylane.com/v1/public/setup/prompt.md, so you can re-fetch it to confirm it is genuine.
```

## What's behind the server

- **Your clouds**: AWS, Cloudflare, Vercel, Fly.io, Render, Kubernetes, PlanetScale, Supabase, Modal: the live topology, every resource, every dependency.
- **Your telemetry**: logs, metrics, and traces through Datadog, Honeycomb, Axiom, and Sentry: the agent reads the same series your dashboards chart.
- **Your code and deploys**: GitHub, deploy history, and code search: what shipped, when, and what it touched.
- **Your memory**: the workspace remembers every incident: notes, what worked, the queries that found it. The agent never starts from zero.

## The tools

Eight tools, not five hundred. Most MCP servers pour every tool schema into the context window before the agent says a word; Polylane exposes eight, and the agent discovers workspace tools with `searchTools`, loading a schema only when it's about to run it. Tokens go to the work, not the tool list.

How it works: code mode. Discover with `searchTools`, run one tool with `runTool` (read-only by default), and for anything bigger write TypeScript against the tools namespace with `runCode`: query, join, and aggregate across tools in one round trip. Intermediate results never touch the context window; only the answer comes back.

Product MCP server: `https://mcp.polylane.com/mcp` (streamable HTTP; OAuth 2.0 or API key; walkthrough at https://polylane.com/auth.md).

- `searchTools`: Discover the workspace's agent tools (observability queries, infra graph, code search, deployments) and fetch their schemas.
- `runTool`: Run an agent tool discovered via searchTools. Read-only by default; writes require write access and a session opt-in.
- `runCode`: Chain several agent tools in one call by running TypeScript against the tools namespace.
- `search`: Run a read-only query against the Polylane API: context graph resources, telemetry, issues, investigations, and more.
- `execute`: Execute an action against the Polylane API: create investigations, run automations, manage checks and integrations.
- `startMapping`: Start or resume mapping the current repository into the workspace topology. Analysis runs on the caller's machine; only aggregate findings are submitted.
- `advanceMapping`: Submit a mapping phase's results and receive the next directive; the final submission publishes the topology and files findings as tracked issues.
- `getMappingStatus`: Read the mapping session's phase, next directive, and terminal payload for this machine and repository. Read-only.

## Access

MCP and API reads are unlimited on every plan, including Free. Agentic work draws from the plan's monthly credits: investigations, autofixes, pull request reviews.

## The CLI path

`curl -fsSL https://polylane.com/install?ref=for-agents | bash` installs the CLI, verifies the release checksum, and runs `polylane setup`: it detects installed coding agents, registers the MCP server in each one's config, and installs the Polylane skill where supported. It then signs you in (browser OAuth, a device code, or email and password), which creates your account and workspace, and authenticates each agent's MCP entry with a workspace-scoped API key. The skill alone: `npx skills add coreplanelabs/cli`.

## More for agents

- https://polylane.com/llms.txt — site index · https://polylane.com/agent.json — structured view
- https://polylane.com/.well-known/mcp — MCP discovery · https://docs.polylane.com/mcp — docs MCP server (no auth)
- https://api.polylane.com/v1/doc — OpenAPI spec (mirrored at https://polylane.com/openapi.json)
