プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。Google でログインするとレビューを書けます。プロトタイプ · 30分ごとに更新
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説

MCP Klever Vm

作者:klever-ioバージョン 1.3.0i★ 31iパソコンでもクラウドでも公式サイト ↗
レジストリ名io.github.klever-io/mcp-klever-vm

インストール方法

What it does

MCP server for Klever blockchain smart contract development.

  • Connects パソコンでもクラウドでも
  • Account or key No key needed
  • Category 暗号資産・ブロックチェーン

この順位の理由

一覧は利用スコア(100 点満点)で並びます。内訳は次のとおり

人気18/80GitHub スターか週間ダウンロード数。大きい方を 60、小さい方を 20 で数えます
新しさ3/1230 日以内のリリースかコード更新で満点
応答中8/8前回の確認でクラウドのエンドポイントが応答
利用スコア29/100

品質: 基本チェック 4/5 項目に合格(表示のみ、並び順には不使用) · 勢い: データなし (「急上昇」タブでのみ使用)

インストール

使っているAIアプリを選んで、設定をコピーしてください。

ひとことで AI にインストールしてもらう

MCP Klever Vm をインストールして。https://mcp.popnx.com/i/klever-io-mcp-klever-vm.md に従い、コマンドを見せて、私が OK するまで実行しないで。

パソコンで作業できる AI(Claude Code や Cursor など)に貼り付けます。手順を読み、コマンドを見せて、あなたの OK を待ちます。キー不要・登録不要。 · AI が読む全文を見る

チェック 4/5 合格 · 質問内容は提供元のサーバー(mcp.klever.org)を通ります · ✓ コマンド確認済み 2026年11月13日

まず:どの AI を使っていますか?

使っているアプリを選ぶと、下に手順が表示されます。

Claude につなげます · 約 2 分

キー不要、インストール不要 · claude.ai かデスクトップアプリで一度設定すれば、チャットで使えます · 無料アカウントは 1 つまで · Team/Enterprise はオーナー(Owner)が追加

  1. Claude の Connectors ページを開く

    CustomizeConnectors

    CustomizeConnectors1Add2https://…3Add4
  2. 「Add」→「Custom」→「Web」を押し、この 2 つを入力

    ここからコピーして Claude の同じ名前の欄に貼り付け、Continue を押します

    Name · 名前MCP Klever Vm
    Remote MCP server URL · アドレスhttps://mcp.klever.org/mcp

    Claude が検出したサインイン設定の画面で Continue を押す · Authentication は作者の説明どおり(Sign in now・Sign in when needed・No sign in)を選び Add を押します

  3. チャットで有効にする

    +ConnectorsMCP Klever Vm

  4. 試してみる

    MCP Klever Vm を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Claude が MCP Klever Vm を使っていると言うか、回答に MCP Klever Vm のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

ChatGPT との接続はプランしだい

フル MCP:Web 版 ChatGPT の Business・Enterprise・Edu · Pro:読み取り/取得の権限で接続、データを変えるツールは使えないことがあります · Plus:公式ドキュメントで未確認。プラグイン画面にカスタム MCP を追加する項目があれば試せます · Web のみ

  1. Web 版 ChatGPT で MCP の追加ページを開く

    Plugins+Add custom MCP server

    ChatGPTPlugins1+2https://…3Create4
  2. 名前とアドレスを入力

    名前を入れ、Connection にアドレスを貼り付け、注意事項にチェックして Create as a plugin を押します

    Name · 名前MCP Klever Vm
    Connection · アドレスhttps://mcp.klever.org/mcp
  3. チャットで MCP Klever Vm を選ぶ

    新しいチャットを開き、入力前にプラグインの一覧から MCP Klever Vm を選びます

  4. 試してみる

    MCP Klever Vm を使って、私に何ができるか教えて、1 つやってみせて

    ✓ ChatGPT が MCP Klever Vm を使っていると言うか、回答に MCP Klever Vm のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に OpenAI のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

Claude Code につなげます · 約 2 分

キー不要、インストール不要

  1. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:PowerShell を開く

  2. このコマンドを貼り付けて Enter

    claude mcp add --transport http --scope user klever-vm https://mcp.klever.org/mcp
  3. Claude Code で /mcp と入力

    MCP Klever Vm が一覧にあり、接続済みと表示されれば OK です

  4. 試してみる

    MCP Klever Vm を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Claude Code が MCP Klever Vm を使っていると言うか、回答に MCP Klever Vm のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

Cursor につなげます · 約 2 分

キー不要、インストール不要

  1. このボタンで Cursor を開く

    Cursor で開く

    Cursor がインストールの確認をするので Install を押します

  2. Cursor の AI チャットを Agent モードで開く

  3. 試してみる

    MCP Klever Vm を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Cursor が MCP Klever Vm を使っていると言うか、回答に MCP Klever Vm のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Cursor のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

VS Code につなげます · 約 2 分

キー不要、インストール不要

  1. このボタンで VS Code を開く

    VS Code で開く

    VS Code がインストールの確認をするので Install を押します

  2. VS Code の AI チャットを Agent モードで開く

  3. 試してみる

    MCP Klever Vm を使って、私に何ができるか教えて、1 つやってみせて

    ✓ VS Code が MCP Klever Vm を使っていると言うか、回答に MCP Klever Vm のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に VS Code のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

Windsurf、Zed、Gemini CLI など MCP を使える他のアプリは追加方法がそれぞれ違います。アプリ一覧で確認してください

MCP を使えるアプリをすべて見る →

Web 経由でつなぐアプリ用のアドレス

アドレスhttps://mcp.klever.org/mcp

JSON 設定は下の「開発者向け」にあります

つまずいたら?MCP Klever Vm を使っている人に聞いてみましょう💬 ディスカッション →
開発者向け:ターミナルのコマンドと JSON 設定

Web 経由

Claude Code

claude mcp add --transport http --scope user klever-vm https://mcp.klever.org/mcp

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "klever-vm": {
      "url": "https://mcp.klever.org/mcp"
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "klever-vm": {
      "type": "http",
      "url": "https://mcp.klever.org/mcp"
    }
  }
}

パソコンにインストール

Claude Code

claude mcp add --scope user klever-vm -- npx -y @klever/mcp-server

Claude Desktop (claude_desktop_config.json)

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

Cursor (~/.cursor/mcp.json)

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

VS Code (mcp.json)

{
  "servers": {
    "klever-vm": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@klever/mcp-server"
      ]
    }
  }
}

この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。

ひと目でわかる

週あたりのダウンロードi
88/週
接続方法
パソコンでもクラウドでも
最新バージョンi
1.3.0
レジストリ公開日i
2026年3月20日
コードの最終更新i
2026年5月19日
最終確認
2026年11月18日
作者
klever-io
パッケージ
npm: @klever/mcp-server
レジストリでの状態
有効

使えるアプリ

このサーバーのつなぎ方と、各アプリの公式ドキュメントに基づきます。2026年11月10日に確認。

インターネット経由でつなげるアプリ

ClaudeChatGPTGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatOpen WebUIRaycast

パソコン上で動かせるアプリ

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

すべてのアプリと長所・短所 →

できること

ツールの名前と説明は、サーバーが2026年11月18日に返したそのままの内容です。書いたのは作者で、私たちではありません。プレーンテキストとして表示しています。

  • query_context

    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.

  • get_context

    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.

  • find_similar

    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.

  • 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.

  • enhance_with_context

    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 a

  • search_documentation

    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.

  • analyze_contract

    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. R

  • get_balance

    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.

  • get_account

    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.

  • get_asset_info

    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

  • query_sc

    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.

  • get_transaction

    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.

  • get_block

    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.

  • list_validators

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

  • init_klever_project

    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. NOT

  • add_helper_scripts

    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 pr

基本チェックi

誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月19日にチェック

  • ✓ 合格

    作者とリポジトリが一致

    レジストリ名は、リポジトリを所有するGitHubアカウント klever-io で確認済みです

  • ! 注意

    今もメンテナンスされている

    コードの最終更新:6 か月前(6か月以上前)

  • ✓ 合格

    ライセンスがある

    MITを使用

  • ✓ 合格

    エンドポイントが応答する

    133ミリ秒で応答(HTTP 200)

  • – 対象外

    OAuthでサインイン

    サインイン不要

  • ✓ 合格

    ツールの説明に隠れた指示がない

    16件のツールの説明を読み、AIへの隠れた指示は見つかりませんでした

クラウドのアドレスは直近 4 回中 4 回応答 · 最新 133 ms · 確認日 2026年11月18日

公開済みの脆弱性(OSV.dev)

OSV.dev に @klever/mcp-server@1.3.0 の登録はありません

このバージョンのパッケージ本体のみ確認。すべての依存関係ではありません · 確認日 2026年11月15日

確認していること → · JSON

作者の方へ:再確認の依頼・情報の誤りの報告
作者向け:README にバッジを付ける

作者の方は、このコードを README に貼れます。バッジはこのページにリンクします。

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/klever-io-mcp-klever-vm.svg)](https://mcp.popnx.com/en/servers/klever-io-mcp-klever-vm)

話し合い

質問、コツの共有、使えないことの報告ができます。「役に立った」の多い順です。

まだ投稿はありません。最初の質問や共有をどうぞ。

ここの投稿は利用者によるもので、PopNx チームのものではありません。

ログインして投稿

ユーザーレビュー

まだレビューはありません

ログインしてレビューを書く

暗号資産・ブロックチェーンのほかのサーバーとの比較i

  • このカテゴリのほかの1754件のうち98%よりスターが多い
  • このカテゴリのほかの1754件のうち7%より最近レジストリに公開
  • 基本チェックの結果が、このカテゴリのほかの1754件のうち60%と同じかそれ以上

レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。

よくある質問

MCP Klever Vmは安全ですか?

当てはまる基本チェック5項目のうち4項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。

どんなキーやコードが必要ですか?

レジストリには必須のキーは載っていません。ただし、最初に使うときにサインインを求めるサーバーもあります。

パソコンで動きますか、それともクラウドですか?

どちらでも使えます。パソコンにインストールしても、クラウド版につないでもかまいません。

今もメンテナンスされていますか?

GitHubリポジトリの最終更新は6 か月前、最新バージョン(1.3.0)がレジストリに届いたのは8 か月前です。

どのアプリで使えますか?

Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。URL で接続するので、リモート MCP を受け付けるアプリでも使えます。例:Web 版 ChatGPT(Business 以上はフル MCP、Pro は読み取りのみ)。

代わりに使えるものは?

同じカテゴリには:DexSQL, PayRam, DexPaprika, Alchemy MCP Server, X402 List MCP

似た働きのほかの候補

同じカテゴリでほかの作者のもの。コマンドは確認済み。公式を先に、次にスター順。

カードの見方:↓ 週あたりのダウンロードi★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i

DexSQL

SQL for Android APK and DEX files: classes, methods, strings, references and smali.

作者:LSPosed成長中★ 32032 日前更新

パソコンで動く✓ lsposed.org

PayRam

Install, configure, operate and integrate self-hosted PayRam crypto payment gateways.

作者:PayRam成長中★ 15843 日前更新

クラウドで動く✓ 提供元 · payram.com

DexPaprika

DEX and on-chain data: liquidity pools, token prices, swaps, and trading volume.

作者:coinpaprika成長中★ 1206 日前更新

クラウドで動く✓ 提供元 · dexpaprika.com

X402 List MCP

Find and vet x402 payment APIs before your agent pays one: uptime, price, on-chain volume.

作者:mcccsm初期↓ 80/週★ 1840 日前更新

パソコンでもクラウドでも✓ 提供元 · x402-list.com
似たものと比べる
これ
MCP Klever Vm
DexSQLPayRamDexPaprikaAlchemy MCP ServerX402 List MCP
動く場所クラウドでもパソコンにインストールでも使えるパソコンにインストールが必要クラウドで動き、インストール不要クラウドで動き、インストール不要クラウドで動き、インストール不要クラウドでもパソコンにインストールでも使える
キーが必要いいえいいえいいえいいえいいえいいえ
Claude で + から追加いいえいいえいいえいいえいいえいいえ
基本チェック4/52/33/44/44/45/5
ライセンスMITNOASSERTION–MITMITMIT
料金登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし

作者のREADME

READMEを開く

作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。

Klever MCP Server

A Model Context Protocol (MCP) server tailored for Klever blockchain smart contract development. This server maintains and serves contextual knowledge including code patterns, best practices, and runtime behavior for developers working with the Klever VM SDK.

Features

  • 🚀 Triple Mode Operation: Run as HTTP API server, MCP stdio server, or public hosted MCP server
  • 💾 Flexible Storage: In-memory or Redis backend support
  • 🔍 Smart Context Retrieval: Query by type, tags, or contract type
  • 📝 Automatic Pattern Extraction: Parse Klever contracts to extract examples and patterns
  • 🎯 Relevance Ranking: Intelligent scoring and ranking of context
  • 🔄 Live Updates: Add and update context in real-time
  • 🛡️ Type Safety: Full TypeScript with Zod validation
  • 📚 Comprehensive Knowledge Base: Pre-loaded with Klever VM patterns, best practices, and examples
  • 🔧 Contract Validation: Automatic detection of common issues and anti-patterns
  • 🚀 Deployment Scripts: Ready-to-use scripts for contract deployment, upgrade, and querying

Quick Start

Install and run instantly via npx — no cloning required:

npx -y @klever/mcp-server

Or connect to the hosted public server:

claude mcp add -t http klever-vm https://mcp.klever.org/mcp

See MCP Client Integration for client-specific configuration.

Architecture

mcp-klever-vm/

├── src/ │ ├── api/ # HTTP API routes with validation │ ├── context/ # Context management service layer │ ├── mcp/ # MCP protocol server implementation │ ├── parsers/ # Klever contract parser and validator │ ├── storage/ # Storage backends (memory/Redis) │ │ ├── memory.ts # In-memory storage with size limits │ │ └── redis.ts # Redis storage with optimized queries │ ├── types/ # TypeScript type definitions │ ├── utils/ # Utilities and ingestion tools │ └── knowledge/ # Modular knowledge base (95+ entries) │ ├── core/ # Core concepts and imports │ ├── storage/ # Storage patterns and mappers │ ├── events/ # Event handling and rules │ ├── tokens/ # Token operations and decimals │ ├── modules/ # Built-in modules (admin, pause) │ ├── tools/ # CLI tools (koperator, ksc) │ ├── scripts/ # Helper scripts │ ├── examples/ # Complete contract examples │ ├── errors/ # Error patterns │ ├── best-practices/ # Optimization and validation │ └── documentation/ # API reference ├── tests/ # Test files └── docs/ # Documentation

Key Improvements Made
  1. Storage Layer
  • Added memory limits to prevent OOM in InMemoryStorage
  • Optimized Redis queries to avoid O(N) KEYS command
  • Added atomic transactions for Redis operations
  • Improved error handling and validation
  1. API Security
  • Added input validation for all endpoints
  • Batch operation size limits
  • Proper error responses without leaking internals
  • Environment-aware error messages
  1. Type Safety
  • Centralized schema validation
  • Proper TypeScript interfaces for options
  • Runtime validation of stored data
  1. Performance
  • Batch operations using Redis MGET
  • Index-based queries instead of full scans
  • Optimized count operations

Installation

  1. Clone the repository:
git clone https://github.com/klever-io/mcp-klever-vm.git

cd mcp-klever-vm

  1. Install dependencies:
pnpm install
  1. Copy environment configuration:
cp .env.example .env
  1. Install Klever SDK tools (required for transactions):
chmod +x scripts/install-sdk.sh && ./scripts/install-sdk.sh
  1. Build the project:
pnpm run build

Configuration

Edit .env file to configure the server:

# Server Mode (http, mcp, or public)

MODE=http

HTTP Server Port (only for http mode)

PORT=3000

Storage Backend (memory or redis)

STORAGE_TYPE=memory

Maximum contexts for in-memory storage (default: 10000)

MEMORY_MAX_SIZE=10000

Redis URL (only if STORAGE_TYPE=redis)

REDIS_URL=redis://localhost:6379

Node environment (development or production)

NODE_ENV=development

MCP Client Integration

Claude Code
# Add via npx (recommended)

claude mcp add klever-vm -- npx -y @klever/mcp-server

Or connect to the public hosted server

claude mcp add -t http klever-vm https://mcp.klever.org/mcp

Claude Desktop

Add to your claude_desktop_config.json:

{

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

For detailed setup, see the Claude Desktop Installation Guide.

Cursor

Add to your Cursor MCP settings (.cursor/mcp.json):

{

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

VS Code (GitHub Copilot)

Add to .vscode/mcp.json in your project:

{

"servers": { "klever-vm": { "type": "stdio", "command": "npx", "args": ["-y", "@klever/mcp-server"] } } }

For detailed setup, see the VS Code Installation Guide.

Public MCP Server

The Klever MCP Server can be hosted as a public shared service, allowing any developer to connect without running it locally.

Connecting to the Public Server
# Add permanently (user-level)

claude mcp add -t http klever-vm https://mcp.klever.org/mcp

Add for current project only

claude mcp add -t http -s project klever-vm https://mcp.klever.org/mcp

Available Tools (Public Mode)

The public server exposes a read-only subset of tools for security:

ToolDescription
query_contextSearch the Klever VM knowledge base
get_contextRetrieve a specific context by ID
find_similarFind contexts similar to a given context
get_knowledge_statsGet knowledge base statistics
enhance_with_contextEnhance queries with relevant Klever VM context

Write operations (add_context) and shell-based tools (init_klever_project, add_helper_scripts) are disabled in public mode.

Self-Hosting with Docker
# Build and run

docker build -t mcp-klever-vm . docker run -p 3000:3000 mcp-klever-vm

Or using docker compose

docker compose up -d

Then connect:

claude mcp add -t http klever-vm-local http://localhost:3000/mcp
Self-Hosting without Docker
pnpm install

pnpm run build pnpm run start:public

Environment Variables (Public Mode)
VariableDefaultDescription
MODEhttpSet to public for hosted mode
PORT3000Server port
CORS_ORIGINS_(unset)_Comma-separated allowed origins. Unset or * allows all origins
RATE_LIMIT_MCP60MCP endpoint requests/min per IP
RATE_LIMIT_API30API endpoint requests/min per IP
BODY_SIZE_LIMIT1mbMax request body size
Deployment Notes

For production at mcp.klever.org:

  • Deploy Docker container behind a reverse proxy (nginx/Caddy/cloud LB) for TLS termination
  • Ensure proxy passes mcp-session-id header and supports SSE (disable response buffering)
  • Single instance is sufficient as the server is read-only with an in-memory knowledge base
  • Consider Cloudflare for DDoS protection (SSE is supported)

Usage

Knowledge Base Loading

The server automatically loads the Klever knowledge base based on your storage type:

Memory Storage (Default)
  • Knowledge is automatically loaded when the server starts
  • No need to run pnpm run ingest separately
  • Data exists only while server is running
  • Best for development and testing
Redis Storage
# First, ingest the knowledge base (one time)

pnpm run ingest

Then start the server

pnpm run dev

- Knowledge persists in Redis database
  • Survives server restarts
  • Best for production use

This will load:

  • Smart contract templates and examples
  • Annotation rules and best practices
  • Storage mapper patterns and comparisons
  • Deployment and query scripts
  • Common errors and solutions
  • Testing patterns
  • API reference documentation
Running as HTTP Server
# Development mode

pnpm run dev

Production mode

pnpm run build && pnpm start

The HTTP API will be available at http://localhost:3000/api

Running as MCP Server
MODE=mcp pnpm start

Use with any MCP-compatible client.

API Endpoints
POST /api/context

Ingest new context into the system.

{

"type": "code_example", "content": "contract code here", "metadata": { "title": "Token Contract Example", "description": "ERC20-like token implementation", "tags": ["token", "fungible"], "contractType": "token" } }

GET /api/context/:id

Retrieve specific context by ID.

POST /api/context/query

Query contexts with filters.

{

"query": "transfer", "types": ["code_example", "best_practice"], "tags": ["token"], "contractType": "token", "limit": 10, "offset": 0 }

PUT /api/context/:id

Update existing context.

DELETE /api/context/:id

Delete context.

GET /api/context/:id/similar

Find similar contexts.

POST /api/context/batch

Batch ingest multiple contexts.

MCP Tools

When running as MCP server, the following tools are available:

  • query_context: Search for relevant Klever development context
  • add_context: Add new context to the knowledge base
  • get_context: Retrieve specific context by ID
  • find_similar: Find contexts similar to a given context
  • get_knowledge_stats: Get statistics about the knowledge base
  • init_klever_project: Initialize a new Klever smart contract project with helper scripts
  • enhance_with_context: Automatically enhance queries with relevant Klever VM context

Context Types

  • code_example: Working code snippets and examples (Rust smart contract code)
  • best_practice: Recommended patterns and practices
  • security_tip: Security considerations and warnings
  • optimization: Performance optimization techniques
  • documentation: General documentation and guides
  • error_pattern: Common errors and solutions
  • deployment_tool: Deployment scripts and utilities (bash scripts, tools)
  • runtime_behavior: Runtime behavior explanations

Pre-loaded Knowledge Base

The MCP server includes a comprehensive knowledge base with 95+ entries organized into 11 categories:

Critical Patterns
  • Payment handling and token operations
  • Decimal conversions and calculations
  • Event emission and parameter rules
  • CLI tool usage and best practices
Contract Patterns & Examples
  • Basic contract structure templates
  • Complete lottery game implementation
  • Staking contract with rewards
  • Cross-contract communication patterns
  • Remote storage access patterns
  • Token mapper helper modules
Development Tools
  • Koperator: Complete CLI reference with argument encoding
  • KSC: Build commands and project setup
  • Deployment, upgrade, and query scripts
  • Interactive contract management tools
  • Common utilities library (bech32, network management)
Storage & Optimization
  • Storage mapper selection guide with performance comparisons
  • Namespace organization patterns
  • View endpoints for efficient queries
  • Gas optimization techniques
  • OptionalValue vs Option patterns
Best Practices & Security
  • Input validation patterns
  • Error handling strategies
  • Admin and pause module usage
  • Access control patterns
  • Common mistakes and solutions

Ingesting Contracts

Use the built-in ingestion utilities to parse and import Klever contracts:

import { StorageFactory } from './storage/index.js';

import { ContextService } from './context/service.js'; import { ContractIngester } from './ut

冒頭だけを表示しています。続きはリポジトリで読めます