Skip to main content
Glama
ElytraSec

Elytra Security MCP Server

Official
by ElytraSec

elytra_scan

Scan code snippets for security vulnerabilities across 11 languages and IaC. Obtain severity ratings, fix suggestions, and a security score.

Instructions

Scan a code snippet for security vulnerabilities. Supports Solidity, Vyper, JS/TS, Python, Go, Rust, Java, Ruby, PHP, plus IaC (Terraform, Kubernetes, Dockerfile, GitHub Actions). Returns findings with severity, fix suggestions, and a 0-100 score. Use this for security-focused code review.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe source code to scan
languageNoLanguage hint: javascript | typescript | python | go | java | ruby | php | solidity | rustjavascript

Implementation Reference

  • Tool handler: Sends code to the Elytra API /api/playground endpoint and formats the scan result.
    async function runScan(args: { code?: string; language?: string }): Promise<ToolResponse> {
      if (!args.code) return errOut("Missing required field: code");
      const r = await postJSON<ScanResult>("/api/playground", {
        code:     args.code,
        language: args.language ?? "javascript",
      });
      if (!("ok" in r)) return errOut(r.error);
      return { content: [{ type: "text", text: formatScan(r.data, "Scan result") }] };
    }
  • Input schema definition for elytra_scan: requires 'code' (string), optional 'language' (string, default 'javascript').
    {
      name: "elytra_scan",
      description:
        "Scan a code snippet for security vulnerabilities. Supports Solidity, Vyper, JS/TS, Python, Go, Rust, Java, Ruby, PHP, plus IaC (Terraform, Kubernetes, Dockerfile, GitHub Actions). Returns findings with severity, fix suggestions, and a 0-100 score. Use this for security-focused code review.",
      inputSchema: {
        type: "object",
        properties: {
          code:     { type: "string", description: "The source code to scan" },
          language: { type: "string", description: "Language hint: javascript | typescript | python | go | java | ruby | php | solidity | rust", default: "javascript" },
        },
        required: ["code"],
      },
  • src/index.ts:291-304 (registration)
    Registration of all tools in the MCP CallToolRequestSchema handler. elytra_scan is dispatched to runScan.
    server.setRequestHandler(CallToolRequestSchema, async (req) => {
      const { name, arguments: args = {} } = req.params;
      try {
        switch (name) {
          case "elytra_scan":           return await runScan(args as { code?: string; language?: string });
          case "elytra_scan_address":   return await runScanAddress(args as { address?: string; chain?: string });
          case "elytra_replay_hacks":   return await runReplayHacks(args as { code?: string; language?: string });
          case "elytra_agent_identity": return await runAgentIdentity();
          default:                      return errOut(`Unknown tool: ${name}`);
        }
      } catch (e) {
        return errOut(e instanceof Error ? e.message : "Internal MCP server error");
      }
    });
  • src/index.ts:143-189 (registration)
    Tool registration array exposed via ListToolsRequestSchema, containing the elytra_scan definition.
    const TOOLS = [
      {
        name: "elytra_scan",
        description:
          "Scan a code snippet for security vulnerabilities. Supports Solidity, Vyper, JS/TS, Python, Go, Rust, Java, Ruby, PHP, plus IaC (Terraform, Kubernetes, Dockerfile, GitHub Actions). Returns findings with severity, fix suggestions, and a 0-100 score. Use this for security-focused code review.",
        inputSchema: {
          type: "object",
          properties: {
            code:     { type: "string", description: "The source code to scan" },
            language: { type: "string", description: "Language hint: javascript | typescript | python | go | java | ruby | php | solidity | rust", default: "javascript" },
          },
          required: ["code"],
        },
      },
      {
        name: "elytra_scan_address",
        description:
          "Scan a DEPLOYED smart contract by its onchain address. Elytra fetches the verified source from the block explorer (Etherscan / Basescan / etc.) and scans every source file. Use this when the user gives you a 0x... address and asks about its security.",
        inputSchema: {
          type: "object",
          properties: {
            address: { type: "string", description: "Contract address (0x... 40 hex chars)" },
            chain:   { type: "string", description: "ethereum | base | arbitrum | optimism | polygon", default: "ethereum" },
          },
          required: ["address"],
        },
      },
      {
        name: "elytra_replay_hacks",
        description:
          "Run the 12 famous-exploit pattern detectors against submitted source code. Encodes patterns from $3.04B in losses: Bybit ($1.46B), Ronin ($625M), Wormhole ($325M), Euler ($197M), Nomad ($190M), Beanstalk ($182M), Cream ($130M), Multichain ($126M), Mango ($114M), Curve ($73M), Radiant ($53M), zkSync ($5M). Returns only matches against these specific historic attack vectors. Use this when you want to check 'have I made any of the famous mistakes?'",
        inputSchema: {
          type: "object",
          properties: {
            code:     { type: "string", description: "The source code to test against hack-replay patterns" },
            language: { type: "string", description: "Language hint", default: "solidity" },
          },
          required: ["code"],
        },
      },
      {
        name: "elytra_agent_identity",
        description:
          "Return Elytra's onchain agent identity card — ERC-8004 registry data, capabilities, pricing on Base and Solana, attestation count, and discovery endpoints. Use this when the user wants to verify or learn about the Elytra agent itself, integrate it programmatically, or compare it to other agents.",
        inputSchema: { type: "object", properties: {} },
      },
    ];
  • Helper: Generic HTTP POST function used by runScan to call the Elytra API.
    async function postJSON<T>(path: string, body: unknown, opts: { auth?: boolean } = {}): Promise<RestResult<T>> {
      const headers: Record<string, string> = { "Content-Type": "application/json" };
      if (opts.auth && API_KEY) headers.Authorization = `Bearer ${API_KEY}`;
    
      let res: Response;
      try {
        res = await fetch(`${BASE_URL}${path}`, { method: "POST", headers, body: JSON.stringify(body) });
      } catch (e) {
        return { error: `Network error reaching Elytra: ${e instanceof Error ? e.message : "unknown"}`, status: 0 };
      }
    
      let data: unknown;
      try { data = await res.json(); } catch { data = null; }
    
      if (!res.ok) {
        const errMsg = (data as { error?: string })?.error ?? `HTTP ${res.status}`;
        return { error: errMsg, status: res.status };
      }
      return { ok: true, data: data as T };
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It describes the tool as scanning code and returning results, implying read-only behavior, but lacks details on side effects, authorization, or resource limits. The description is adequate but could be richer.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is reasonably concise, front-loading the purpose and listing supported languages and outputs. A few extraneous details could be trimmed, but no significant waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description explains return values (severity, fix suggestions, score). It covers supported languages and intended use. Missing aspects like file size limits or error handling, but overall sufficient for a scanning tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers both parameters with 100% description coverage, but the description adds value by expanding the list of supported languages beyond the schema's enum, including Vyper and IaC. This helps the agent understand additional valid values.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool scans code for security vulnerabilities, lists supported languages, and mentions outputs (findings with severity, fix suggestions, score). It effectively distinguishes from siblings like elytra_agent_identity (identity info) and elytra_scan_address (address scanning).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states 'Use this for security-focused code review,' providing clear context for when to use it. However, it does not mention when not to use or provide alternatives, missing some exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ElytraSec/mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server