Skip to content

Connect Codebuff to LyraShield via MCP

A step by step workflow to configure LyraShield MCP in the Codebuff terminal agent using the CLI, verify the connection, run a scan and gate pull requests.

LyraShield MCP integration with Codebuff
On this page

Follow the current codebuff integration guide and manually merge the server entry, preserving existing settings. Authenticate local stdio separately with npx -y lyrashield@0.2.14 login --oauth and use @lyrashield/mcp@0.2.12. Use pinned CLI commands for documented config or skill installs; marketplace plugins remain separately gated. Restart the client, confirm discovery, then call lyrashield_list_workspaces for authenticated read-only access. CLI doctor does not establish client authentication or scan completion.

The vibe coding security guide separates generated code from the controls that enforce what it may do. Wiring LyraShield into Codebuff puts release assurance inside the terminal 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 24 plus, git, LyraShield account Prepare the environment
Configure Current client guide Manually merge the documented server entry
Manual path .agents/mcp.json Fallback if CLI is unavailable
Verify npx -y lyrashield@0.2.14 doctor Check config and credentials
Inline check npx -y lyrashield@0.2.14 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 24 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 -y lyrashield@0.2.14 login to store your credentials in ~/.lyrashield/credentials.json, which is not committed to version control.

Codebuff supports an agent store where published agents can be added to a project and the CLI offers /init and /publish commands. Review any agent store entry before adding it, because a published agent can expose a write action or network call under an innocent name. 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

Follow the current codebuff integration guide and manually merge the server entry, preserving existing settings. Authenticate local stdio separately with npx -y lyrashield@0.2.14 login --oauth and use @lyrashield/mcp@0.2.12. Use pinned CLI commands for documented config or skill installs; marketplace plugins remain separately gated. Restart the client, confirm discovery, then call lyrashield_list_workspaces for authenticated read-only access. CLI doctor does not establish client authentication or scan completion. Manually merge the entry in .agents/mcp.json under mcpServers. Each entry holds command, args and env and local stdio and remote HTTP transports are documented in the official guide. The Model Context Protocol specification defines the transport and tool exposure contract.

Add the entry manually and preserve existing client settings:

{
  "mcpServers": {
    "lyrashield": {
      "command": "npx",
      "args": ["-y", "@lyrashield/mcp@0.2.12"],
      "env": { "LYRASHIELD_API_KEY": "$LYRASHIELD_API_KEY" }
    }
  }
}

Keep the token in the env field as a reference to an environment variable when possible, not as a literal string. Commit .agents/mcp.json so the team shares the same server set, but keep any embedded secrets in environment variables referenced by env.

3. Verify the connection

Restart the client and inspect the server and tools in its own MCP settings. Call lyrashield_list_workspaces and retain the authenticated read-only result. CLI npx -y lyrashield@0.2.14 doctor can inspect local credentials and setup, but does not prove that this client discovered tools or completed authentication. If discovery fails, check the client-specific path, root key, transport and selected workspace before requesting any recorded assessment. A configuration entry is not a scan receipt, and a successful read call is not evidence that the target application has been tested.

Restart your Codebuff 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 command and args spelling, the token and whether the config file is in the project root. Discovery, authentication and assessment are separate checks. Reopen the client settings after changes, repeat a read-only call and preserve unresolved failures. Do not request a paid scan merely to troubleshoot configuration.

4. Run an inline security check

With the connection verified, run npx -y lyrashield@0.2.14 scan from your project root. The scan targets the repository, reviews the code for candidate issues and records evidence in a checksum-bound assurance record. Detected issues stay in a detected state until a fresh applicable retest 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 AGENTS.md

Tell Codebuff to use LyraShield before proposing a fix. Add a line to 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 a fresh applicable retest 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 AGENTS.md in normal code review and branch protection. The Claude Code security workflow covers a related approach if your team uses multiple agents.

Why pair Codebuff with LyraShield

Codebuff accelerates implementation as an open source terminal agent. LyraShield AI provides release assurance through a loop of target, review, evidence, fix, retest and report. The platform keeps detected candidates, retest outcomes and inconclusive results distinct. Each receipt is limited to its stated evidence and scope, and the assurance record preserves what was checked and the 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 Cursor app security checklist covers a related editor if your team uses multiple tools.

Frequently asked

How do I add the LyraShield MCP server to Codebuff

Follow /docs/integrations/codebuff for manual setup. Use pinned CLI commands for documented config or skill installs; marketplace plugins remain separately gated. Use CLI 0.2.14 and MCP 0.2.12 for local stdio, then verify discovery and a read-only client call.

Does Codebuff support remote MCP servers

The current client guide documents local stdio and HTTP entries. Authenticate local stdio separately with CLI 0.2.14; hosted credentials belong to the client, with private API keys restricted to read-only access.

How do I verify the LyraShield connection works

Confirm server and tool discovery inside the client, then call lyrashield_list_workspaces. CLI 0.2.14 doctor checks a separate local surface; it is not client authentication or scan evidence.

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.

Stay in the loop.

We store your email for product updates and scorecard notifications. No sharing, no marketing blasts.