Gagarin Cloud MCP Server
OfficialA credential-scoped MCP bridge to Gagarin Cloud that lets an agent inspect and manage projects, services, resources, access, billing, and lifecycle operations through Gagarin’s API.
Inspect identity, platform health, projects, service/job status, logs, deploy history, dependencies, resource keys/secrets, backups, members, billing, and credentials.
Create projects; deploy existing registry images as services; run images as jobs; add/remove domains; roll back service revisions or external resource values.
Provision and manage resources such as Postgres, Qdrant, Valkey, and external config/secrets; rotate credentials; set service dependencies; back up and restore into new resources.
Manage access: share/unshare projects, offer/withdraw ownership transfer, and create/revoke CI credentials.
Perform destructive actions such as deleting services, resources, or projects only with human approval where required.
Cannot build/push images, open tunnels, block until jobs finish, or click approvals; those remain CLI/human tasks (
gg ship,gg connect,gg run).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gagarin Cloud MCP Server Deploy the image my-api:latest to production"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp
mcp.gagarin.cloud — deploy with ease, maintain without fear.
Add one URL to your agent and it can run your app at a live HTTPS address, give
it Postgres, Qdrant, Valkey, a queue or a bucket, wire what may reach what, and
roll back. Alerts, logs, metrics, backups and project memory come with it, and nothing is
deleted without your approval by email. It is Gagarin's API, as tools: 57 of
them, every one annotated so a client knows which to ask you about first.
Building and pushing an image needs docker and the source, so that one step is
gg ship on the machine that has them; everything after it is here.
https://mcp.gagarin.cloud/mcpThe Model Context Protocol is how an agent finds and calls a tool it was not built with. This is Gagarin's, and it exists so that adding Gagarin to a coding agent is a URL rather than an install — the one artefact that makes the platform installable rather than merely documented.
Two ways in, one implementation:
remote |
|
local |
|
Signing in
Remote, with OAuth. Give the client the URL and nothing else:
https://mcp.gagarin.cloud/mcpClaude, ChatGPT, Codex and Claude Code prompt for sign-in when they connect: the
client opens a browser and the human signs in with GitHub or Google. In ChatGPT
and Codex the URL arrives inside the Gagarin plugin
(gagarin-cloud/plugin); OpenAI's
plugin portal proves the hostname is ours by reading a token it chose at
/.well-known/openai-apps-challenge, which this server serves as plain text
from OPENAI_APPS_CHALLENGE and does not serve at all when that is unset. A request with no
credential answers 401 with a WWW-Authenticate header pointing at
/.well-known/oauth-protected-resource/mcp, which names api.gagarin.cloud as
the authorization server. This server decides nothing about a token itself; the
engine does, on every call. GAGARIN_MCP_ORIGIN and GAGARIN_ISSUER override the two public
names for a development setup; they are separate from GAGARIN_API, which in
the cluster is the in-cluster Service and no address a client could sign in at.
Remote, with a credential in a header. For a client that cannot sign in
over OAuth, or a machine that should not: a credential from gg login or
gg creds create.
{
"mcpServers": {
"gagarin": {
"type": "http",
"url": "https://mcp.gagarin.cloud/mcp",
"headers": { "Authorization": "Bearer <your gagarin credential>" }
}
}
}Local, over stdio. npm run stdio from a clone runs the same tools over a
pipe, reading the file gg login wrote, or GAGARIN_TOKEN if it is set. It is
here to develop against, and is deliberately not published to npm: the point of
this server is that adding Gagarin to an agent is a URL and not an install, and
a package on somebody's laptop is a second copy of src/tools.ts that goes
stale the day a tool changes.
A credential that has expired or been revoked is caught at the door too, because
a client signs in again only on an HTTP 401: every POST asks the engine
/v1/whoami with the caller's token first, and the engine's 401 becomes a 401
with error="invalid_token". One extra in-cluster call per request, and no
cache — a remembered token is a stored token, and this server stores none. Any
other failure there (the engine unreachable, a 5xx) is not a sign-in problem, so
the request goes on and each tool reports it with the engine's own code.
Related MCP server: LangGraph FastAPI MCP Server
Developing
npm install
npm run build
npm test # builds, then node --test over dist/
npm start # the HTTP server on :8080
npm run stdio # the same tools over a pipeWhat is here
path | what it is |
| the whole of this server's contact with Gagarin: one request, one error envelope |
| every tool — each one a path, a shape, and the rule a caller needs before using it |
| what a client is told on connect, and the |
| mcp.gagarin.cloud: stateless streamable HTTP, one server per request, the OAuth protected-resource metadata, and OpenAI's domain-verification path |
| the listener, its configuration and its drain |
| the same tools over a pipe, for developing against from a clone |
| reads the credential file |
| the image mcp.gagarin.cloud runs. Its build stage runs the tests |
Project memory
Every project carries a memory: small, durable facts an agent saves about a
codebase — a decision and why, a convention, a gotcha — so the next session does
not rediscover them. It is a built-in of the project, like its registry, and
these tools are the only way to reach it: the memory service has no address
of its own, no gg command and no console page. The engine decides who may
read (viewer) and who may write (editor), on every call, like everything else.
tool | what it does |
| what is known about a project, packed to a token budget — the first call on a project; |
| hybrid semantic + keyword search; no query browses by rank |
| memories in full, by id or key |
| walk the links out from one memory |
| save one fact; a near-duplicate is refused with the memories it collided with, and a |
| change fields, set or clear the key, pin, archive, |
| associate two memories, or stop |
| housekeeping: likely duplicates, orphans, oversized, stale, unread and disputed memories, distance to the cap |
Export and import have no tool: they are for people and scripts, and a tool's definition costs tokens in every session whether it is called or not.
These answer the memory service's own text — a plain-text rendering packed to
the budget — rather than the JSON around it. That is a narrower case of the rule
below, not an exception to it: the rendering is still the engine's, and returning
both would spend twice the tokens the service exists to save. A body without
text comes back as JSON like any other answer.
It is a translator, and nothing else
It holds no credential of its own, has no database, and makes no decision the
API does not make. Every tool is one call to api.gagarin.cloud carrying the
caller's own bearer token, and every refusal is the engine's refusal passed
through unedited.
That is the property everything else rests on: possessing this server grants nothing at all. It is what makes it safe to put a public endpoint in front of a single write gate, and nothing here may be changed in a way that weakens it.
Two consequences worth stating, because both look like omissions:
Answers are the engine's JSON, not a summary of it. Every service, ledger line and connection already carries a
sentencewritten by the engine, precisely so a terminal and a dashboard cannot describe the same row differently. A third renderer here would be a third opinion to keep in step.Errors are
[code] messagewith ahint:line, which is whatggprints. One format, so an agent that has read the Gagarin skill recognises what comes back here without being taught a second one. When the engine sends more than the envelope — amemory_duplicatecarries the near-duplicates — that is appended after the hint rather than dropped.
What it deliberately cannot do
Four things need a machine, and offering them here would produce failures that read like platform faults:
Build and push an image.
gg ship— build, push and deploy fused — shells out to docker where the source is.deployhere runs an image that is already in Gagarin's registry: a tag CI pushed, or a restatement. Getting one there is the CLI's job.Open a tunnel.
gg connectbinds a local port.Wait for a job to finish.
runsubmits and returns a revision, like every other write here.gg runblocks until the run ends and exits with the script's own exit code, which is what a pipeline wants; over MCP you pollstatusfor the phase and the code.Click an approval. That is a human with an inbox, by design.
There is also no list of resource types, sizes or scopes in this repository. The
engine owns those and its refusals name them; a z.enum here would be a second
list in a second repository, wrong on the day a type is added — a mistake this
codebase has already made once, in gg, about this exact family of values.
Where it runs
In the Kubernetes cluster, next to the control plane, and not on Vercel beside the site and the console. Those two live outside Scaleway because their job is to still be there and say the platform is down. This one has nothing whatever to say when the API is unreachable; it is that API in another shape, so it belongs next to it and reaches it over the in-cluster Service rather than hairpinning out through the load balancer.
The pod runs as a ServiceAccount with no RBAC and no mounted token, on a read-only root filesystem. It needs none of them.
Every push to main builds the image and rolls it out —
.github/workflows/deploy.yml. The credentials that can do that are secrets of
the production environment, which only main may use, so a pull request never
runs next to them. Merging to main is deploying.
Adding a tool
One server.registerTool call in src/tools.ts: a name, a description saying
the rule a caller most needs, a zod shape, and one api.call. Then a test in
src/tools.test.ts asserting the path, the method and the body — those are the
only things it is possible to be quietly wrong about, and a deploy that PUTs to
the wrong path answers 404 and reads like a missing service.
Do not add a tool for something the API does not do. This file has no business being the place a feature appears first.
Available Tools
35 toolsadd_domainPut a service on the internetAIdempotentInspect
With no domain, hands out gagarin's own generated address and the certificate is already held. With one, claims that name — and the answer says what DNS record the owner has to add before it can be issued. Both are idempotent; restating one repairs its ingress. A service is private until this call and a deploy can neither give an address nor take one away.
Inputs: project (required), service (required), domain.
add_resourceProvision a managed resourceAIdempotentInspect
Something gagarin runs on your behalf — a database, a cache, a vector store — or an external, a row that runs nothing and only publishes values. You name it and say how big; the platform decides the rest. If a type exists, use it rather than deploying your own; the refusal from an unknown type names the ones there are. Nothing reaches it until a service declares it in deps. Use an external for third-party credentials AND for shared configuration — a feature flag, a log level, a region, an API base URL — anything more than one service reads, or that should change without a deploy. An env passed to a deploy is a copy, so two services sharing a setting is two copies that can disagree and two deploys to change it; an external is one row, changed with rotate_resource (set/unset for one key), undone with rollback, and every holder is restarted for it. Config owned by a single service stays in its deploy env, because that is the half a service rollback restores. The decisive difference when you do not have the user's env file: a service's environment can only be changed by deploy, which replaces it wholesale, so changing one variable means having all of them. An external takes a single key. If a user asks you to change a setting and you were not given their environment, an external is the answer — and if that setting currently lives in a deploy env, say so and offer to move it. Keys are published under the resource name — config holding LOG_LEVEL publishes CONFIG_LOG_LEVEL — so name the resource for how the application wants to read it.
Inputs: type (required), project (required), resource (required), env, +2 more.
backup_resourceTake a backup nowBInspect
A snapshot at this moment, on top of the nightly ones. Rate limited, so do not call it in a loop.
Inputs: project (required), resource (required).
backupsWhat has been backed upARead-onlyInspect
Every stored backup of a resource, newest last. Keys are UTC timestamps, so they sort chronologically, and one is what restore_resource takes for an exact point.
Inputs: project (required), resource (required).
billingWhere the account standsARead-onlyInspect
Balance, burn rate and runway — how long what is running now can keep running. A suspended account refuses every deploy, and a runway measured in hours is worth telling your human about before it becomes an outage.
Inputs: no named parameters.
billing_historyThe ledgerARead-onlyInspect
The rows the balance is folded from: metered usage every quarter hour, top-ups, credits and adjustments. Each carries a sentence written by the engine and an amount already rendered, so nothing here needs re-computing.
Inputs: no named parameters.
create_credentialMint a credential for CIAInspect
Issues a second credential from this one, for a pipeline that has no inbox to approve anything with. It can deploy and nothing else, it expires, and it cannot mint another — none of which are parameters. The secret comes back once and is never readable again, so put it straight into the secret store it is for. A credential that was itself minted cannot call this.
Inputs: name (required), expires_in_days.
create_projectCreate a projectBInspect
A project is the unit of naming, access and billing: everything else lives inside one. Returns its id, which is what image paths are built from.
Inputs: name (required).
credentialsWhat has access to this accountARead-onlyInspect
Every credential, what it may do, when it was last used and when it expires. The one making this very call is marked current.
Inputs: no named parameters.
deployRun an image that is already in the registryAIdempotentInspect
Declares what a service should be. The image must already be in gagarin's own registry under this project — gagarin runs nothing else — and this server cannot put it there: building and pushing need docker and the source, so they happen on a machine, with gg ship (build, push and deploy in one) or gg build + gg push in CI. Use this tool to deploy an image that exists: a new tag CI pushed, or a restatement. For an image that runs to completion rather than listening — a migration, a backfill — that is run, and the two cannot be swapped: deploying over a job is refused not_a_service.
Three rules the shape of this call depends on. Env is replaced wholesale, so restate every variable on every deploy — the domain, the size and the dependencies all survive a deploy that forgets to mention them. That also means you cannot change one variable without holding them all: if you were not given the environment, do NOT reconstruct it from history and redeploy — that drops anything you misread and pulls every secret the service holds through this conversation. Put the value in an external resource instead, where rotate_resource changes one key on its own. A volume must be restated too, and for the opposite reason: it cannot be changed, so a service that has one is refused volume_immutable unless volume_path and volume_size_gb come back exactly as status reports them. And a deploy neither gives an address nor takes one away: that is add_domain. A service is private until it has one, and a private service is reachable only by services that declared they need it.
Inputs: port (required), image (required), project (required), service (required), +6 more.
depsWhat a service may reachARead-onlyInspect
Its outgoing edges, what depends on it, and how the graph got that way. A private service is default-denied: until the caller declares the edge, its calls are dropped, which hangs rather than failing fast — so this is the first thing to read when something times out talking to something else in the same project.
Inputs: project (required), service (required).
destroy_projectDelete a whole project (needs a human)ADestructiveInspect
Everything in it: every service, every resource, every volume, every backup. Answers approval_required and emails the account owner a button; call it again after they have clicked. Say plainly what will be lost before you ask for this.
Inputs: project (required).
destroy_resourceDelete a resource and its data (needs a human)ADestructiveInspect
Answers approval_required and emails the account owner a button. Call it again after they have clicked. The data goes with it — take a backup first if there is any doubt, and note that services still declaring it will start failing to connect.
Inputs: project (required), resource (required).
destroy_serviceDelete a service (needs a human)ADestructiveInspect
Answers approval_required and emails the account owner a button. Call it again after they have clicked, within the window the hint names. Deletes the service, its ingress and its volume; the images stay in the registry. Jobs go the same way, taking their kept runs with them.
Inputs: project (required), service (required).
ejectTake everything and leaveARead-onlyInspect
The Kubernetes manifests, Dockerfiles and connection details for a whole project, so it can be run somewhere else. Owner only: what comes back includes every service's environment in the clear.
Inputs: project (required).
historyEvery deploy of a serviceARead-onlyInspect
Each recorded revision with its image, port, environment and the dependencies it ran under. revision is what rollback takes — and for a job it is also what each run was called, so this is the list of runs.
Inputs: project (required), service (required).
logsRecent logsARead-onlyInspect
The last 200 lines from a service, or from a job's latest run. A tail, not a stream — there is no more, and for a job there is no way to read a run older than the last one.
Inputs: project (required), service (required).
membersWho can reach a projectARead-onlyInspect
The owner and everyone it has been shared with, plus a pending offer of ownership when there is one. The owner is a property of the project rather than a row in the list: one account pays, and that is not a role granted or revoked — it moves only through transfer.
Inputs: project (required).
platform_healthIs gagarin upARead-onlyInspect
The platform's own readiness, unauthenticated. Answers whether the control plane can reach its database and cluster and when the reconciler last ran — not whether your service is up, which is status.
Inputs: no named parameters.
projectsEvery project you can reachARead-onlyInspect
Projects this account owns or has been shared with, and the role on each. A viewer role means every deploy will be refused, which is worth knowing before the attempt. Names are unique only within one account, so two rows can share a name — the id tells them apart, and every other tool takes either.
Inputs: no named parameters.
remove_domainTake an address awayADestructiveInspect
With a domain, releases that custom name. With none, takes the service off the internet entirely — which is refused while a custom name still points at it, since that would leave somebody's DNS aimed at a host gagarin no longer serves. Needs a human's approval, like every other release.
Inputs: project (required), service (required), domain.
resource_keysWhat a resource publishes, by nameARead-onlyInspect
The variable names a resource publishes to whatever declares it — and no values. Prefer this over resource_secrets unless you actually need a value. It answers the question you usually have: what is in this bundle, and what is a key called, before you change one of them with rotate_resource — an external might publish API_KEY or TOKEN and only this says which. The values are never fetched, so nothing secret enters this conversation; status will not tell you either, since it reports only that the resource publishes NAME_*.
Inputs: project (required), resource (required).
resource_secretsA resource's connection valuesARead-onlyInspect
The host, port, user, password and URL a client would need. For reading, and for something outside the project: a service inside it should declare the resource in deps instead, which hands the same values over without anybody copying a password. This returns live credentials into this conversation, so call it only when a value is what you need — to hand a connection string to something outside the project, or to verify a rotation. If you only need to know what the resource publishes, or what a key is called, that is resource_keys and it returns no values.
Inputs: project (required), resource (required).
restore_resourceRestore a backup into a new resourceAInspect
Fills a new resource from another one's backup and never overwrites anything — which is why it needs no approval and cannot lose data.
Three calls, in this order, and the first two are not optional: add_resource to create the destination with the same type as the source, status until it is running, then this. A restore into a name that does not exist answers no_such_resource, and one into a resource that exists but has not come up yet answers restore_failed — the data is loaded into a live resource, not conjured as one.
resource is that new name; source is the resource whose newest backup to take, or backup is one exact key from backups. Point the dependents at the new name with set_deps once you have checked it.
Inputs: project (required), resource (required), backup, source.
revoke_credentialTake a credential awayAIdempotentInspect
Stops a credential working immediately. credentials gives the id.
Inputs: id (required).
rollbackPut a past revision backAInspect
Deploys a revision this service already ran. No human approval, because it restores a state that was already approved once; it refuses to cross a change of volume. Rolling a job back is not a restoration but a re-run of that earlier image, under a new revision — so only ask for one if running it twice is safe. It restores the image and the environment of the deploy, and NOT the variables the service inherits from resources it needs — those are resolved from the graph as it stands now, so a rollback never puts a service back onto a rotated password. To undo a config change, roll back the external resource holding it, not its dependents: name the resource here and every service declaring it is restarted with the restored values. An external can be rolled back because its values are the user's; a postgres, qdrant or valkey cannot, because gagarin mints those and there is no earlier value of theirs to return to.
Inputs: project (required), service (required), to.
rotate_resourceReplace a resource's credentialsAInspect
New credentials, and everything holding them rolls to pick them up. For an external the new values are yours to supply and required; for everything else they are gagarin's to mint and supplying them is refused. An external usually holds several values, and there are two ways to change them: set/unset change the keys you name and leave the rest exactly as they are, while env says the bundle is now precisely this and drops every key not in it. Reach for set when one key is being replaced — env with a single key would take the others away from every dependent. The answer names what changed and what stopped being published, so read removed before reporting success.
Inputs: project (required), resource (required), env, set, +1 more.
runRun an image to completionAInspect
Submits a job: an image that runs, exits, and is done — a migration, a backfill, a one-off script. Not a service. It has no port and no volume, nothing can be told to reach it, and it is never restarted by the platform: a script that exits non-zero is reported as having failed, once, with its code.
Like deploy, the image must already be in gagarin's registry and this server cannot put it there. And like deploy, this returns without waiting. It answers a revision, which is the run's name; status reports that run's phase and exit code, and logs reads it. There is no tool here that blocks until a run finishes — gg run does that on a machine, exiting with the script's own code, which is what CI wants.
Calling this again is the next run, not a restatement: each one is a new revision, and the three most recent are kept so the previous run's logs survive. A name that is already a service is refused not_a_job — the two are not two states of one thing.
Inputs: image (required), project (required), service (required), env, +3 more.
set_depsDeclare what a service may reachAIdempotentInspect
Replaces the complete set of things this service may reach, so an empty list means "nothing" and is a real request. Declaring a resource opens the route and hands over its connection variables, so connecting a database is this one call and not a call plus a deploy — the dependents roll on their own. To add without risking a withdrawal, pass deps on deploy instead.
A set that drops an edge this service currently holds needs a human: it answers approval_required and emails the owner, exactly as deleting a service does. A set that only adds goes through. Read deps first and send that list plus your additions, or you will ask somebody to approve a withdrawal you did not mean — and a withdrawal is the one change that reports nothing at runtime: the calls are dropped, not refused, so the far end hangs until it times out.
A job may need things, and nothing may need a job: an edge is a rule about a port and a job has none, so naming one here is refused. If a job and a service share data, that is a resource they both need.
Inputs: needs (required), project (required), service (required).
statusDesired versus actualARead-onlyInspect
The only call that reads the cluster, and so the only one that can answer "is it up". Every write on this server is asynchronous — a tool that returns without error recorded a demand, it did not watch it come true — so this is what you check afterwards. Carries every service and resource, its addresses, its size, whether it is in sync, and what the project has cost since midnight UTC. A job has none of the service vocabulary — no ready count, no port, no address — and carries its latest run instead: which revision, what phase, how long it took and the exit code. That is the only way to learn how a run ended. It does not carry a resource's environment: what a resource publishes by name is resource_keys, and the values are resource_secrets.
Inputs: project (required).
transferOffer a project, and its bill, to somebodyAIdempotentInspect
Offers ownership to somebody the project is already shared with. This does not hand it over: it emails them, and the project moves only when they press the button, which may be days later or never. Two humans are involved — the owner is asked to approve the offer in their own inbox first (approval_required), and the recipient accepts in theirs. When it lands, the previous owner stays on as an editor and nothing restarts. Never call this unless the user has asked for the project to change hands.
Inputs: email (required), project (required), name.
untransferTake back an offer of ownershipAIdempotentInspect
Withdraws an offer that has not been accepted, and kills the link in the recipient's inbox. There is no undoing one that has been accepted: the project is theirs, and only they can offer it back.
Inputs: project (required).
whoamiWho this credential isARead-onlyInspect
Which gagarin account this server is acting as, what the credential may do, and the registry and base domain to build addresses from. Run this first in any session: it is the one call that distinguishes "no credential" from "a credential that cannot deploy".
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 35 tools
Each tool targets a distinct resource or action, and the descriptions carefully separate near-neighbors: status vs platform_health, deploy vs run, resource_keys vs resource_secrets, and backups vs backup_resource vs restore_resource. An agent should be able to pick the right tool reliably.
Names follow a predictable read/action convention: plural nouns for listing and inspection (projects, credentials, status, backups, members) and verb_object for mutations (create_project, destroy_service, add_domain, set_deps, rotate_resource). The few one-word verbs like deploy, run, and whoami are conventional and do not break the pattern.
35 tools is a large surface for an agent, beyond the 25+ threshold even though the underlying platform is broad. Many tools are narrow variants of the same lifecycle (destroy_service/resource/project, add_domain/remove_domain, resource_keys/resource_secrets), which adds coherence but also bulk.
The surface covers the full lifecycle for the apparent domain: projects, sharing and ownership, credentials, deploy and jobs, domains, dependencies, managed resources, backups and restore, and billing. Minor gaps exist—no direct resource resize/retype, no project rename, and no explicit restart other than redeploying—but agents can work around them.
Maintenance
Related MCP Connectors
Hosted MCP runtime where your agent publishes its own tools by tool call and keeps working.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Caelara Labs Agent Safety tools over remote MCP. Calls need an X-Caelara-Key API key.
Related MCP Servers
AlicenseAqualityDmaintenanceEnables AI agents to interact with Scout Live platform capabilities through standardized MCP primitives, including tools for app management, deployment, and logging.612 npmMIT- FlicenseNot gradedqualityDmaintenanceEnables LLM-powered agents to securely communicate with and orchestrate downstream microservices via FastAPI endpoints exposed as MCP tools.-
- FlicenseNot gradedqualityDmaintenanceEnables an LLM to dynamically discover and call tools across multiple MCP servers (file, GitHub, SQL, Python execution) with authentication, rate limiting, and observability, supporting parallel execution and secure deployment.-
- FlicenseNot gradedqualityCmaintenanceEnables MCP tool calls with strict schema validation and stdio isolation, while providing a security gateway for tool-level authorization, streaming PII redaction, and model failover routing.-