Connect an AI agent with MCP
Cachely runs a Model Context Protocol server, so a coding agent can create the workspace and token, write the build-tool config, and read your cache insights without you copying anything out of the dashboard.
Connect your agent
Add a remote MCP server in your agent's MCP settings with this URL. It speaks Streamable HTTP:
https://app.cachely.dev/mcpThe first call returns 401 with a WWW-Authenticate header that points the client at the OAuth metadata. A client that supports MCP authorization takes it from there: it registers itself, opens a browser window, and you sign in to Cachely with Google or GitHub.
How sign-in works
It is standard OAuth 2.1 with dynamic client registration and PKCE (S256); there is no Cachely-specific grant and no API key to paste. The agent acts as you: it sees only the workspaces you can access, and the access token is refreshable, so you sign in once.
Discovery starts at /.well-known/oauth-protected-resource. The step-by-step flow, for clients that implement it themselves, is in auth.md, and the server is described for MCP registries by its /.well-known/mcp/server-card.json server card.
If you belong to more than one account, send an x-cachely-account header to choose which one the agent works in.
What the agent can do
- list_workspaces
- List your remote-cache workspaces.
- create_workspace
- Create a workspace, named after the repository by default. Rejected with
403when your plan's workspace limit is reached. - create_token
- Mint a token for a workspace with a name, a scope (
read,write, orread,write), and an optional expiry. The raw token is returned once. Passusageasdeveloperfor a laptop or pull-request build and the response warns when that token can write. Rejected with403at the plan's token limit and409when the name is taken. - setup_instructions
- Return the config files for Nx, Lerna, Turborepo, Gradle, or Bazel, as a dotenv file, shell exports, or a GitHub Actions secret, with the paths to gitignore. Read-only: the token in the output is always a placeholder, so the files are safe to commit.
- insights_summary
- Hit rate, hits, misses, uploads, bytes, and estimated build time saved over a look-back window (30 days by default, up to 365), filterable by workspace, project, and tool. Clients that support MCP Apps render it as a chart.
- insights_projects and insights_tools
- The same numbers broken down per project or per build tool.
- get_plan_usage
- Your plan, its limits, this period's usage, and what the next plan up would change.
The agent cannot read or download cached artifacts, delete a workspace, or revoke a token. Those stay in the dashboard.
A first prompt
Once connected, one request covers the whole setup:
Set up the Cachely remote cache for this repository: create a workspace
named after the repo, mint a read-write token for CI, write the config
from setup_instructions, and put the token only in a gitignored file.A token is a secret. Ask for a read-only token for developer machines, and keep the raw value out of chat history and commits - see tokens and access control.
Agent skills
The MCP server does the account work. For reviewing the repository itself - which targets are cacheable, what makes a cache unsafe to share - install the Cachely agent skills or run the cache audit.