genlayer-cli-mcp
GenLayer CLI MCP
MCP-сервер для ИИ-агентов, которым необходимо работать с проектами GenLayer.
Он предоставляет:
genlayer: полный доступ к GenLayer CLIgenvm_lint: доступ кgenvm-lintgenlayer_deploy: развертывание контрактов с помощьюgenlayer-jscheck_tools: проверка доступности локальных инструментов и конфигурации закрытого ключа
Сервер использует транспорт stdio и выполняет команды с помощью spawn(command, args).
Требования
Node.js 18+
GenLayer CLI доступен в
PATHGenVM linter доступен в
PATH
Установите внешние инструменты:
npm install -g genlayer
py -3.12 -m pip install genvm-linterПроверьте их:
genlayer --version
genvm-lint --versionRelated MCP server: MCP Plus
Конфигурация 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_KEYGENLAYER_PRV_KEYGENLAYER_PRIVKEYPRIVATE_KEY
Закрытый ключ может быть либо 0x плюс 64 шестнадцатеричных символа, либо просто 64 шестнадцатеричных символа. Если настроенный ключ отсутствует или недействителен, 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
Проверяет node, genlayer, python, genvm-lint и конфигурацию закрытого ключа.
Пример промпта для ИИ:
Use MCP tool check_tools from genlayer-cli.genlayer
Запускает genlayer <args...> с полным доступом к командам.
Пример:
{
"args": ["--version"]
}Пример развертывания через raw 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
Развертывает интеллектуальный контракт (Intelligent Contract) через genlayer-js.
Это рекомендуемый инструмент развертывания для ИИ-агентов, так как он обрабатывает резервный вариант с закрытым ключом:
Использует
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
Примеры настройки агента
Используйте одно и то же определение MCP-сервера для агентов кодирования, которые поддерживают MCP через stdio. Замените закрытый ключ на свой собственный ключ testnet/local или оставьте его недействительным, если хотите, чтобы genlayer_deploy сгенерировал новый ключ во время развертывания.
Codex
Добавьте этот MCP-сервер в конфигурацию MCP вашего Codex:
{
"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
Добавьте MCP-сервер в настройки MCP Antigravity:
{
"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
Добавьте сервер с помощью команды добавления MCP в Claude Code:
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. ИИ-агенты могут выполнять команды, изменяющие состояние, такие как deploy, write, up, stop и init.
Не указывайте закрытый ключ основной сети (mainnet) в конфигурации MCP, если вы не доверяете ИИ-клиенту и всем включенным инструментам.
Available Tools
4 toolscheck_toolsA
Check whether node, genlayer, python, and genvm-lint are available to this MCP server.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It accurately describes a read-only check operation with no side effects. Could mention output format but adequate for simple health check.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, front-loaded with purpose, no extraneous words. Highly concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema, but the simple check tool's behavior is largely conveyed. Could clarify what 'available' means (e.g., installed, running), but sufficiently complete for low complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist, so schema coverage is 100%. Description need not add parameter info. Baseline score of 4 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states it checks availability of specific tools (node, genlayer, python, genvm-lint). Verb 'Check' plus explicit list distinguishes it from sibling tools that perform actions like deploy or lint.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives. It is implied it should be used as a precondition check, but no direct advice or exclusion criteria are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
genlayerB
Run the GenLayer CLI with full command access. This can perform state-changing operations.
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Arguments passed to the command. | |
| cwd | No | Working directory for the command. Defaults to the MCP server cwd. | |
| timeoutMs | No | Timeout in milliseconds. Defaults to 120000. | |
| env | No | Extra environment variables merged over the MCP server environment. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description notes that it 'can perform state-changing operations', which is a key behavioral trait. However, no annotations are provided, and the description lacks details on security, error handling, or resource impact.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very concise with two sentences, no fluff. While efficient, it could include a bit more context without becoming verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (4 parameters, no output schema, no annotations), the description is adequate but not fully complete. It does not describe return values or potential side effects beyond stating state-changing operations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with clear parameter descriptions. The description does not add significant meaning beyond the schema, meeting the baseline for this dimension.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Run the GenLayer CLI' with 'full command access', distinguishing it from sibling tools like genlayer_deploy and genvm_lint. However, it is somewhat broad without specifying typical commands.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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 the sibling tools. There is no mention of scenarios or alternatives, leaving the agent to infer usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
genlayer_deployB
Deploy a GenLayer Intelligent Contract with genlayer-js. Accepts privateKey; generates one when missing or invalid.
| Name | Required | Description | Default |
|---|---|---|---|
| contractPath | Yes | Path to the Intelligent Contract source file. | |
| privateKey | No | GenLayer private key. If missing or invalid, a new private key is generated with genlayer-js. | |
| args | No | Constructor arguments passed to deployContract. | |
| kwargs | No | Keyword constructor arguments passed to deployContract. | |
| rpcUrl | No | Custom GenLayer RPC endpoint. | |
| chain | No | GenLayer chain used when creating the SDK client. | localnet |
| cwd | No | Base directory for resolving contractPath. Defaults to MCP server cwd. | |
| leaderOnly | No | ||
| consensusMaxRotations | No | ||
| initializeConsensus | No | ||
| autoFundLocalnet | No | Call localnet sim_fundAccount before deploy. Only works on localnet. | |
| fundAmount | No | ||
| waitForReceipt | No | ||
| receiptStatus | No | ACCEPTED | |
| receiptRetries | No | ||
| receiptIntervalMs | No | ||
| timeoutMs | No | ||
| exposePrivateKey | No | Return the generated/used private key in output. Defaults false to avoid leaking secrets. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
In the absence of annotations, the description bears full responsibility for disclosing behavioral traits. It mentions the key generation fallback for privateKey but fails to disclose other significant behaviors such as error handling, side effects, or return value structure. This is insufficient for an 18-parameter tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise: two short sentences that front-load the core purpose and immediately add an important behavioral note. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (18 optional parameters, one required), the description is far from complete. It lacks information about error handling, output structure, behavior of optional parameters, or any post-deployment steps. An output schema would help, but it is absent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 50%, so the baseline is 3. The description adds value by explaining the privateKey fallback behavior beyond the schema. However, it does not compensate for the remaining 50% of parameters that lack schema descriptions, resulting in only marginal improvement.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it deploys a GenLayer Intelligent Contract using genlayer-js, which is a specific verb-resource combination. It distinguishes itself from sibling tools like check_tools, genlayer, and genvm_lint, which serve different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, nor does it mention prerequisites or context for usage. It only describes the action without any contextual usage advice.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
genvm_lintC
Run genvm-lint for GenVM contract linting, validation, schema extraction, typechecking, setup, or downloads.
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Arguments passed to the command. | |
| cwd | No | Working directory for the command. Defaults to the MCP server cwd. | |
| timeoutMs | No | Timeout in milliseconds. Defaults to 120000. | |
| env | No | Extra environment variables merged over the MCP server environment. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It fails to disclose behavioral traits like side effects (e.g., file modifications, network requests), error handling, or required permissions. The description does not elaborate on what the tool does beyond running a command.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, which is concise but lacks structure and prioritization. It lists multiple functions without highlighting the primary use case. It could be more efficiently organized.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool that runs a command, it is critical to mention that it returns stdout/stderr or exit code. No output schema is provided, and the description does not explain what the tool returns. Important behavioral context is missing, making it incomplete for an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, so the schema already documents the parameters (args, cwd, timeoutMs, env). The description adds no extra meaning beyond what the schema provides. Baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states that the tool runs genvm-lint for various tasks like linting, validation, schema extraction, etc., but it lists multiple purposes without a clear single focus. The verb 'Run' is generic and does not distinguish this tool from sibling tools like 'genlayer' or 'genlayer_deploy'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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 alternatives, such as 'check_tools' or 'genlayer'. There is no mention of prerequisites, limitations, or context in which this tool is appropriate.
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. Dates show when Glama detected each change.
4 tool updates
v0.1.0- First observed
check_tools - First observed
genlayer - First observed
genlayer_deploy - First observed
genvm_lint
TDQS
Each tool targets a clearly distinct function: checking environment availability, running arbitrary CLI commands, deploying contracts, and linting. No overlap in purpose.
Tool names are inconsistent: 'check_tools' uses verb_noun, 'genlayer' is a single word, 'genlayer_deploy' and 'genvm_lint' use prefix_verb pattern. Mixed conventions reduce predictability.
Four tools is reasonable for a CLI wrapper server, covering core operations without being too few or excessive.
The set covers essential actions: environment check, CLI execution, deployment, and linting. Missing other possible genlayer commands, but core workflow is covered.
Maintenance
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
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Official MCP server for Agentwork — delegate tasks to AI agents with human-in-the-loop
Related MCP Servers
- AlicenseAqualityAmaintenanceA Model Context Protocol (MCP) server that allows AI agents to generate smart contracts using OpenZeppelin Contracts libraries.33465294AGPL 3.0
- FlicenseNot gradedqualityDmaintenanceA lightweight MCP server that enhances AI agents with tools for codebase analysis, task delegation to sub-agents, multi-agent coordination through chatrooms, and project todo management.-
- AlicenseAqualityCmaintenanceA comprehensive MCP server for generating sophisticated GenLayer Intelligent Contracts with AI-native blockchain capabilities.16177MIT
- AlicenseAqualityCmaintenanceAn MCP server that lets AI agents build on GenLayer by searching documentation, inspecting contracts and transactions over RPC, and scaffolding, linting, and testing Intelligent Contracts.46201MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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