Configuring coding agents with MCP and skills
Give a coding agent the tools it needs through an MCP server, limited to the tools the task calls for, and the know-how it needs through a skill that loads only when relevant, then run it against your own Google Cloud project, with Claude Code on Agent Platform or with Antigravity.
Chapter 3Coding agentsLesson 1 of 4ShowHide
Chapter 3 of 7 in Google Cloud Professional Agentic Architect
- Configuring coding agents with MCP and skillsYou're here
Prerequisites: The Google Cloud agent platform map
Context and tools decide what a coding agent can do
A coding agent is an agent whose job is software work: it reads your code, runs commands, edits files and calls tools, in a loop, until the task is done.
That loop is what separates it from a chat assistant. A chat assistant answers in text: it suggests code, and you copy it, run it and report back what broke. A coding agent does those steps itself:
- Read the code, tests and docs the task touches.
- Plan the change.
- Change the files.
- Verify: run the tests, the linter or the build, read the result and go round again until the check passes.
Verification makes the biggest difference, because it is how the agent finds its own mistakes, and the step a chat assistant leaves to you.
What does a coding agent do that a chat assistant does not?
Two things decide how useful and how safe a coding agent is.
- Context. Without your team's conventions and procedures, the agent guesses. With them, it does the work your way.
- Tools. Without the right tools, it cannot reach your systems. With too many, it can do things the task never needed, some of them damaging.
Coding agents such as (Google's
agentic development environment) and Claude Code (Anthropic's) handle both the
same way. An
gives the agent tools.
A gives it know-how. A project instructions
file (AGENTS.md or GEMINI.md in Antigravity, CLAUDE.md in Claude Code)
holds the few facts it needs on every task.
| You want the agent to | Use | Example |
|---|---|---|
| Call a live system | An MCP server | Look up a BigQuery table's schema |
| Follow a procedure for one kind of task | A skill | Review a query's cost with the team's checklist |
| Always know a short fact about the project | The instructions file | "Tests run with npm test" |
Antigravity has three main surfaces besides its editor integrations, and the choice depends on who drives the agent and where:
| Surface | What it is | Choose it when |
|---|---|---|
| Antigravity App | The desktop application, where you hand tasks to agents and review their work | A developer works interactively on a project |
Antigravity CLI (agy) | A terminal client that opens an interactive session in the current folder | You work in a terminal, or want the agent beside your other command-line tools |
| Antigravity SDK | A Python SDK (pip install google-antigravity) for building your own agents on Antigravity and Gemini | You are building a product or automation around the agent, not using it yourself |
Antigravity also offers a standalone Antigravity IDE and editor extensions (for VS Code, JetBrains and others) for developers who want to stay in an editor.
When do you choose the Antigravity App, the CLI or the SDK?
Which mechanism fits: calling a live system, following a procedure for one kind of task, or a short fact the agent needs on every task?
Add an MCP server, with only the tools the task needs
The Model Context Protocol () is an open standard
for offering tools to agents. An MCP server publishes tools, each with a name,
a description and typed parameters; the coding agent is the client that lists
and calls them. Google Cloud runs remote
for its own services. The
one for BigQuery is at https://bigquery.googleapis.com/mcp, and its tools
include list_dataset_ids, get_table_info, execute_sql_readonly and
execute_sql, the one tool that can change data.
Say the team wants the agent to look up schemas while it writes queries. In
Antigravity, a workspace's MCP servers go in .agents/mcp_config.json, which
you can commit so the whole team gets them:
{
"mcpServers": {
"bigquery": {
"serverUrl": "https://bigquery.googleapis.com/mcp",
"authProviderType": "google_credentials",
"enabledTools": ["list_dataset_ids", "get_table_info", "execute_sql_readonly"]
}
}
}serverUrlpoints at a server over the web (Streamable HTTP, MCP's standard way to reach a remote server).authProviderType: "google_credentials"attaches your Application Default Credentials (ADC: the Google sign-in thatgcloud auth application-default loginsaves on your machine, so tools can act as you).enabledToolsis an allowlist: every other tool on the server, includingexecute_sql, is hidden from the agent.
In Claude Code, a project's MCP servers go in .mcp.json at the project root,
which you commit to share them, and Claude Code asks each developer to approve
them before first use. Google's MCP servers accept a bearer token, so a
headersHelper command can fetch one from each developer's own gcloud sign-in
every time Claude Code connects:
{
"mcpServers": {
"bigquery": {
"type": "http",
"url": "https://bigquery.googleapis.com/mcp",
"headersHelper": "gcp-mcp-headers"
}
}
}Here gcp-mcp-headers is a short script you write and put on each developer's
PATH. It prints the request headers as JSON, with a token from the same
Application Default Credentials Antigravity uses:
#!/usr/bin/env bash
# gcp-mcp-headers: request headers for Google Cloud MCP servers
set -euo pipefail
token="$(gcloud auth application-default print-access-token)"
project="$(gcloud config get-value project 2>/dev/null)"
printf '{"Authorization": "Bearer %s", "x-goog-user-project": "%s"}\n' "$token" "$project"To check the setup, run claude mcp list, which should show bigquery as
connected (approve it first by starting claude in the project), then ask the
agent for something read-only, such as listing the datasets in your project.
Claude Code has no allowlist field in this
file, so to keep a tool away from the agent, add a deny rule such as
mcp__bigquery__execute_sql to the permissions in Claude Code's settings; a
denied tool is removed from the agent's context.
The caller also needs permission on the Google Cloud side, through Identity and
Access Management (IAM), Google Cloud's system of roles and permissions: the MCP
Tool User role (roles/mcp.toolUser) to call a Google Cloud MCP server's tools,
plus the product's own roles, such as BigQuery Data Viewer and BigQuery Job
User. With only those two BigQuery roles, even execute_sql cannot change data.
Roles add up, though: a developer who also holds Editor or BigQuery Data Editor
can still change data through it.
Hiding a tool in the agent is a convenience; IAM is what the server enforces.
Expose the fewest tools the task needs. Every tool is a way in for an attacker: the agent can call it by mistake, or because text it read in a file or web page told it to. Every tool is also one more option the model has to weigh before it picks the right one.
Write a skill that loads only when relevant
A skill is a folder with a SKILL.md file. Its frontmatter (a short YAML
header between --- lines, as in the example below) holds a name and a
description; its body holds the instructions. Antigravity reads
workspace skills from .agents/skills/, and Claude Code from .claude/skills/;
both follow the same SKILL.md format.
bigquery-cost-review/
├── SKILL.md # name, description, then the checklist
├── pricing-rules.md # long reference, read only when the checklist says so
└── scripts/
└── dry_run.sh # runs a dry run and prints the bytes the query would scan---
name: bigquery-cost-review
description: Reviews a BigQuery query's cost before it ships. Use when the user asks for a cost review, or when a query reads a large table.
---
1. Run scripts/dry_run.sh on the query and report the bytes it would scan.
2. Check that the query reads only the columns and dates it needs.
3. If the scan is over 1 TB, apply the limits in pricing-rules.md.
...The agent loads a skill in steps, which is called :
- Every turn: the name and description of every skill (unless it is set to manual-only) are in the agent's , the text the model sees on each turn, so the agent knows what it could use.
- When a task matches the description, or someone types
/bigquery-cost-review, the agent reads the fullSKILL.md. - Only if the body points to them, it reads the other files, such as
pricing-rules.md. Scripts are meant to be run rather than read, so normally only their output enters the context.
Follow one cost review through the skill below. Before you step it, predict what of the skill's script enters the agent's context.
So a team can keep dozens of skills at little cost (the listing has a budget, so keep descriptions short), as long as each description says plainly what the skill does and when to use it. A vague description is the usual reason a good skill never gets used.
Run the agent against your Google Cloud project
Enterprises want coding-agent traffic to run under their own cloud account, terms, billing and controls. Both agents in this lesson can do that.
Claude Code through Agent Platform. Claude models are offered in Agent Platform's Model Garden, so Claude Code can call them in your project instead of Anthropic's API:
- Enable the Agent Platform API:
gcloud services enable aiplatform.googleapis.com. - Request access to the Claude models you want in Model Garden.
- Give developers the
roles/aiplatform.userrole, which allows model calls. A dedicated project keeps cost tracking and access simple. - Point Claude Code at the project, with the login wizard (choose Google Vertex AI; Vertex AI is Agent Platform's former name, which Claude Code's settings still use) or with environment variables:
export CLAUDE_CODE_USE_VERTEX=1
export CLOUD_ML_REGION=global
export ANTHROPIC_VERTEX_PROJECT_ID=my-projectCLOUD_ML_REGION is the region that serves the model; global lets Google
choose, though some models need a regional endpoint, so check Model Garden.
Claude Code authenticates with standard Google credentials, such as Application Default Credentials. For a team rollout, pin specific model versions in Claude Code's settings, so everyone moves to a new model when you choose.
Antigravity with a business account. Developers sign in with a business account and choose Continue with Google Cloud, then pick the Google Cloud project linked to the company's licence. Sessions then run under the Google Cloud Terms of Service, and model interactions are logged to that project. On the enterprise tier Antigravity offers Gemini models and, if an administrator opts in, Claude models.
Recap
- An MCP server gives a coding agent tools; a skill gives it know-how; the project instructions file holds the few facts needed on every task.
- Expose only the tools the task needs:
enabledToolsin Antigravity, a deny rule in Claude Code, and IAM roles on the Google Cloud side, which is what the server enforces. - A skill loads in steps: its name and description on every turn,
SKILL.mdwhen a task matches, other files only when the body points to them. A clear description is what gets it used. - Claude Code runs through Agent Platform once the API, model access, the
roles/aiplatform.userrole and its Vertex settings are in place; Antigravity runs under your Google Cloud terms with a business-account sign-in.
Sources
Show 11 sourcesHide sources
| Source | Publisher | What it supports |
|---|---|---|
| MCP | Antigravity documentation | workspace .agents/mcp_config.json and global ~/.gemini/config/mcp_config.json; serverUrl for Streamable HTTP; authProviderType google_credentials attaches ADC; enabledTools allowlist hides all other tools; disabledTools; unconfigured MCP tools run in Ask mode |
| Get started (opens in a new tab) | Antigravity documentation | surfaces: the Antigravity App, a desktop application; the Antigravity CLI, agy, a terminal client; the SDK; the Antigravity IDE and editor extensions |
| SDK overview (opens in a new tab) | Antigravity documentation | a Python SDK for building autonomous agents powered by Antigravity and Gemini; pip install google-antigravity |
| Skills (opens in a new tab) | Antigravity documentation | a skill is a folder with SKILL.md; description is what the agent sees when deciding whether to apply it; on every turn the agent sees names and descriptions and reads the full SKILL.md when relevant; workspace .agents/skills/ |
| Enterprise (opens in a new tab) | Antigravity documentation | business account and Continue with Google Cloud; telemetry and model interactions logged to the licence's Google Cloud project; Google Cloud Terms of Service; VPC Service Controls; Claude Sonnet 5.5 and Opus 5.5 with administrator opt-in |
| Connect Claude Code to tools via MCP | Claude Code documentation | project scope in .mcp.json with an approval prompt; headersHelper runs a command at each connection and uses its JSON output as request headers, and an Authorization header from it replaces OAuth for that server |
| Configure permissions (opens in a new tab) | Claude Code documentation | mcp__server__tool rules; a denied tool is removed from Claude's context |
| Extend Claude with skills (opens in a new tab) | Claude Code documentation | SKILL.md with name and description; descriptions in context, full content loads when invoked; supporting files loaded when needed, scripts executed, not loaded; .claude/skills/; Agent Skills open standard |
| Claude Code on Google Cloud's Agent Platform (opens in a new tab) | Claude Code documentation | enable aiplatform.googleapis.com; request Claude model access in Model Garden; roles/aiplatform.user; CLAUDE_CODE_USE_VERTEX, CLOUD_ML_REGION, ANTHROPIC_VERTEX_PROJECT_ID; pin model versions |
| Configure MCP in an AI application (opens in a new tab) | Google Cloud | roles/mcp.toolUser; authentication with ADC, an OAuth client or an OAuth 2.0 bearer token; examples use gcloud auth application-default print-access-token with an x-goog-user-project header |
| Use the BigQuery MCP server (opens in a new tab) | Google Cloud | endpoint bigquery.googleapis.com/mcp; tools; execute_sql is the only tool that is not read-only; BigQuery roles |
Suggested videos
Show 2 videosHide videos
Power up your LLMs: Gemini CLI and Model Context Protocol (MCP) (opens YouTube in a new tab)
Shows how to wire an MCP server into a coding agent's config, the lesson's first skill.
Note: Specific to Gemini CLI, and its config file names may differ from the lesson's.
Agent Skills for Firebase (using Gemini CLI) (opens YouTube in a new tab)
Explains Agent Skills as on-demand context and how to write one, matching the lesson's 'always loaded vs loaded when relevant' idea.
Note: Firebase-flavoured examples; its folder layout may differ from the lesson's .agents/skills/.
Review
What does an MCP server give a coding agent, and what does a skill give it?
Check yourself
Developers want their coding agent to look up table schemas in the team's BigQuery datasets while it writes queries. Which mechanism gives the agent that ability?
Go deeper
Hands-on lab: Authoring Google Antigravity Skills →
Write several Agent Skills and see them load on demand. About 17 min. Codelab, runs in your own Google Cloud project with billing on.
LinkHands-on lab: Google Workspace MCP servers in Google Antigravity →
Configure MCP servers in Antigravity IDE or CLI and use them from the agent. About 34 min. Codelab, runs in your own Google Cloud project with billing on.