Skip to main content
Glama
ngh1105
by ngh1105

GenLayer CLI MCP

GenLayerプロジェクトを操作する必要があるAIエージェント向けのMCPサーバーです。

以下の機能を提供します:

  • genlayer: GenLayer CLIへのフルアクセス

  • genvm_lint: genvm-lintへのアクセス

  • genlayer_deploy: genlayer-jsを使用したコントラクトのデプロイ

  • check_tools: ローカルツールの可用性と秘密鍵の設定確認

このサーバーはstdioトランスポートを使用し、spawn(command, args)でコマンドを実行します。

要件

  • Node.js 18以上

  • PATH上にGenLayer CLIがインストールされていること

  • PATH上にGenVM linterがインストールされていること

外部ツールのインストール:

npm install -g genlayer
py -3.12 -m pip install genvm-linter

ツールの確認:

genlayer --version
genvm-lint --version

MCP設定

このパッケージをnpmに公開する場合:

{
  "mcpServers": {
    "genlayer-cli": {
      "command": "npx",
      "args": ["-y", "genlayer-cli-mcp"],
      "env": {
        "GENLAYER_PRIVATE_KEY": "0x_your_private_key_here"
      }
    }
  }
}

このリポジトリから実行する場合:

{
  "mcpServers": {
    "genlayer-cli": {
      "command": "node",
      "args": ["E:\\genlayer-cli-mcp\\dist\\index.js"],
      "env": {
        "GENLAYER_PRIVATE_KEY": "0x_your_private_key_here"
      }
    }
  }
}

利用可能な秘密鍵の環境変数名:

  • GENLAYER_PRIVATE_KEY

  • GENLAYER_PRV_KEY

  • GENLAYER_PRIVKEY

  • PRIVATE_KEY

秘密鍵は、0xで始まる64桁の16進数、または生の64桁の16進数のいずれかです。設定された鍵が見つからない、または無効な場合、genlayer_deployは新しい秘密鍵を生成し、同じツール呼び出し内でそれを使用してデプロイを行います。新しい鍵が生成された場合、レスポンスにその鍵が含まれるため、保存しておくことができます。

ローカル開発

cd E:\genlayer-cli-mcp
npm install
npm run build
npm run smoke

サーバーの実行:

node E:\genlayer-cli-mcp\dist\index.js

ローカルでのパッケージ化:

npm pack

npmへの公開:

npm login
npm publish --access public

ツール

check_tools

nodegenlayerpythongenvm-lint、および秘密鍵の設定を確認します。

AIプロンプトの例:

Use MCP tool check_tools from genlayer-cli.

genlayer

コマンドへのフルアクセス権限で genlayer <args...> を実行します。

例:

{
  "args": ["--version"]
}

生のCLIを通じたデプロイの例:

{
  "args": [
    "deploy",
    "--contract",
    "E:\\path\\to\\contract.py",
    "--rpc",
    "http://localhost:4000/api"
  ],
  "timeoutMs": 120000
}

genvm_lint

genvm-lint <args...> を実行します。

例:

{
  "args": ["check", "E:\\path\\to\\contract.py"],
  "timeoutMs": 120000
}

genlayer_deploy

genlayer-js を通じてIntelligent Contractをデプロイします。

秘密鍵のフォールバックを処理するため、AIエージェントにはこのデプロイツールが推奨されます:

  1. ツール入力から privateKey が提供されている場合はそれを使用します。

  2. そうでない場合、有効であればMCP設定の環境変数から秘密鍵を使用します。

  3. それも無効な場合、新しい秘密鍵を生成します。

  4. 選択または生成された秘密鍵を使用して直ちにデプロイします。

例:

{
  "contractPath": "E:\\path\\to\\contract.py",
  "chain": "localnet",
  "rpcUrl": "http://localhost:4000/api",
  "autoFundLocalnet": true,
  "waitForReceipt": true,
  "receiptStatus": "ACCEPTED",
  "timeoutMs": 120000
}

オプションフィールド:

{
  "privateKey": "0x...",
  "args": [],
  "kwargs": {},
  "cwd": "E:\\project",
  "leaderOnly": false,
  "consensusMaxRotations": 5,
  "initializeConsensus": true,
  "fundAmount": 10,
  "receiptRetries": 50,
  "receiptIntervalMs": 5000,
  "exposePrivateKey": false
}

サポートされているチェーン:

  • localnet

  • studionet

  • testnetAsimov

  • testnetBradbury

エージェント設定例

stdio経由のMCPをサポートするコーディングエージェントには、同じMCPサーバー定義を使用してください。秘密鍵は独自のテストネット/ローカル鍵に置き換えるか、genlayer_deployでデプロイ時に新しい鍵を生成させたい場合は無効なままにしておいてください。

Codex

CodexのMCP設定にこのMCPサーバーを追加します:

{
  "mcpServers": {
    "genlayer-cli": {
      "command": "npx",
      "args": ["-y", "genlayer-cli-mcp"],
      "env": {
        "GENLAYER_PRIVATE_KEY": "0x_your_private_key_here"
      }
    }
  }
}

推奨されるCodexプロンプト:

Use MCP tool check_tools from genlayer-cli and tell me whether deploy can use the configured private key.

Then lint my GenLayer contract with genvm_lint.

If lint passes, deploy it with genlayer_deploy using:
{
  "contractPath": "E:\\path\\to\\contract.py",
  "chain": "localnet",
  "rpcUrl": "http://localhost:4000/api",
  "autoFundLocalnet": true,
  "waitForReceipt": true,
  "receiptStatus": "ACCEPTED"
}

Antigravity

AntigravityのMCP設定にこのMCPサーバーを追加します:

{
  "mcpServers": {
    "genlayer-cli": {
      "command": "npx",
      "args": ["-y", "genlayer-cli-mcp"],
      "env": {
        "GENLAYER_PRIVATE_KEY": "0x_your_private_key_here"
      }
    }
  }
}

推奨されるAntigravityプロンプト:

Use the genlayer-cli MCP server.

First call check_tools.
Then run genvm_lint on:
{
  "args": ["check", "E:\\path\\to\\contract.py"]
}

If the contract is valid, call genlayer_deploy. If the configured MCP private key is invalid, let the MCP tool generate a new private key and deploy with it automatically.

Claude Code

Claude CodeのMCP追加コマンドでサーバーを追加します:

claude mcp add genlayer-cli -- npx -y genlayer-cli-mcp

Claude Codeの設定でMCP設定内の環境変数がサポートされている場合は、以下を追加します:

{
  "GENLAYER_PRIVATE_KEY": "0x_your_private_key_here"
}

代替のローカルソースコマンド:

claude mcp add genlayer-cli -- node E:\genlayer-cli-mcp\dist\index.js

推奨されるClaude Codeプロンプト:

Use the genlayer-cli MCP server.

1. Call check_tools.
2. Run genvm_lint for E:\path\to\contract.py.
3. If lint succeeds, deploy with genlayer_deploy.
4. If the private key in MCP config is missing or invalid, generate a new private key and deploy with that generated key in the same tool call.

Arguments:
{
  "contractPath": "E:\\path\\to\\contract.py",
  "chain": "localnet",
  "rpcUrl": "http://localhost:4000/api",
  "autoFundLocalnet": true,
  "waitForReceipt": true,
  "receiptStatus": "ACCEPTED"
}

セキュリティ

このMCPサーバーは、意図的にGenLayerコマンドへのフルアクセスを許可しています。AIエージェントは deploywriteupstopinit などの状態を変更するコマンドを実行できます。

信頼できるAIクライアントと有効化されたツールを使用する場合を除き、メインネットの秘密鍵をMCP設定に入れないでください。

Install Server
F
license - not found
B
quality
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

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/ngh1105/genlayer-cli-mcp'

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