MCP Server for AI Agents

The GitOps MCP server lets an AI agent such as Claude Code read the state of your services and act on it from the conversation. Ask “is billing-api healthy?” or “which critical CVEs affect this service?” and the agent answers with live data from GitOps, without you opening the dashboard.

It uses the Model Context Protocol (MCP), the open standard AI clients use to connect to external tools.

What you can do with it

  • Check a service before you touch it. Ask for the last Code Report of a service: risk score, vulnerabilities by severity, failed security policy rules and the commit that was scanned.
  • Fix vulnerabilities from your editor. List a service’s CVEs with the installed and fixed versions, then let the agent update the dependency in the repository you have open.
  • Know whether production is fine. Get an up/degraded/down summary for a project or service, with uptime and open incidents.
  • Add monitoring as part of a change. When you ship a new endpoint, ask the agent to create an uptime monitor for it.
  • Follow the CVEs of your stack. Read the CVE feed of the technologies your organization follows, filtered by severity, KEV (known exploited) or “affects me”.

Example prompts:

How is the code report of acme/billing/billing-api?
Which critical CVEs does acme/billing/billing-api have, and which ones have a fix?
Update the vulnerable dependencies of this service to their fixed versions.
Is everything OK in the monitoring of acme/billing?
Create a monitor for https://api.acme.com/health in acme/billing every 5 minutes.
Which known exploited CVEs affect the acme organization?

How it works

Claude Code ──MCP (HTTPS + Bearer key)──▶ GitOps MCP server ──REST + same key──▶ GitOps API
                                           (stateless)                          (permissions, audit)

The MCP server has no database and no credentials of its own. It forwards your key to the GitOps API on every call, so the agent can only do what you can do in the dashboard. Permissions, audit and rate limits are applied by GitOps itself.

Requirements

  • A GitOps account with access to the projects you want to query.
  • An MCP client that supports remote servers over Streamable HTTP with a custom header. This guide uses Claude Code, in the terminal or in VS Code.

Claude.ai web and desktop connectors are not supported yet: they require OAuth sign-in, which is planned.

1. Create an MCP key

  1. In GitOps, open your Profile and go to API Keys.
  2. Create a key and check For MCP / AI agents.
  3. Copy the key (gvs_…). It is shown only once.

An MCP key is personal: it acts with your permissions in every organization and project you belong to, except Vault. Give it an expiry date and a name that identifies where you use it, for example laptop-claude-code.

2. Add the server to Claude Code

For yourself, in every project

claude mcp add --transport http --scope user gitops 
	https://mcp.cloud.getgitops.com/mcp 
	--header "Authorization: Bearer gvs_…"

Without --scope user, the server is only added for the current directory.

For a team, in a repository

Add a .mcp.json file to the root of the repository. Reference the key through an environment variable so the file can be committed:

{
	"mcpServers": {
		"gitops": {
			"type": "http",
			"url": "https://mcp.cloud.getgitops.com/mcp",
			"headers": { "Authorization": "Bearer ${GITOPS_MCP_KEY}" }
		}
	}
}

Each developer exports their own key, for example in ~/.zshrc:

export GITOPS_MCP_KEY=gvs_…

Claude Code asks for approval the first time it finds a project server.

VS Code

The Claude Code extension for VS Code uses the same configuration as the terminal. A server added with claude mcp add or a .mcp.json file in the workspace is available in the extension without extra steps.

3. Check the connection

claude mcp list

gitops should be listed as connected. Inside a Claude Code session, run /mcp to see the server status and its tools.

Available tools

Resources are identified by slug (organization/project/service) or by id. Use list_projects to discover the slugs.

Code Report and CVEs (read-only)

ToolWhat it returns
list_projectsProjects you can see, optionally filtered by organization.
list_servicesServices of a project with their risk score, vulnerabilities by severity and policy status.
get_code_reportLast analysis of a service: risk score, severities, failed policy rules, commit, branch and linked monitors.
list_service_cvesVulnerabilities of a service with package, installed version, fixed version and KEV flag. Filters: severity, fixable.
list_technology_cvesCVE feed of the technologies your organization follows. Filters: technology, minimum severity, kev, affects_me.
get_cveDetails of a CVE: CVSS, EPSS, KEV, fixed versions and affected services.
get_cve_watchlistTechnologies your organization follows.

The risk score is a risk: higher is worse.

Monitoring

ToolWhat it does
get_monitoring_status“Is everything OK?” for a project or a service: up, degraded and down monitors and open incidents.
list_monitorsMonitors of a project, optionally of one service.
get_monitorConfiguration, uptime for 24 h, 7 d and 30 d, open incident and recent incidents.
create_monitorCreates an HTTP monitor: URL, method, interval, timeout, expected status and linked service.
test_monitorRuns one check now and returns status, HTTP code and latency.

Read-only tools run without asking. create_monitor and test_monitor change or call something outside the conversation, so Claude Code asks for confirmation before running them. To let read-only tools run without prompts, allow them in .claude/settings.json:

{
	"permissions": {
		"allow": ["mcp__gitops__get_code_report", "mcp__gitops__list_service_cves"]
	}
}

Security

  • Your permissions, nothing more. The agent uses your role in each organization and project. If you cannot see a project in the dashboard, the agent cannot either.
  • No Vault. MCP keys can never read or write Vault secrets, whatever your role allows. There are no Vault tools, and the GitOps API also rejects any Vault request made with an MCP key.
  • No secrets in the conversation. Monitors created through MCP cannot have custom headers or a request body, because those usually hold tokens. Responses never include header values; set headers from the dashboard.
  • Audited. Every change made through MCP appears in the audit log with the actor mcp:<key name>.
  • Rate limited. Each MCP key can make up to 120 requests per minute.
  • Revocable. Revoke the key in your profile and the agent loses access immediately.

Self-hosting

The MCP server is open source: getgitops/gitops-mcp. If you run GitOps yourself, run the server next to it and point it at your instance:

docker build -t gitops-mcp https://github.com/getgitops/gitops-mcp.git#main
docker run -p 3000:3000 
	-e GITOPS_API_URL=https://gitops.example.com 
	gitops-mcp

The image exposes GET /healthz for health checks.

VariableDescription
GITOPS_API_URLBase URL of your GitOps instance. Use a private network address when both run in the same network.
PORTPort of the MCP server. Defaults to 3000.
GITOPS_API_TIMEOUT_MSTimeout of each API call. Defaults to 10000.

Then use https://<your-mcp-host>/mcp as the server URL, and create the key in your own GitOps instance.

Troubleshooting

Tool errors are returned to the agent as readable messages, so it can usually explain or fix the problem itself.

ProblemCause
The server is not connectedCheck that the URL ends in /mcp and the header is Authorization: Bearer <key>. Run claude mcp list.
Invalid or revoked keyThe key is wrong, expired or revoked, or it was created in another GitOps instance. Create a new MCP key.
Project or service not foundThe slug is wrong or you have no access to it. The error lists the projects you can see.
Permission deniedYour role cannot perform that action, for example creating monitors as a Viewer.
Monitoring is not enabledEnable the Monitoring module in the project settings.
Invalid monitor fieldsThe error names each field to fix, for example an interval outside 30–3600 seconds.
Rate limit reachedWait the number of seconds shown and try again.