Connect Antigravity to LyraShield via MCP
A step by step workflow to configure LyraShield MCP in Google Antigravity using the CLI, verify the connection, run a scan, and gate pull requests.

On this page
To connect Antigravity to LyraShield, run npx lyrashield install antigravity so the CLI writes the MCP server entry to your config, then run npx lyrashield doctor to verify the connection and credentials. Antigravity is the Google successor to Gemini CLI and reuses the same ~/.gemini/ path, so the server entry lands where existing config already lives. This workflow covers the install, manual fallback, verification, an inline check, a CI gate, and a rules snippet.
The vibe coding security guide separates generated code from the controls that enforce what it may do. Wiring LyraShield into Antigravity puts release assurance inside the agent session, so a scan runs before a change reaches a pull request rather than only after. The steps below assume you have Node installed and an active LyraShield account.
| Step | Command or file | Purpose |
|---|---|---|
| Prerequisites | Node 20 plus, git, LyraShield account | Prepare the environment |
| Install | npx lyrashield install antigravity | Write the MCP server entry |
| Manual path | ~/.gemini/config/mcp_config.json | Fallback if CLI is unavailable |
| Verify | npx lyrashield doctor | Check config and credentials |
| Inline check | npx lyrashield scan | Run a scan from the session |
| CI gate | .github/workflows/lyrashield.yml | Diff aware gate on pull requests |
1. Meet the prerequisites
Install Node 20 or later, which the Node.js release guide covers. Confirm git is configured for your repository. Create a LyraShield account at lyrashieldai.com if you do not have one, because the MCP server needs credentials to authenticate. Run npx lyrashield login to store your credentials in ~/.lyrashield/credentials.json, which is not committed to version control.
If you are migrating from Gemini CLI, Antigravity reuses the same ~/.gemini/ path, so your existing MCP config carries forward. The install step below adds the LyraShield entry to that shared location. Keep your credentials file outside the working tree, and never paste a token directly into a config file the agent can read.
2. Add the LyraShield MCP server
Run npx lyrashield install antigravity. The CLI auto-detects your setup and writes the server entry to ~/.gemini/config/mcp_config.json for a shared scope or .agents/mcp_config.json for a project scope, both under a root mcpServers key. A remote server uses a serverUrl field, and the url field is rejected. Skills live in ~/.gemini/skills and rules live in GEMINI.md or AGENTS.md. The Model Context Protocol specification defines the transport and tool exposure contract.
If the CLI is unavailable, add the entry manually. This is the manual path, and it is exactly what the CLI writes. For a remote server, set serverUrl to the LyraShield endpoint and include your Bearer token in the headers:
{
"mcpServers": {
"lyrashield": {
"serverUrl": "https://app.lyrashieldai.com/api/mcp",
"headers": { "Authorization": "Bearer lsk_YOUR_TOKEN" }
}
}
}
For a local stdio server, use the package directly:
{
"mcpServers": {
"lyrashield": {
"command": "npx",
"args": ["-y", "@lyrashield/mcp", "stdio"]
}
}
}
3. Verify the connection
Run npx lyrashield doctor. It checks that the config file is valid, the server entry is present, and your credentials resolve. If any check fails, the doctor reports the gap and the fix, so you can correct it before running a scan. A green doctor result means Antigravity can reach the LyraShield server and authenticate.
Restart your Antigravity session after editing the config file so the agent loads the new server entry. Confirm the LyraShield tools appear in the session. If the tools are missing, check the serverUrl spelling, the Bearer token, and whether the config file is in the scope Antigravity reads. The doctor does not run a scan; it only confirms the wiring. If a check fails, the doctor names the file, the field, and the expected value, so you can fix the gap without reading the full config. Run the doctor again after each fix until every check is green, because a partial fix can leave the server reachable but unable to authenticate.
4. Run an inline security check
With the connection verified, run npx lyrashield scan from your project root. The scan targets the repository, reviews the code for candidate issues, and records evidence in an immutable assurance record. Detected issues stay in a detected state until independent verification confirms the behavior, so a finding is a prompt to investigate, not a verdict. Read each finding in the session, note the file and line, and decide whether the candidate reflects a real weakness or a false positive that deserves a recorded dismissal. The assurance record holds both the confirmed issues and the dismissed ones, so a reviewer can see the full set of decisions, not just the open items.
Review the scan output in the session. If a candidate issue is real, a fix proposal is generated for review. Approval gated fix proposals require a human review before a patch reaches a pull request, so a fix is never automatic. As of August 2026, LyraShield v1 covers agentic pentest, software composition analysis, secrets scanning, a GitHub Action, and SARIF output. Run the free AI app security checklist to see the full release review.
5. Gate pull requests with the GitHub Action
Add the LyraShield GitHub Action to your CI so every pull request is scanned. The action runs a diff aware gate, which means only changed code is scanned on each pull request, keeping the check fast enough to run on every push. Output is SARIF, which GitHub renders in the security tab. The GitHub Actions documentation covers workflow syntax and the GitHub SARIF integration explains how findings appear. Store the LyraShield token as a repository secret rather than a variable, so it stays encrypted and masked in logs. Set the diff aware flag to true so the action scans only the lines a pull request changes, which keeps the gate fast on large repositories and avoids re-scanning untouched code on every run.
Add a workflow file named lyrashield.yml under the .github/workflows directory:
name: LyraShield
on:
pull_request:
branches: [main]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: ecryptoguru/lyrashield-ai@v2
with:
fail_on_severity: HIGH
6. Add a rules snippet to GEMINI.md
Tell Antigravity to use LyraShield before proposing a fix. Add a line to GEMINI.md or AGENTS.md in your project root:
Run the LyraShield scan tool before proposing a fix. Do not apply a patch until a human reviews the fix proposal. Keep detected issues in a detected state until independent verification confirms the behavior.
A rules file states intent. The approval gate enforces it. A prompt can be changed in a pull request or ignored under pressure, but a server side gate that blocks a patch until a human binds it to an approval cannot be talked past. That is the difference between stating a policy and holding one. Require a security owner for changes to agent configuration, and include GEMINI.md and AGENTS.md in normal code review and branch protection. The Codex security workflow covers a related approach if your team uses multiple agents.
Why pair Antigravity with LyraShield
Antigravity accelerates implementation inside the agent session. LyraShield AI provides release assurance through a loop of target, review, evidence, fix, retest, and report. The platform separates detection from proof: it flags candidate issues and keeps them in a detected state until independent verification confirms the behavior. An immutable assurance record captures what was checked, when, and with what result. Approval gated fix proposals require review before a patch reaches a pull request, so a fix is never automatic.
As of August 2026, LyraShield v1 covers agentic pentest, software composition analysis, secrets scanning, a GitHub Action with a diff aware gate, and SARIF output. Approval gated fix proposals are approval-gated fix proposals, not unattended fixes. The GitHub Action runs a diff aware gate so only changed code is scanned on each pull request. Create an account to start, or run the free AI app security checklist first. The Gemini CLI security checklist covers the predecessor tool if your team is mid migration.
Frequently asked
How do I add the LyraShield MCP server to Antigravity
Run npx lyrashield install antigravity and the CLI writes the server entry to ~/.gemini/config/mcp_config.json or .agents/mcp_config.json. A remote server uses the serverUrl field, not url.
Does Antigravity support remote MCP servers
Yes. Antigravity accepts remote servers with a serverUrl field. The url field is rejected, so if you paste a manual config, use serverUrl for the remote endpoint.
How do I verify the LyraShield connection works
Run npx lyrashield doctor after install. It checks that the config file is valid, the server entry is present, and your credentials resolve, then reports any gaps to fix before you run a scan.
Can I gate pull requests with LyraShield in CI
Yes. Add the LyraShield GitHub Action to your workflow with the diff aware gate so only changed code is scanned on each pull request. Output is SARIF, which GitHub renders in the security tab.
Related posts
- Aider App Security Checklist for AI Pair Programming
A security checklist for reviewing apps built with Aider covering MCP server config, secrets, dependencies, and verifiable evidence with LyraShield AI.
- Using LyraShield AI Alongside Aider for Secure AI Coding
How to run LyraShield security checks alongside Aider today using the CLI and GitHub Action diff gate. Native MCP is a roadmap item Aider has not yet shipped.
- Aikido vs LyraShield for AI Built App Security
Aikido unifies SAST SCA secrets and cloud scanning from code to runtime; LyraShield wraps AI app testing in a release assurance loop with approval gated fixes.