@openzeppelin/contracts-mcp 0.5.10 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/README.md +20 -1
  2. package/apps/cairo-account.html +20 -0
  3. package/apps/cairo-custom.html +20 -0
  4. package/apps/cairo-erc1155.html +20 -0
  5. package/apps/cairo-erc20.html +20 -0
  6. package/apps/cairo-erc721.html +20 -0
  7. package/apps/cairo-governor.html +20 -0
  8. package/apps/cairo-multisig.html +20 -0
  9. package/apps/cairo-vesting.html +20 -0
  10. package/apps/confidential-erc7984.html +20 -0
  11. package/apps/solidity-account.html +22 -0
  12. package/apps/solidity-custom.html +22 -0
  13. package/apps/solidity-erc1155.html +22 -0
  14. package/apps/solidity-erc20.html +22 -0
  15. package/apps/solidity-erc721.html +22 -0
  16. package/apps/solidity-governor.html +22 -0
  17. package/apps/solidity-rwa.html +22 -0
  18. package/apps/solidity-stablecoin.html +22 -0
  19. package/apps/stellar-fungible.html +20 -0
  20. package/apps/stellar-governor.html +20 -0
  21. package/apps/stellar-non-fungible.html +20 -0
  22. package/apps/stellar-stablecoin.html +20 -0
  23. package/apps/stellar-vault.html +20 -0
  24. package/apps/stylus-erc1155.html +20 -0
  25. package/apps/stylus-erc20.html +20 -0
  26. package/apps/stylus-erc721.html +20 -0
  27. package/apps/uniswap-hooks.html +20 -0
  28. package/dist/apps/register.d.ts +50 -0
  29. package/dist/apps/register.d.ts.map +1 -0
  30. package/dist/apps/register.js +129 -0
  31. package/dist/apps/register.js.map +1 -0
  32. package/dist/cairo/tools/account.d.ts.map +1 -1
  33. package/dist/cairo/tools/account.js +7 -9
  34. package/dist/cairo/tools/account.js.map +1 -1
  35. package/dist/cairo/tools/custom.d.ts.map +1 -1
  36. package/dist/cairo/tools/custom.js +7 -9
  37. package/dist/cairo/tools/custom.js.map +1 -1
  38. package/dist/cairo/tools/erc1155.d.ts.map +1 -1
  39. package/dist/cairo/tools/erc1155.js +7 -9
  40. package/dist/cairo/tools/erc1155.js.map +1 -1
  41. package/dist/cairo/tools/erc20.d.ts.map +1 -1
  42. package/dist/cairo/tools/erc20.js +7 -9
  43. package/dist/cairo/tools/erc20.js.map +1 -1
  44. package/dist/cairo/tools/erc721.d.ts.map +1 -1
  45. package/dist/cairo/tools/erc721.js +7 -9
  46. package/dist/cairo/tools/erc721.js.map +1 -1
  47. package/dist/cairo/tools/governor.d.ts.map +1 -1
  48. package/dist/cairo/tools/governor.js +7 -9
  49. package/dist/cairo/tools/governor.js.map +1 -1
  50. package/dist/cairo/tools/multisig.d.ts.map +1 -1
  51. package/dist/cairo/tools/multisig.js +7 -9
  52. package/dist/cairo/tools/multisig.js.map +1 -1
  53. package/dist/cairo/tools/vesting.d.ts.map +1 -1
  54. package/dist/cairo/tools/vesting.js +7 -9
  55. package/dist/cairo/tools/vesting.js.map +1 -1
  56. package/dist/cli.js +0 -0
  57. package/dist/confidential/tools/erc7984.d.ts.map +1 -1
  58. package/dist/confidential/tools/erc7984.js +7 -9
  59. package/dist/confidential/tools/erc7984.js.map +1 -1
  60. package/dist/server.d.ts.map +1 -1
  61. package/dist/server.js +5 -0
  62. package/dist/server.js.map +1 -1
  63. package/dist/solidity/tools/account.d.ts.map +1 -1
  64. package/dist/solidity/tools/account.js +7 -9
  65. package/dist/solidity/tools/account.js.map +1 -1
  66. package/dist/solidity/tools/custom.d.ts.map +1 -1
  67. package/dist/solidity/tools/custom.js +7 -9
  68. package/dist/solidity/tools/custom.js.map +1 -1
  69. package/dist/solidity/tools/erc1155.d.ts.map +1 -1
  70. package/dist/solidity/tools/erc1155.js +9 -9
  71. package/dist/solidity/tools/erc1155.js.map +1 -1
  72. package/dist/solidity/tools/erc20.d.ts.map +1 -1
  73. package/dist/solidity/tools/erc20.js +7 -9
  74. package/dist/solidity/tools/erc20.js.map +1 -1
  75. package/dist/solidity/tools/erc721.d.ts.map +1 -1
  76. package/dist/solidity/tools/erc721.js +9 -9
  77. package/dist/solidity/tools/erc721.js.map +1 -1
  78. package/dist/solidity/tools/governor.d.ts.map +1 -1
  79. package/dist/solidity/tools/governor.js +8 -9
  80. package/dist/solidity/tools/governor.js.map +1 -1
  81. package/dist/solidity/tools/rwa.d.ts +2 -2
  82. package/dist/solidity/tools/rwa.d.ts.map +1 -1
  83. package/dist/solidity/tools/rwa.js +7 -9
  84. package/dist/solidity/tools/rwa.js.map +1 -1
  85. package/dist/solidity/tools/stablecoin.d.ts.map +1 -1
  86. package/dist/solidity/tools/stablecoin.js +7 -9
  87. package/dist/solidity/tools/stablecoin.js.map +1 -1
  88. package/dist/stellar/tools/fungible.d.ts.map +1 -1
  89. package/dist/stellar/tools/fungible.js +7 -9
  90. package/dist/stellar/tools/fungible.js.map +1 -1
  91. package/dist/stellar/tools/governor.d.ts.map +1 -1
  92. package/dist/stellar/tools/governor.js +7 -9
  93. package/dist/stellar/tools/governor.js.map +1 -1
  94. package/dist/stellar/tools/non-fungible.d.ts.map +1 -1
  95. package/dist/stellar/tools/non-fungible.js +7 -9
  96. package/dist/stellar/tools/non-fungible.js.map +1 -1
  97. package/dist/stellar/tools/stablecoin.d.ts.map +1 -1
  98. package/dist/stellar/tools/stablecoin.js +7 -9
  99. package/dist/stellar/tools/stablecoin.js.map +1 -1
  100. package/dist/stellar/tools/vault.d.ts.map +1 -1
  101. package/dist/stellar/tools/vault.js +7 -9
  102. package/dist/stellar/tools/vault.js.map +1 -1
  103. package/dist/stylus/tools/erc1155.d.ts.map +1 -1
  104. package/dist/stylus/tools/erc1155.js +7 -9
  105. package/dist/stylus/tools/erc1155.js.map +1 -1
  106. package/dist/stylus/tools/erc20.d.ts.map +1 -1
  107. package/dist/stylus/tools/erc20.js +7 -9
  108. package/dist/stylus/tools/erc20.js.map +1 -1
  109. package/dist/stylus/tools/erc721.d.ts.map +1 -1
  110. package/dist/stylus/tools/erc721.js +7 -9
  111. package/dist/stylus/tools/erc721.js.map +1 -1
  112. package/dist/uniswap-hooks/tools/hooks.d.ts.map +1 -1
  113. package/dist/uniswap-hooks/tools/hooks.js +7 -9
  114. package/dist/uniswap-hooks/tools/hooks.js.map +1 -1
  115. package/dist/utils.d.ts +4 -15
  116. package/dist/utils.d.ts.map +1 -1
  117. package/dist/utils.js +15 -39
  118. package/dist/utils.js.map +1 -1
  119. package/package.json +6 -3
  120. package/src/apps/register.ts +152 -0
  121. package/src/cairo/tools/account.ts +10 -12
  122. package/src/cairo/tools/custom.ts +10 -12
  123. package/src/cairo/tools/erc1155.ts +10 -12
  124. package/src/cairo/tools/erc20.ts +10 -12
  125. package/src/cairo/tools/erc721.ts +10 -12
  126. package/src/cairo/tools/governor.ts +10 -12
  127. package/src/cairo/tools/multisig.ts +10 -12
  128. package/src/cairo/tools/vesting.ts +10 -12
  129. package/src/confidential/tools/erc7984.ts +11 -13
  130. package/src/server.ts +5 -0
  131. package/src/solidity/tools/account.ts +10 -12
  132. package/src/solidity/tools/custom.ts +10 -12
  133. package/src/solidity/tools/erc1155.ts +26 -13
  134. package/src/solidity/tools/erc20.ts +10 -12
  135. package/src/solidity/tools/erc721.ts +14 -12
  136. package/src/solidity/tools/governor.ts +12 -12
  137. package/src/solidity/tools/rwa.ts +12 -14
  138. package/src/solidity/tools/stablecoin.ts +10 -12
  139. package/src/stellar/tools/fungible.ts +10 -12
  140. package/src/stellar/tools/governor.ts +10 -12
  141. package/src/stellar/tools/non-fungible.ts +10 -12
  142. package/src/stellar/tools/stablecoin.ts +10 -12
  143. package/src/stellar/tools/vault.ts +10 -12
  144. package/src/stylus/tools/erc1155.ts +10 -12
  145. package/src/stylus/tools/erc20.ts +10 -12
  146. package/src/stylus/tools/erc721.ts +10 -12
  147. package/src/uniswap-hooks/tools/hooks.ts +10 -13
  148. package/src/utils.ts +15 -38
@@ -1,15 +1,20 @@
1
1
  import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { ERC20Options } from '@openzeppelin/wizard-cairo';
3
3
  import { erc20 } from '@openzeppelin/wizard-cairo';
4
- import { safePrintCairoCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { cairoERC20Schema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { cairoPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
9
  export function registerCairoERC20(server: McpServer): RegisteredTool {
9
- return server.tool(
10
+ return registerWizardAppTool(
11
+ server,
10
12
  'cairo-erc20',
11
- makeDetailedPrompt(cairoPrompts.ERC20),
12
- cairoERC20Schema,
13
+ {
14
+ description: makeDetailedPrompt(cairoPrompts.ERC20),
15
+ inputSchema: cairoERC20Schema,
16
+ title: 'Cairo ERC20',
17
+ },
13
18
  async ({
14
19
  name,
15
20
  symbol,
@@ -42,14 +47,7 @@ export function registerCairoERC20(server: McpServer): RegisteredTool {
42
47
  info,
43
48
  macros,
44
49
  };
45
- return {
46
- content: [
47
- {
48
- type: 'text',
49
- text: safePrintCairoCodeBlock(() => erc20.print(opts)),
50
- },
51
- ],
52
- };
50
+ return wizardAppPrintResult(opts, () => erc20.print(opts), 'cairo');
53
51
  },
54
52
  );
55
53
  }
@@ -1,15 +1,20 @@
1
1
  import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { ERC721Options } from '@openzeppelin/wizard-cairo';
3
3
  import { erc721 } from '@openzeppelin/wizard-cairo';
4
- import { safePrintCairoCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { cairoERC721Schema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { cairoPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
9
  export function registerCairoERC721(server: McpServer): RegisteredTool {
9
- return server.tool(
10
+ return registerWizardAppTool(
11
+ server,
10
12
  'cairo-erc721',
11
- makeDetailedPrompt(cairoPrompts.ERC721),
12
- cairoERC721Schema,
13
+ {
14
+ description: makeDetailedPrompt(cairoPrompts.ERC721),
15
+ inputSchema: cairoERC721Schema,
16
+ title: 'Cairo ERC721',
17
+ },
13
18
  async ({
14
19
  name,
15
20
  symbol,
@@ -44,14 +49,7 @@ export function registerCairoERC721(server: McpServer): RegisteredTool {
44
49
  info,
45
50
  macros,
46
51
  };
47
- return {
48
- content: [
49
- {
50
- type: 'text',
51
- text: safePrintCairoCodeBlock(() => erc721.print(opts)),
52
- },
53
- ],
54
- };
52
+ return wizardAppPrintResult(opts, () => erc721.print(opts), 'cairo');
55
53
  },
56
54
  );
57
55
  }
@@ -1,15 +1,20 @@
1
1
  import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { GovernorOptions } from '@openzeppelin/wizard-cairo';
3
3
  import { governor } from '@openzeppelin/wizard-cairo';
4
- import { safePrintCairoCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { cairoGovernorSchema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { cairoPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
9
  export function registerCairoGovernor(server: McpServer): RegisteredTool {
9
- return server.tool(
10
+ return registerWizardAppTool(
11
+ server,
10
12
  'cairo-governor',
11
- makeDetailedPrompt(cairoPrompts.Governor),
12
- cairoGovernorSchema,
13
+ {
14
+ description: makeDetailedPrompt(cairoPrompts.Governor),
15
+ inputSchema: cairoGovernorSchema,
16
+ title: 'Cairo Governor',
17
+ },
13
18
  async ({
14
19
  name,
15
20
  delay,
@@ -48,14 +53,7 @@ export function registerCairoGovernor(server: McpServer): RegisteredTool {
48
53
  info,
49
54
  macros,
50
55
  };
51
- return {
52
- content: [
53
- {
54
- type: 'text',
55
- text: safePrintCairoCodeBlock(() => governor.print(opts)),
56
- },
57
- ],
58
- };
56
+ return wizardAppPrintResult(opts, () => governor.print(opts), 'cairo');
59
57
  },
60
58
  );
61
59
  }
@@ -1,15 +1,20 @@
1
1
  import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { MultisigOptions } from '@openzeppelin/wizard-cairo';
3
3
  import { multisig } from '@openzeppelin/wizard-cairo';
4
- import { safePrintCairoCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { cairoMultisigSchema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { cairoPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
9
  export function registerCairoMultisig(server: McpServer): RegisteredTool {
9
- return server.tool(
10
+ return registerWizardAppTool(
11
+ server,
10
12
  'cairo-multisig',
11
- makeDetailedPrompt(cairoPrompts.Multisig),
12
- cairoMultisigSchema,
13
+ {
14
+ description: makeDetailedPrompt(cairoPrompts.Multisig),
15
+ inputSchema: cairoMultisigSchema,
16
+ title: 'Cairo Multisig',
17
+ },
13
18
  async ({ name, quorum, upgradeable, info, macros }) => {
14
19
  const opts: MultisigOptions = {
15
20
  name,
@@ -18,14 +23,7 @@ export function registerCairoMultisig(server: McpServer): RegisteredTool {
18
23
  info,
19
24
  macros,
20
25
  };
21
- return {
22
- content: [
23
- {
24
- type: 'text',
25
- text: safePrintCairoCodeBlock(() => multisig.print(opts)),
26
- },
27
- ],
28
- };
26
+ return wizardAppPrintResult(opts, () => multisig.print(opts), 'cairo');
29
27
  },
30
28
  );
31
29
  }
@@ -1,15 +1,20 @@
1
1
  import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { VestingOptions } from '@openzeppelin/wizard-cairo';
3
3
  import { vesting } from '@openzeppelin/wizard-cairo';
4
- import { safePrintCairoCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { cairoVestingSchema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { cairoPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
9
  export function registerCairoVesting(server: McpServer): RegisteredTool {
9
- return server.tool(
10
+ return registerWizardAppTool(
11
+ server,
10
12
  'cairo-vesting',
11
- makeDetailedPrompt(cairoPrompts.Vesting),
12
- cairoVestingSchema,
13
+ {
14
+ description: makeDetailedPrompt(cairoPrompts.Vesting),
15
+ inputSchema: cairoVestingSchema,
16
+ title: 'Cairo Vesting',
17
+ },
13
18
  async ({ name, startDate, duration, cliffDuration, schedule, info, macros }) => {
14
19
  const opts: VestingOptions = {
15
20
  name,
@@ -20,14 +25,7 @@ export function registerCairoVesting(server: McpServer): RegisteredTool {
20
25
  info,
21
26
  macros,
22
27
  };
23
- return {
24
- content: [
25
- {
26
- type: 'text',
27
- text: safePrintCairoCodeBlock(() => vesting.print(opts)),
28
- },
29
- ],
30
- };
28
+ return wizardAppPrintResult(opts, () => vesting.print(opts), 'cairo');
31
29
  },
32
30
  );
33
31
  }
@@ -1,15 +1,20 @@
1
1
  import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { ERC7984Options } from '@openzeppelin/wizard-confidential';
3
3
  import { erc7984 } from '@openzeppelin/wizard-confidential';
4
- import { safePrintSolidityCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { confidentialERC7984Schema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { confidentialPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
9
  export function registerConfidentialERC7984(server: McpServer): RegisteredTool {
9
- return server.tool(
10
- 'erc7984',
11
- makeDetailedPrompt(confidentialPrompts.ERC7984),
12
- confidentialERC7984Schema,
10
+ return registerWizardAppTool(
11
+ server,
12
+ 'confidential-erc7984',
13
+ {
14
+ description: makeDetailedPrompt(confidentialPrompts.ERC7984),
15
+ inputSchema: confidentialERC7984Schema,
16
+ title: 'Confidential ERC7984',
17
+ },
13
18
  async ({ name, symbol, contractURI, decimals, premint, networkConfig, wrappable, votes, info }) => {
14
19
  const opts: ERC7984Options = {
15
20
  name,
@@ -22,14 +27,7 @@ export function registerConfidentialERC7984(server: McpServer): RegisteredTool {
22
27
  votes,
23
28
  info,
24
29
  };
25
- return {
26
- content: [
27
- {
28
- type: 'text',
29
- text: safePrintSolidityCodeBlock(() => erc7984.print(opts)),
30
- },
31
- ],
32
- };
30
+ return wizardAppPrintResult(opts, () => erc7984.print(opts), 'solidity');
33
31
  },
34
32
  );
35
33
  }
package/src/server.ts CHANGED
@@ -14,11 +14,16 @@ export function createServer() {
14
14
  version,
15
15
  },
16
16
  {
17
+ capabilities: {
18
+ tools: {},
19
+ resources: {},
20
+ },
17
21
  instructions: `\
18
22
  Tools are provided for different smart contract languages and blockchain ecosystems.
19
23
  Each tool generates a smart contract using recommended best practices with OpenZeppelin Contracts libraries, and returns the source code. The tools do not write to disk.
20
24
  If the user requests to create a new smart contract, use the appropriate tool to generate the contract.
21
25
  If the user asks to modify an existing smart contract, use these tools to determine the recommended patterns. Toggle the options in a tool to determine how different features affect the code, then apply the same types of changes to the user's contract.
26
+ Hosts that support MCP Apps may also show an interactive Wizard UI for each tool (same options and live code preview). Non-Apps clients still receive the source as Markdown text.
22
27
  `,
23
28
  },
24
29
  );
@@ -1,15 +1,20 @@
1
1
  import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { AccountOptions } from '@openzeppelin/wizard';
3
3
  import { account } from '@openzeppelin/wizard';
4
- import { safePrintSolidityCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { solidityAccountSchema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { solidityPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
9
  export function registerSolidityAccount(server: McpServer): RegisteredTool {
9
- return server.tool(
10
+ return registerWizardAppTool(
11
+ server,
10
12
  'solidity-account',
11
- makeDetailedPrompt(solidityPrompts.Account),
12
- solidityAccountSchema,
13
+ {
14
+ description: makeDetailedPrompt(solidityPrompts.Account),
15
+ inputSchema: solidityAccountSchema,
16
+ title: 'Solidity Account',
17
+ },
13
18
  async ({
14
19
  name,
15
20
  signatureValidation,
@@ -32,14 +37,7 @@ export function registerSolidityAccount(server: McpServer): RegisteredTool {
32
37
  info,
33
38
  upgradeable,
34
39
  };
35
- return {
36
- content: [
37
- {
38
- type: 'text',
39
- text: safePrintSolidityCodeBlock(() => account.print(opts)),
40
- },
41
- ],
42
- };
40
+ return wizardAppPrintResult(opts, () => account.print(opts), 'solidity');
43
41
  },
44
42
  );
45
43
  }
@@ -1,15 +1,20 @@
1
1
  import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { CustomOptions } from '@openzeppelin/wizard';
3
3
  import { custom } from '@openzeppelin/wizard';
4
- import { safePrintSolidityCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { solidityCustomSchema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { solidityPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
9
  export function registerSolidityCustom(server: McpServer): RegisteredTool {
9
- return server.tool(
10
+ return registerWizardAppTool(
11
+ server,
10
12
  'solidity-custom',
11
- makeDetailedPrompt(solidityPrompts.Custom),
12
- solidityCustomSchema,
13
+ {
14
+ description: makeDetailedPrompt(solidityPrompts.Custom),
15
+ inputSchema: solidityCustomSchema,
16
+ title: 'Solidity Custom',
17
+ },
13
18
  async ({ name, pausable, access, upgradeable, info }) => {
14
19
  const opts: CustomOptions = {
15
20
  name,
@@ -18,14 +23,7 @@ export function registerSolidityCustom(server: McpServer): RegisteredTool {
18
23
  upgradeable,
19
24
  info,
20
25
  };
21
- return {
22
- content: [
23
- {
24
- type: 'text',
25
- text: safePrintSolidityCodeBlock(() => custom.print(opts)),
26
- },
27
- ],
28
- };
26
+ return wizardAppPrintResult(opts, () => custom.print(opts), 'solidity');
29
27
  },
30
28
  );
31
29
  }
@@ -1,16 +1,34 @@
1
1
  import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { ERC1155Options } from '@openzeppelin/wizard';
3
3
  import { erc1155 } from '@openzeppelin/wizard';
4
- import { safePrintSolidityCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { solidityERC1155Schema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { solidityPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
9
  export function registerSolidityERC1155(server: McpServer): RegisteredTool {
9
- return server.tool(
10
+ return registerWizardAppTool(
11
+ server,
10
12
  'solidity-erc1155',
11
- makeDetailedPrompt(solidityPrompts.ERC1155),
12
- solidityERC1155Schema,
13
- async ({ name, uri, burnable, pausable, mintable, supply, updatableUri, access, upgradeable, info }) => {
13
+ {
14
+ description: makeDetailedPrompt(solidityPrompts.ERC1155),
15
+ inputSchema: solidityERC1155Schema,
16
+ title: 'Solidity ERC1155',
17
+ },
18
+ async ({
19
+ name,
20
+ uri,
21
+ burnable,
22
+ pausable,
23
+ mintable,
24
+ supply,
25
+ updatableUri,
26
+ crossChainBridging,
27
+ crossChainLinkAllowOverride,
28
+ access,
29
+ upgradeable,
30
+ info,
31
+ }) => {
14
32
  const opts: ERC1155Options = {
15
33
  name,
16
34
  uri,
@@ -19,18 +37,13 @@ export function registerSolidityERC1155(server: McpServer): RegisteredTool {
19
37
  mintable,
20
38
  supply,
21
39
  updatableUri,
40
+ crossChainBridging,
41
+ crossChainLinkAllowOverride,
22
42
  access,
23
43
  upgradeable,
24
44
  info,
25
45
  };
26
- return {
27
- content: [
28
- {
29
- type: 'text',
30
- text: safePrintSolidityCodeBlock(() => erc1155.print(opts)),
31
- },
32
- ],
33
- };
46
+ return wizardAppPrintResult(opts, () => erc1155.print(opts), 'solidity');
34
47
  },
35
48
  );
36
49
  }
@@ -1,15 +1,20 @@
1
1
  import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { ERC20Options } from '@openzeppelin/wizard';
3
3
  import { erc20 } from '@openzeppelin/wizard';
4
- import { safePrintSolidityCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { solidityERC20Schema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { solidityPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
9
  export function registerSolidityERC20(server: McpServer): RegisteredTool {
9
- return server.tool(
10
+ return registerWizardAppTool(
11
+ server,
10
12
  'solidity-erc20',
11
- makeDetailedPrompt(solidityPrompts.ERC20),
12
- solidityERC20Schema,
13
+ {
14
+ description: makeDetailedPrompt(solidityPrompts.ERC20),
15
+ inputSchema: solidityERC20Schema,
16
+ title: 'Solidity ERC20',
17
+ },
13
18
  async ({
14
19
  name,
15
20
  symbol,
@@ -48,14 +53,7 @@ export function registerSolidityERC20(server: McpServer): RegisteredTool {
48
53
  upgradeable,
49
54
  info,
50
55
  };
51
- return {
52
- content: [
53
- {
54
- type: 'text',
55
- text: safePrintSolidityCodeBlock(() => erc20.print(opts)),
56
- },
57
- ],
58
- };
56
+ return wizardAppPrintResult(opts, () => erc20.print(opts), 'solidity');
59
57
  },
60
58
  );
61
59
  }
@@ -1,15 +1,20 @@
1
1
  import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { ERC721Options } from '@openzeppelin/wizard';
3
3
  import { erc721 } from '@openzeppelin/wizard';
4
- import { safePrintSolidityCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { solidityERC721Schema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { solidityPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
9
  export function registerSolidityERC721(server: McpServer): RegisteredTool {
9
- return server.tool(
10
+ return registerWizardAppTool(
11
+ server,
10
12
  'solidity-erc721',
11
- makeDetailedPrompt(solidityPrompts.ERC721),
12
- solidityERC721Schema,
13
+ {
14
+ description: makeDetailedPrompt(solidityPrompts.ERC721),
15
+ inputSchema: solidityERC721Schema,
16
+ title: 'Solidity ERC721',
17
+ },
13
18
  async ({
14
19
  name,
15
20
  symbol,
@@ -21,6 +26,8 @@ export function registerSolidityERC721(server: McpServer): RegisteredTool {
21
26
  mintable,
22
27
  incremental,
23
28
  votes,
29
+ crossChainBridging,
30
+ crossChainLinkAllowOverride,
24
31
  access,
25
32
  upgradeable,
26
33
  namespacePrefix,
@@ -37,19 +44,14 @@ export function registerSolidityERC721(server: McpServer): RegisteredTool {
37
44
  mintable,
38
45
  incremental,
39
46
  votes,
47
+ crossChainBridging,
48
+ crossChainLinkAllowOverride,
40
49
  access,
41
50
  upgradeable,
42
51
  namespacePrefix,
43
52
  info,
44
53
  };
45
- return {
46
- content: [
47
- {
48
- type: 'text',
49
- text: safePrintSolidityCodeBlock(() => erc721.print(opts)),
50
- },
51
- ],
52
- };
54
+ return wizardAppPrintResult(opts, () => erc721.print(opts), 'solidity');
53
55
  },
54
56
  );
55
57
  }
@@ -1,15 +1,20 @@
1
1
  import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { GovernorOptions } from '@openzeppelin/wizard';
3
3
  import { governor } from '@openzeppelin/wizard';
4
- import { safePrintSolidityCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { solidityGovernorSchema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { solidityPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
9
  export function registerSolidityGovernor(server: McpServer): RegisteredTool {
9
- return server.tool(
10
+ return registerWizardAppTool(
11
+ server,
10
12
  'solidity-governor',
11
- makeDetailedPrompt(solidityPrompts.Governor),
12
- solidityGovernorSchema,
13
+ {
14
+ description: makeDetailedPrompt(solidityPrompts.Governor),
15
+ inputSchema: solidityGovernorSchema,
16
+ title: 'Solidity Governor',
17
+ },
13
18
  async ({
14
19
  name,
15
20
  delay,
@@ -25,6 +30,7 @@ export function registerSolidityGovernor(server: McpServer): RegisteredTool {
25
30
  quorumAbsolute,
26
31
  storage,
27
32
  settings,
33
+ crossChainExecution,
28
34
  upgradeable,
29
35
  info,
30
36
  }) => {
@@ -43,17 +49,11 @@ export function registerSolidityGovernor(server: McpServer): RegisteredTool {
43
49
  quorumAbsolute,
44
50
  storage,
45
51
  settings,
52
+ crossChainExecution,
46
53
  upgradeable,
47
54
  info,
48
55
  };
49
- return {
50
- content: [
51
- {
52
- type: 'text',
53
- text: safePrintSolidityCodeBlock(() => governor.print(opts)),
54
- },
55
- ],
56
- };
56
+ return wizardAppPrintResult(opts, () => governor.print(opts), 'solidity');
57
57
  },
58
58
  );
59
59
  }
@@ -1,15 +1,20 @@
1
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
1
+ import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { StablecoinOptions } from '@openzeppelin/wizard';
3
3
  import { realWorldAsset } from '@openzeppelin/wizard';
4
- import { safePrintSolidityCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { solidityRWASchema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { solidityPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
- export function registerSolidityRWA(server: McpServer) {
9
- return server.tool(
9
+ export function registerSolidityRWA(server: McpServer): RegisteredTool {
10
+ return registerWizardAppTool(
11
+ server,
10
12
  'solidity-rwa',
11
- makeDetailedPrompt(solidityPrompts.RWA),
12
- solidityRWASchema,
13
+ {
14
+ description: makeDetailedPrompt(solidityPrompts.RWA),
15
+ inputSchema: solidityRWASchema,
16
+ title: 'Solidity RWA',
17
+ },
13
18
  async ({
14
19
  name,
15
20
  symbol,
@@ -50,14 +55,7 @@ export function registerSolidityRWA(server: McpServer) {
50
55
  restrictions,
51
56
  freezable,
52
57
  };
53
- return {
54
- content: [
55
- {
56
- type: 'text',
57
- text: safePrintSolidityCodeBlock(() => realWorldAsset.print(opts)),
58
- },
59
- ],
60
- };
58
+ return wizardAppPrintResult(opts, () => realWorldAsset.print(opts), 'solidity');
61
59
  },
62
60
  );
63
61
  }
@@ -1,15 +1,20 @@
1
1
  import type { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { StablecoinOptions } from '@openzeppelin/wizard';
3
3
  import { stablecoin } from '@openzeppelin/wizard';
4
- import { safePrintSolidityCodeBlock, makeDetailedPrompt } from '../../utils';
4
+ import { makeDetailedPrompt } from '../../utils';
5
5
  import { solidityStablecoinSchema } from '@openzeppelin/wizard-common/schemas';
6
6
  import { solidityPrompts } from '@openzeppelin/wizard-common';
7
+ import { registerWizardAppTool, wizardAppPrintResult } from '../../apps/register';
7
8
 
8
9
  export function registerSolidityStablecoin(server: McpServer): RegisteredTool {
9
- return server.tool(
10
+ return registerWizardAppTool(
11
+ server,
10
12
  'solidity-stablecoin',
11
- makeDetailedPrompt(solidityPrompts.Stablecoin),
12
- solidityStablecoinSchema,
13
+ {
14
+ description: makeDetailedPrompt(solidityPrompts.Stablecoin),
15
+ inputSchema: solidityStablecoinSchema,
16
+ title: 'Solidity Stablecoin',
17
+ },
13
18
  async ({
14
19
  name,
15
20
  symbol,
@@ -50,14 +55,7 @@ export function registerSolidityStablecoin(server: McpServer): RegisteredTool {
50
55
  restrictions,
51
56
  freezable,
52
57
  };
53
- return {
54
- content: [
55
- {
56
- type: 'text',
57
- text: safePrintSolidityCodeBlock(() => stablecoin.print(opts)),
58
- },
59
- ],
60
- };
58
+ return wizardAppPrintResult(opts, () => stablecoin.print(opts), 'solidity');
61
59
  },
62
60
  );
63
61
  }