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.
Choose how to provide credentials
Creating a token through MCP returns its raw value to your coding agent. Keeping it out of Git and chat replies does not prevent the agent provider from processing it under its own terms.
For manual entry, ask your agent to prepare configuration with placeholders and skip token creation. Create the token in the dashboard, then enter it directly into the gitignored file or CI secret store. Your agent can run the configured build to verify caching without reading or displaying the credential. See tokens and access control for scopes and rotation.
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
Use the Set up with AI prompt to configure your build tool and verify a real remote cache hit.
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.