genlayer-cli-mcp
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 --versionMCP設定
このパッケージを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_KEYGENLAYER_PRV_KEYGENLAYER_PRIVKEYPRIVATE_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 packnpmへの公開:
npm login
npm publish --access publicツール
check_tools
node、genlayer、python、genvm-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エージェントにはこのデプロイツールが推奨されます:
ツール入力から
privateKeyが提供されている場合はそれを使用します。そうでない場合、有効であればMCP設定の環境変数から秘密鍵を使用します。
それも無効な場合、新しい秘密鍵を生成します。
選択または生成された秘密鍵を使用して直ちにデプロイします。
例:
{
"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
}サポートされているチェーン:
localnetstudionettestnetAsimovtestnetBradbury
エージェント設定例
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-mcpClaude 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エージェントは deploy、write、up、stop、init などの状態を変更するコマンドを実行できます。
信頼できるAIクライアントと有効化されたツールを使用する場合を除き、メインネットの秘密鍵をMCP設定に入れないでください。
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