mcp-klever-vm

MCP server for Klever blockchain smart contract development.

我該用這個嗎

品質與安全性

A
說明品質
100%
結構描述完整度
93%
命名品質
98%
汙染風險
100%
權限相符程度
100%
協定合規性
100%

根據工具定義與協定合規性的自動化分析。

上下文成本

~3,297Token(工具定義)
~1.3 KB典型回應大小
顯著的注意力影響(128k 上下文的 2.58%)

這是每次將伺服器的工具載入模型上下文時所消耗的約略 token 數量。數量越高,可用於其他工作的注意力就越少。

安裝

一鍵安裝

將以下內容加入你的 `claude_desktop_config.json` 檔案:

{
  "mcpServers": {
    "mcp-klever-vm": {
      "command": "npx",
      "args": [
        "@klever/mcp-server"
      ]
    }
  }
}

可執行的套件

npm@klever/mcp-server1.3.0stdio

遠端端點

https://mcp.klever.org/mcpstreamable-http

它能做什麼

工具清單

工具(16)

🟢 唯讀🟡 寫入🔴 刪除⚪ 未知
🟢query_context(query, types, tags, contractType, limit, ...)

Search the Klever VM knowledge base for smart contract development context. Returns structured JSON with matching entries, scores, and pagination. Use this for precise filtering by type or tags; use search_documentation for human-readable "how do I..." answers.

輸入結構描述

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Free-text search query. Use Klever-specific terms for best results (e.g. \"storage mapper SingleValueMapper\", \"payable endpoint KLV\", \"deploy contract testnet\")."
    },
    "types": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "code_example",
          "best_practice",
          "security_tip",
          "optimization",
          "documentation",
          "error_pattern",
          "deployment_tool",
          "runtime_behavior"
        ]
      },
      "description": "Filter results by context type. Omit to search all types. Common combinations: [\"code_example\", \"documentation\"] for learning, [\"error_pattern\"] for debugging, [\"security_tip\", \"best_practice\"] for reviews."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Filter by tags (e.g. [\"storage\", \"mapper\"], [\"tokens\", \"KLV\"], [\"events\"]). Tags are matched with OR logic — any matching tag includes the entry."
    },
    "contractType": {
      "type": "string",
      "description": "Filter by contract type (e.g. \"token\", \"nft\", \"defi\", \"dao\"). Only returns entries tagged for this contract category."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 10,
      "description": "Maximum number of results to return (1-100). Default: 10."
    },
    "offset": {
      "type": "integer",
      "minimum": 0,
      "default": 0,
      "description": "Number of results to skip for pagination. Use with limit to page through results. Default: 0."
    }
  }
}
🟢get_context(id)

Retrieve a single knowledge base entry by its unique ID. Returns the full entry including content, metadata, tags, and related context IDs. Use this after query_context or find_similar to get complete details for a specific entry.

輸入結構描述

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique context ID (UUID format). Obtain IDs from query_context or find_similar results."
    }
  },
  "required": [
    "id"
  ]
}
🟢find_similar(id, limit)

Find knowledge base entries similar to a given entry by comparing tags and content. Returns related contexts ranked by similarity score. Useful for discovering related patterns, examples, or documentation after finding one relevant entry.

輸入結構描述

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The context ID to find similar entries for. Obtain from query_context or get_context results."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "default": 5,
      "description": "Maximum number of similar entries to return. Typical range is 1-20; higher values may be slower. Default: 5."
    }
  },
  "required": [
    "id"
  ]
}
🟢get_knowledge_stats

Get summary statistics of the Klever VM knowledge base. Returns total entry count, counts broken down by context type (code_example, best_practice, security_tip, etc.), and a sample entry title for each type. Useful for understanding what knowledge is available before querying.

輸入結構描述

{
  "type": "object",
  "properties": {}
}
🟢enhance_with_context(query, autoInclude)

Augment a natural-language query with relevant Klever VM knowledge base context. Extracts Klever-specific keywords, finds matching entries, and returns the original query combined with relevant code examples and documentation in markdown. Use this to enrich a user prompt before answering Klever development questions.

輸入結構描述

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "The user's natural-language question or prompt to enhance (e.g. \"How do I handle KLV payments in my contract?\")."
    },
    "autoInclude": {
      "type": "boolean",
      "default": true,
      "description": "When true (default), automatically appends the most relevant knowledge base entries to the response. Set to false to only return metadata without injecting context."
    }
  },
  "required": [
    "query"
  ]
}
🟢search_documentation(query, category)

Search Klever VM documentation and knowledge base. Returns human-readable markdown with titles, descriptions, and code snippets. Optimized for "how do I..." questions. Use this instead of query_context when you need formatted developer documentation.

輸入結構描述

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Search query in natural language (e.g. \"how to use storage mappers\", \"deploy contract to testnet\", \"handle KDA token transfers\")."
    },
    "category": {
      "type": "string",
      "enum": [
        "core",
        "storage",
        "events",
        "tokens",
        "modules",
        "tools",
        "scripts",
        "examples",
        "errors",
        "best-practices",
        "documentation"
      ],
      "description": "Narrow results to a specific knowledge category. Available: core, storage, events, tokens, modules, tools, scripts, examples, errors, best-practices, documentation."
    }
  },
  "required": [
    "query"
  ]
}
🟢analyze_contract(sourceCode, contractName)

Analyze Klever smart contract Rust source code for common issues. Checks for missing imports, missing #[klever_sc::contract] macro, missing endpoint annotations, payable handlers without call_value usage, storage mappers without #[storage_mapper], and missing event definitions. Returns findings with severity (error/warning/info) and links to relevant knowledge base entries.

輸入結構描述

{
  "type": "object",
  "properties": {
    "sourceCode": {
      "type": "string",
      "description": "The full Rust source code of the Klever smart contract to analyze. Must be valid Rust code using klever_sc imports."
    },
    "contractName": {
      "type": "string",
      "description": "Human-readable name for the contract (used in output labeling). Defaults to \"contract\" if omitted."
    }
  },
  "required": [
    "sourceCode"
  ]
}
🟢get_balance(address, assetId, network)

Get the KLV or KDA token balance for a Klever blockchain address. Returns the balance in the smallest unit (for KLV: 1 KLV = 1,000,000 units with 6 decimal places). Optionally specify an asset ID to query a specific KDA token balance instead of KLV.

輸入結構描述

{
  "type": "object",
  "properties": {
    "address": {
      "type": "string",
      "description": "Klever address (klv1... bech32 format)."
    },
    "assetId": {
      "type": "string",
      "description": "Optional KDA token ID (e.g. \"USDT-A1B2\", \"LPKLVKFI-3I0N\"). Omit for KLV balance."
    },
    "network": {
      "type": "string",
      "enum": [
        "mainnet",
        "testnet",
        "devnet",
        "local"
      ],
      "description": "Network to query. Options: \"mainnet\", \"testnet\", \"devnet\", \"local\". Defaults to server default (mainnet)."
    }
  },
  "required": [
    "address"
  ]
}
🟢get_account(address, network)

Get full account details for a Klever blockchain address including nonce, balance, frozen balance, allowance, and permissions. Use this when you need comprehensive account state beyond just the balance.

輸入結構描述

{
  "type": "object",
  "properties": {
    "address": {
      "type": "string",
      "description": "Klever address (klv1... bech32 format)."
    },
    "network": {
      "type": "string",
      "enum": [
        "mainnet",
        "testnet",
        "devnet",
        "local"
      ],
      "description": "Network to query. Options: \"mainnet\", \"testnet\", \"devnet\", \"local\". Defaults to server default (mainnet)."
    }
  },
  "required": [
    "address"
  ]
}
🟢get_asset_info(assetId, network)

Get complete properties and configuration for any asset on the Klever blockchain (KLV, KFI, KDA tokens, NFT collections). Returns supply info, permissions (CanMint, CanBurn, etc.), roles, precision, and metadata. Note: string fields like ID, Name, Ticker are base64-encoded in the raw response.

輸入結構描述

{
  "type": "object",
  "properties": {
    "assetId": {
      "type": "string",
      "description": "Asset identifier (e.g. \"KLV\", \"KFI\", \"USDT-A1B2\", \"MYNFT-XY78\")."
    },
    "network": {
      "type": "string",
      "enum": [
        "mainnet",
        "testnet",
        "devnet",
        "local"
      ],
      "description": "Network to query. Options: \"mainnet\", \"testnet\", \"devnet\", \"local\". Defaults to server default (mainnet)."
    }
  },
  "required": [
    "assetId"
  ]
}
🟢query_sc(scAddress, funcName, args, caller, network)

Execute a read-only query against a Klever smart contract (VM view call). Returns the contract function result as base64-encoded return data. Arguments must be base64-encoded. Use this to read contract state without modifying it.

輸入結構描述

{
  "type": "object",
  "properties": {
    "scAddress": {
      "type": "string",
      "description": "Smart contract address (klv1... bech32 format)."
    },
    "funcName": {
      "type": "string",
      "description": "Function name to call (must be a #[view] function on the contract)."
    },
    "args": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Optional base64-encoded arguments. For addresses, encode the hex-decoded bech32 bytes. For numbers, use big-endian byte encoding."
    },
    "caller": {
      "type": "string",
      "description": "Optional caller address (klv1... bech32 format). Some view functions use the caller to look up address-keyed storage mappers."
    },
    "network": {
      "type": "string",
      "enum": [
        "mainnet",
        "testnet",
        "devnet",
        "local"
      ],
      "description": "Network to query. Options: \"mainnet\", \"testnet\", \"devnet\", \"local\". Defaults to server default (mainnet)."
    }
  },
  "required": [
    "scAddress",
    "funcName"
  ]
}
🟢get_transaction(hash, network)

Get transaction details by hash from the Klever blockchain. Returns sender, receiver, status, block info, contracts, and receipts. Uses the API proxy for indexed data.

輸入結構描述

{
  "type": "object",
  "properties": {
    "hash": {
      "type": "string",
      "description": "Transaction hash (hex string)."
    },
    "network": {
      "type": "string",
      "enum": [
        "mainnet",
        "testnet",
        "devnet",
        "local"
      ],
      "description": "Network to query. Options: \"mainnet\", \"testnet\", \"devnet\", \"local\". Defaults to server default (mainnet)."
    }
  },
  "required": [
    "hash"
  ]
}
🟢get_block(nonce, network)

Get block information from the Klever blockchain by nonce (block number). If no nonce is provided, returns the latest block. Returns hash, timestamp, proposer, number of transactions, and other block metadata.

輸入結構描述

{
  "type": "object",
  "properties": {
    "nonce": {
      "type": "integer",
      "minimum": 0,
      "description": "Block number (nonce). Omit to get the latest block."
    },
    "network": {
      "type": "string",
      "enum": [
        "mainnet",
        "testnet",
        "devnet",
        "local"
      ],
      "description": "Network to query. Options: \"mainnet\", \"testnet\", \"devnet\", \"local\". Defaults to server default (mainnet)."
    }
  }
}
🟢list_validators(network)

List active validators on the Klever blockchain network. Returns validator addresses, names, commission rates, delegation info, and staking amounts.

輸入結構描述

{
  "type": "object",
  "properties": {
    "network": {
      "type": "string",
      "enum": [
        "mainnet",
        "testnet",
        "devnet",
        "local"
      ],
      "description": "Network to query. Options: \"mainnet\", \"testnet\", \"devnet\", \"local\". Defaults to server default (mainnet)."
    }
  }
}
🟢init_klever_project(name, template, noMove)

Scaffold a new Klever smart contract project using the SDK. Creates the Rust project structure via `ksc new` and generates automation scripts (build, deploy, upgrade, query, test, interact). Requires Klever SDK installed at ~/klever-sdk/. Run check_sdk_status first to verify. NOTE: In public profile, this tool returns a project template JSON and does not perform any filesystem changes.

輸入結構描述

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The contract project name in kebab-case (e.g. \"my-token\", \"nft-marketplace\"). Used as the Cargo package name and directory name."
    },
    "template": {
      "type": "string",
      "enum": [
        "empty",
        "adder"
      ],
      "description": "Project template to scaffold from. \"empty\" creates a blank contract with just an init function. \"adder\" creates a simple counter example. Default: \"empty\".",
      "default": "empty"
    },
    "noMove": {
      "type": "boolean",
      "description": "When true, keeps the project in the SDK output directory instead of moving it to the current working directory. Default: false.",
      "default": false
    }
  },
  "required": [
    "name"
  ]
}
🟢add_helper_scripts(contractName)

Add build, deploy, upgrade, query, test, and interact automation scripts to an existing Klever smart contract project. Creates a scripts/ directory with bash scripts and updates .gitignore. Run this from the project root directory (where Cargo.toml is located). NOTE: In public profile, this tool returns a project template JSON and does not perform any filesystem changes.

輸入結構描述

{
  "type": "object",
  "properties": {
    "contractName": {
      "type": "string",
      "description": "The contract name to embed in scripts (e.g. \"my-token\"). If omitted, auto-detected from the `name` field in Cargo.toml."
    }
  }
}

社群

為此伺服器評分

證據

近期觀測

已驗證未記錄版本16 個工具
已驗證未記錄版本16 個工具
已驗證未記錄版本16 個工具