Skip to main content
Glama
mastrophot

mcp-contract-security

by mastrophot

mcp-contract-security

MCP server for smart contract security scanning.

Implements the required tools:

  • scan_contract

  • compare_security_models

  • audit_checklist

Supports languages:

  • solidity

  • rust

  • typescript

What it checks

scan_contract currently detects heuristic patterns for:

  • Reentrancy

  • Integer overflow/underflow risk

  • Access control issues

  • Front-running exposure

  • Oracle manipulation risk

The output includes:

  • vulnerability list with severity/type/line

  • security_score

  • near_equivalent_score

  • NEAR-specific security notes and recommendation

Related MCP server: meok-mcp-injection-scan-mcp

Install

npm install -g mcp-contract-security

Published package:

MCP config (Claude Desktop)

{
  "mcpServers": {
    "contract-security": {
      "command": "mcp-contract-security"
    }
  }
}

Tool usage

scan_contract

Input:

{
  "code": "contract source code here",
  "language": "solidity"
}

compare_security_models

Input (optional):

{
  "language": "solidity"
}

audit_checklist

Input (optional):

{
  "language": "rust"
}

Local development

npm install
npm run check

Deliverable assets

Additional publish assets are prepared in deliverables/:

  • deliverables/mcp-registry-submission.md

  • deliverables/security-subreddit-posts.md

  • deliverables/blog-why-near-contracts-safer.md

  • server.json (MCP Registry metadata, schema-validated)

License

MIT

Available Tools

3 tools
audit_checklistB

Return a practical smart contract security checklist with NEAR-specific items.

ParametersJSON Schema
NameRequiredDescriptionDefault
languageNosolidity

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the transparency burden, but 'Return a checklist' clearly indicates a read-only informational behavior with no apparent side effects. However, it does not clarify whether the checklist is static or dynamically generated, or whether it performs any analysis of a provided contract.

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

Conciseness5/5

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

The description is a single, front-loaded sentence with no filler. Every word adds value: 'practical', 'smart contract security checklist', and 'NEAR-specific' all convey meaningful scope.

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

Completeness3/5

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

For a simple static checklist tool with one optional parameter, the description provides the core behavior but misses the language-parameter nuance and does not position the tool relative to its siblings. It is minimally adequate but leaves gaps for a fully informed call.

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

Parameters2/5

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

The input schema has one optional language parameter with an enum and default, but schema description coverage is 0% and the description never mentions language. It does not compensate by explaining how the language value affects the returned checklist, leaving the connection between parameter and behavior implicit.

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 uses a specific verb ('Return') and identifies the resource ('a practical smart contract security checklist with NEAR-specific items'). It is clearly distinct from sibling tools like scan_contract and compare_security_models, which imply analysis/comparison rather than a checklist.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus scan_contract or compare_security_models. The description does not state exclusions, prerequisites, or scenarios where an alternative would be better.

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

compare_security_modelsB

Compare NEAR vs Ethereum security architecture and risk profile.

ParametersJSON Schema
NameRequiredDescriptionDefault
languageNosolidity

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description itself must convey behavioral traits. It accurately conveys a read-only comparison action, but it does not explain what output to expect, how the language parameter affects behavior, or whether this is an educational reference versus an active security analysis.

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

Conciseness5/5

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

The description is a single, focused sentence with no redundancy. It front-loads the core purpose and avoids unnecessary elaboration.

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

Completeness3/5

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

The tool is relatively simple, but the optional language parameter has no clarifying context in the description, and there is no output schema to fill in return-value expectations. The description is adequate for a high-level comparison tool but leaves the parameter's role and output format unexplained.

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

Parameters2/5

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

Schema description coverage is 0%, and the description does not mention the language parameter. The enum values rust/solidity/typescript are self-descriptive as programming languages, but why a language choice matters for comparing NEAR vs Ethereum security models is left unexplained.

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's specific action ('compare') and target ('NEAR vs Ethereum security architecture and risk profile'). It is distinct from sibling tools like scan_contract and audit_checklist, which imply per-contract inspection rather than a high-level architectural comparison.

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

Usage Guidelines2/5

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

No guidance is given for when to use this tool versus scan_contract or audit_checklist. The intended usage is only implied by the description's comparative focus; there are no explicit when/when-not conditions or alternative tool references.

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

scan_contractB

Scan contract code for common vulnerabilities and include NEAR-specific security notes.

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYes
languageYes

TDQS

B3.3/5.0
Behavior2/5

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

Annotations are absent, so the description carries the full burden. 'Scan' implies a read-only analysis, but the description does not disclose whether the code is modified, what output or format is returned, limitations or false positives, or language-specific behavior beyond the mention of NEAR notes.

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

Conciseness5/5

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

A single, front-loaded sentence says exactly what the tool does with no filler, redundancy, or unnecessary detail.

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

Completeness2/5

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

With no annotations and no output schema, the description should explain return values and behavioral constraints to be complete. It only states the high-level purpose and the NEAR-specific notes feature, leaving the agent without guidance on expected output or limitations.

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

Parameters2/5

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

Schema description coverage is 0%, and the description only indirectly clarifies that 'code' is contract source code. It does not explain the significance of the language enum values or what is expected beyond the JSON schema, so it does not compensate for the lack of schema descriptions.

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 uses a specific verb ('Scan'), a clear resource ('contract code'), and a defined objective ('common vulnerabilities'), plus the distinctive 'NEAR-specific security notes'. This clearly differentiates it from siblings like compare_security_models and audit_checklist.

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

Usage Guidelines3/5

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

The intended use is implied: scan contract code for vulnerabilities. However, it does not explicitly state when to choose this over compare_security_models or audit_checklist, nor does it give exclusions or prerequisites.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.1.1
    • First observedaudit_checklist
    • First observedcompare_security_models
    • First observedscan_contract

TDQS

A3.7/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: scanning contracts for vulnerabilities, comparing architectures, and providing checklists. There is no meaningful overlap that would cause an agent to select the wrong tool.

Naming Consistency4/5

Two tools follow a verb_noun pattern (scan_contract, compare_security_models), while audit_checklist is more of a noun phrase. The pattern is mostly predictable and readable, with only a minor deviation.

Tool Count4/5

Three tools is a reasonable scope for a focused contract security server. It is slightly small but each tool serves a distinct, justified function within the domain.

Completeness4/5

The toolset covers scanning, comparative analysis, and actionable guidance, which gives agents a solid workflow. It lacks deeper features like detailed report generation or code fixes, but the core security assessment use case is well covered.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Security scanner for MCP servers. Detects prompt injection, command injection, auth bypass, and excessive permissions across tools, resources, and prompts.
    38
    2
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Scans MCP servers for prompt-injection, tool-poisoning, and SSRF vulnerabilities using 30+ canonical rules across 5 severity tiers, with optional signed safety reports for procurement.
    5
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that statically audits Solidity smart contracts for common vulnerabilities like reentrancy and access control, enabling developers to identify and fix security issues via natural language.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables scanning Solidity smart contracts for 13 vulnerability classes using pattern-based analysis; provides full audit, quick scan, gas analysis, and detector catalog through MCP tools.
    -