Skip to content

Commit b7318da

Browse files
authored
Fix CLI mcp (#2984)
* Update and lockdown mcp version, fix ethers import * Update changelog
1 parent 8512316 commit b7318da

31 files changed

Lines changed: 88 additions & 51 deletions

packages/cli/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Fixed
9+
- Ethers import error (#2984)
10+
11+
### Changed
12+
- Update MCP SDK and lock down version (#2984)
813

914
## [6.6.1] - 2025-11-20
1015
### Changed

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"dependencies": {
1111
"@apollo/client": "^3.14.0",
1212
"@inquirer/prompts": "^5.3.6",
13-
"@modelcontextprotocol/sdk": "^1.17.2",
13+
"@modelcontextprotocol/sdk": "1.24.3",
1414
"@oclif/core": "^4.8.0",
1515
"@subql/common": "workspace:~",
1616
"@subql/contract-sdk": "^1.9.0",

packages/cli/src/adapters/utils.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ import {stripVTControlCharacters} from 'node:util';
66
import {confirm, input, search, checkbox} from '@inquirer/prompts';
77
import {McpServer} from '@modelcontextprotocol/sdk/server/mcp.js';
88
import {RequestHandlerExtra} from '@modelcontextprotocol/sdk/shared/protocol';
9-
import {CallToolResult, ElicitRequest, ServerNotification, ServerRequest} from '@modelcontextprotocol/sdk/types';
9+
import {
10+
CallToolResult,
11+
ElicitRequestFormParams,
12+
ServerNotification,
13+
ServerRequest,
14+
} from '@modelcontextprotocol/sdk/types';
1015
import {Args, Command, Flags} from '@oclif/core';
1116
import {Flag, Arg} from '@oclif/core/lib/interfaces';
1217
import fuzzy from 'fuzzy';
@@ -185,7 +190,7 @@ export function mcpLogger(server: McpServer['server']): Logger {
185190
const log = (level: 'error' | 'debug' | 'info' | 'notice') => (input: string) => {
186191
void server.sendLoggingMessage({
187192
level,
188-
message: stripVTControlCharacters(input),
193+
data: stripVTControlCharacters(input),
189194
});
190195
};
191196
return {
@@ -243,7 +248,7 @@ export function makeInputSchema<T extends keyof PromptTypes>(
243248
mmultiple?: boolean,
244249
options?: PromptTypes[T][],
245250
defaultValue?: PromptTypes[T]
246-
): ElicitRequest['params']['requestedSchema'] {
251+
): ElicitRequestFormParams['requestedSchema'] {
247252
if (type === 'string') {
248253
return {
249254
type: 'object',
@@ -256,7 +261,7 @@ export function makeInputSchema<T extends keyof PromptTypes>(
256261
},
257262
},
258263
required: ['input'],
259-
additionalProperties: false,
264+
// additionalProperties: false,
260265
};
261266
// } else if (type === 'number') {
262267
// return zodToJsonSchema(
@@ -284,6 +289,7 @@ export function makeInputSchema<T extends keyof PromptTypes>(
284289
export function makeMCPElicitPrmompt(server: McpServer): Prompt {
285290
return async ({defaultValue, message, multiple, options, required, type}) => {
286291
const res = await server.server.elicitInput({
292+
mode: 'form',
287293
message,
288294
requestedSchema: makeInputSchema(type, required, multiple, options, defaultValue),
289295
});

packages/cli/src/commands/mcp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export default class MCP extends Command {
4646
{
4747
name: 'SubQuery CLI',
4848
version: pjson.version,
49-
description:
50-
'Interact with SubQuery CLI commands using Model Context Protocol. This allows you to initialize, build and deploy your SubQuery projects.',
49+
// description:
50+
// 'Interact with SubQuery CLI commands using Model Context Protocol. This allows you to initialize, build and deploy your SubQuery projects.',
5151
},
5252
{
5353
capabilities: {

packages/cli/src/commands/multi-chain/add.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default class MultiChainAdd extends Command {
4343

4444
export function registerMultichainAddMCPTool(server: McpServer): RegisteredTool {
4545
return server.registerTool(
46-
`multichain:${MultiChainAdd.name}`,
46+
`multichain.${MultiChainAdd.name}`,
4747
{
4848
description: MultiChainAdd.description,
4949
inputSchema: multichainAddInputs.shape,

packages/cli/src/commands/network/add-deployment-boost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export default class AddDeploymentBoost extends Command {
9797

9898
export function registerAddDeploymentBoostMCPTool(server: McpServer, opts: MCPToolOptions): RegisteredTool {
9999
return server.registerTool(
100-
`network:${AddDeploymentBoost.name}`,
100+
`network.${AddDeploymentBoost.name}`,
101101
{
102102
description: AddDeploymentBoost.description,
103103
inputSchema: addDeploymentBoostInputs.shape,

packages/cli/src/commands/network/connect-wallet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default class ConnectWallet extends Command {
5757

5858
export function registerConnectWalletMCPTool(server: McpServer, opts: MCPToolOptions): RegisteredTool {
5959
return server.registerTool(
60-
`network:${ConnectWallet.name}`,
60+
`network.${ConnectWallet.name}`,
6161
{
6262
description: ConnectWallet.description,
6363
inputSchema: connectWalletInputs.shape,

packages/cli/src/commands/network/create-api-key.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default class CreateNetworkApiKey extends Command {
5959

6060
export function registerCreateNetworkApiKeyMCPTool(server: McpServer): RegisteredTool {
6161
return server.registerTool(
62-
`network:${CreateNetworkApiKey.name}`,
62+
`network.${CreateNetworkApiKey.name}`,
6363
{
6464
description: CreateNetworkApiKey.description,
6565
inputSchema: createApiKeyInputs.shape,

packages/cli/src/commands/network/create-deployment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default class CreateNetworkDeployment extends Command {
109109

110110
export function registerCreateNetworkDeploymentMCPTool(server: McpServer, opts: MCPToolOptions): RegisteredTool {
111111
return server.registerTool(
112-
`network:${CreateNetworkDeployment.name}`,
112+
`network.${CreateNetworkDeployment.name}`,
113113
{
114114
description: CreateNetworkDeployment.description,
115115
inputSchema: (opts.supportsElicitation

packages/cli/src/commands/network/create-flex-plan.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export default class CreateNetworkFlexPlan extends Command {
117117

118118
export function registerCreateNetworkFlexPlanMCPTool(server: McpServer): RegisteredTool {
119119
return server.registerTool(
120-
`network:${CreateNetworkFlexPlan.name}`,
120+
`network.${CreateNetworkFlexPlan.name}`,
121121
{
122122
description: CreateNetworkFlexPlan.description,
123123
inputSchema: createFlexPlanInputs.shape,

0 commit comments

Comments
 (0)