Skip to content

MiMo Code MCP security workflow

Set up LyraShield MCP in MiMo Code step by step: CLI setup, manual config, verification, inline scan, GitHub Action diff gate and agent rules.

LyraShield MCP integration with Mimo Code
On this page

Set up LyraShield MCP in MiMo Code by authenticating with the CLI, manually merging the documented mcp entry, verifying the connection, running an inline scan on the changed scope, adding a GitHub Action diff gate that emits SARIF and adding an agent rules snippet. MiMoCode uses the mcp root key with local and remote transports, with manual setup through the current guide. Per the vibe coding security guide, treat scan output as evidence and keep outcomes distinct.

1. Install prerequisites and authenticate

MiMo Code (Xiaomi) runs as a terminal coding agent configured through .mimocode/mimocode.jsonc or ~/.config/mimocode/mimocode.jsonc, with a published JSON Schema for validation. Before wiring LyraShield, install Node so npx is available, then authenticate once with npx -y lyrashield@0.2.14 login --oauth. The CLI writes credentials to ~/.lyrashield/credentials.json with restrictive permissions and commits nothing, so your token stays out of version control. Confirm the MiMo Code repository is the version you expect and that your editor trusts the schema domain for completion.

A clean prerequisite check avoids the most common setup failures. If you run MiMoCode from a release binary rather than the npm package, local MCP servers launched through a shell may need the full path to the executable in the command array rather than a bare name resolved from PATH. Note that distinction now so the verification step does not surprise you. Keep your auth token in the credentials file only and never paste it into a committed config or an issue. To confirm the schema, open .mimocode/mimocode.jsonc and check for completion on the mcp key. If the editor offers mcpServers, the URL is wrong or the file is misplaced. The project level file wins when both exist, so place your entry accordingly.

2. Add the LyraShield MCP server with the CLI

Follow the current mimo-code 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.

3. Configure the MCP server manually when needed

If you must edit by hand, add an entry under the mcp root key in .mimocode/mimocode.jsonc. MiMoCode uses mcp, not mcpServers and the wrong key is silently ignored. Use the remote transport with the LyraShield endpoint and a Bearer token:

{
  "mcp": {
    "lyrashield": {
      "type": "remote",
      "url": "https://app.lyrashieldai.com/api/mcp",
      "headers": {
        "Authorization": "Bearer lsk_REPLACE_WITH_YOUR_TOKEN",
      },
      "enabled": true,
    },
  },
}

Never commit a real token. The CWE-798 hard coded credentials pattern is the exact risk. For local stdio, follow the local server entry in the current integration guide and use the user-only credentials created by CLI OAuth above; do not copy a token into a project config. The published installer does not write either transport form. Hosted API keys provide read-only access; hosted mutations require valid browser-confirmed delegation. Whichever transport you choose, confirm tool discovery inside the client and make an authenticated read-only call, since a silently ignored root key is the most common failure and produces no error. Local stdio runs the MCP adapter process on your machine, but LyraShield tools still call the hosted API and require network access. Neither mode supports air-gapped scans. Remote HTTP avoids managing a local process and receives server updates without a package bump.

4. Verify the connection and run an inline check

After config, restart MiMo Code and run npx -y lyrashield@0.2.14 doctor to confirm the server reports connected. Inside a session, ask the agent to run a LyraShield scan against the current target. The agent targets the release scope, reviews the real config and code and returns evidence with detected, retest confirmed and inconclusive outcomes kept distinct. This mirrors the vibe coding security guide evidence loop. Run the scan on the changed scope, not the whole repo, to keep feedback fast and focused.

If the server shows as loaded but no scan tools appear in the agent session, the usual cause is a root key mismatch (mcpServers instead of mcp) or an enabled: false entry. The doctor command surfaces both. When you read scan results, do not collapse detected and retest outcomes into one bucket: a detected candidate is a signal worth review, a retest confirmed outcome means the follow up scan no longer flags it and an inconclusive means the signal was too weak to resolve. A fourth state is defined in the schema for a future review pass, but no code path produces it today. Keep the output in your release record so a reviewer can trace each finding to its evidence. A concrete example: a detected outcome might report a possible hard coded secret in a config file. Collapsing these categories hides the reasoning reviewers need.

5. Add a GitHub Action diff gate in CI

To block regressions in pull requests, add the LyraShield GitHub Action in diff aware mode. It scans only changed files and emits SARIF output that GitHub code scanning can ingest. See the integrations documentation for the exact action ref and inputs.

name: lyrashield-diff-scan
on:
  pull_request:
    branches: [main]
permissions:
  contents: read
  security-events: write
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - name: LyraShield diff scan
        uses: ecryptoguru/lyrashield-ai@v2
        with:
          fail_on_severity: HIGH

The GitHub code scanning SARIF support docs describe how SARIF feeds alerts into your pull request view. The runner-local Action needs no LyraShield token. A diff aware gate keeps CI fast and focuses review on what actually changed, but it is not a substitute for a full recorded scan; run the complete check before a release and retain the full scan record. If the Action flags a dependency advisory, verify it against the resolved version before blocking a merge.

6. Add an agent rules snippet

Tell the agent how to use LyraShield so it does not improvise. Add a short rule to your MiMo Code agent configuration or project rules file:

Before proposing release, run a LyraShield scan on the changed scope.
Treat scan output as evidence, not proof.
Propose fixes only; do not auto apply. Retest after any fix.
Keep detected candidates, deterministic retest validations and inconclusive results distinct. Do not describe a LyraShield scan result as `VERIFIED`; current scans do not produce that reserved state.

A short rule prevents the agent from treating a clean scan as a release verdict or from applying a patch without review. Pair the rule with a repository convention that scan receipts land in your release record, so the evidence loop has a durable home. If your team uses a rules file that other tools also read, keep the LyraShield lines specific so a generic instruction does not dilute them. A good rule is explicit about what the agent must not do: it must not apply a fix without human approval bound to that exact patch, nor report a release as clean on a detected signal. The snippet encodes those limits in four lines, short enough to keep.

Step Command or file Purpose
Authenticate npx -y lyrashield@0.2.14 login --oauth Write credentials to ~/.lyrashield
Add server Current client guide Manually merge the documented server entry
Verify npx -y lyrashield@0.2.14 doctor Confirm the server connects
Diff gate GitHub Action workflow Block regressions in pull requests

Why pair MiMo Code with LyraShield

MiMoCode gives you a fast coding loop with a flexible MCP model and that flexibility is where release risk hides: a silently ignored mcpServers key, a committed token or an over broad tool grant. LyraShield pairs with that loop by targeting the release, reviewing the real config, collecting independent evidence, proposing fixes that require review, retesting and reporting. It does not auto fix. Approval gated fix proposals stay proposals until a server generated patch is bound to an exact approval.

LyraShield is live with open registration. Create an account to run a scan and use the AI app security checklist to structure your pre launch review. For a parallel setup, see the Claude Code security workflow.

Frequently asked

How do I add LyraShield MCP to MiMo Code?

Follow /docs/integrations/mimo-code 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.

What is the manual MCP config for MiMo Code?

Add an entry under the mcp root key in .mimocode/mimocode.jsonc. Use type remote with the url https://app.lyrashieldai.com/api/mcp and a headers block with an Authorization Bearer token.

Why does the MCP root key matter in MiMo Code?

MiMoCode uses mcp as the root key, not mcpServers. The wrong key is silently ignored, so your server never loads and the agent has no scan tools.

Can I gate scans to changed files in CI?

Yes. The LyraShield GitHub Action supports a diff aware mode that scans only changed files and emits SARIF output for code scanning alerts. See the integrations documentation for the exact ref.

  • Oh My Pi MCP security workflow

    Set up LyraShield MCP in Oh My Pi step by step: CLI setup, manual config, verification, inline scan, GitHub Action diff gate and agent rules.

  • Roo Code MCP security workflow

    Set up LyraShield MCP in Roo Code step by step: CLI install, manual config, verification, inline scan, GitHub Action diff gate and agent rules.

  • Amp App Security Checklist

    Practical checklist for Amp: scope orbs, MCP servers, skills and CI gates before shipping AI-built code to production.

Stay in the loop.

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