Skip to content

Commit 00589bb

Browse files
authored
Add MCP server (#569)
1 parent 74770ca commit 00589bb

File tree

102 files changed

+5819
-959
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+5819
-959
lines changed

.changeset/petite-signs-spend.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@openzeppelin/wizard-cairo': minor
3+
'@openzeppelin/wizard-stellar': patch
4+
'@openzeppelin/wizard-stylus': patch
5+
'@openzeppelin/wizard-common': patch
6+
'@openzeppelin/wizard-mcp': patch
7+
---
8+
9+
Add support for Wizard MCP server.

.changeset/solidity-signs-spend.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@openzeppelin/wizard': minor
3+
---
4+
5+
Add support for Wizard MCP server.
6+
- **Possibly breaking changes**:
7+
- `Governor`: Remove usage of `access` option. This option now has no effect.

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ Contributions to OpenZeppelin Contracts Wizard are welcome. Please review the in
55

66
## Project layout
77

8+
- `packages/common` contains common code used internally by some of the below packages.
89
- `packages/core` contains the code generation logic for each language under separately named subfolders.
10+
- `packages/mcp` contains the MCP server.
911
- `packages/ui` is the interface built in Svelte.
1012

1113
## Building and testing the project
@@ -65,6 +67,29 @@ Then from the `packages/ui` directory:
6567
> [!TIP]
6668
> You can also start both the UI and API servers simultaneously by running `yarn dev` from the root directory.
6769
70+
### Testing the MCP server (Optional)
71+
72+
#### Running MCP tests
73+
From the `packages/mcp` directory:
74+
- ```yarn test```
75+
76+
#### Running the local MCP server in your IDE
77+
1. From the `packages/mcp` directory, run `yarn watch` to compile and watch for changes.
78+
2. Configure your IDE's MCP configuration file with the following, replacing `<ABSOLUTE_PATH_TO_WIZARD_PROJECT_ROOT>` with the absolute path to the root directory of this repository:
79+
```
80+
{
81+
"mcpServers": {
82+
"openzeppelin-contracts-wizard": {
83+
"command": "node",
84+
"args": [
85+
"<ABSOLUTE_PATH_TO_WIZARD_PROJECT_ROOT>/packages/mcp/dist/index.js"
86+
]
87+
}
88+
}
89+
}
90+
```
91+
3. When you make changes to the MCP server's code, refresh the MCP server in your IDE to pick up the changes.
92+
6893
## Creating Pull Requests (PRs)
6994

7095
As a contributor, we ask that you fork this repository, work on your own fork and then submit pull requests. The pull requests will be reviewed and eventually merged into the main repo. See ["Fork-a-Repo"](https://help.github.com/articles/fork-a-repo/) for how this works.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Contracts Wizard is a web application to interactively build a contract out of c
1414

1515
Use the Contracts Wizard at https://wizard.openzeppelin.com/
1616

17+
## MCP Server
18+
19+
The [MCP server](packages/mcp/README.md) allows AI agents to generate smart contracts using the Contracts Wizard.
20+
1721
## TypeScript API
1822

1923
You can use the programmatic TypeScript API to generate contracts from your own applications.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"type": "module",
55
"scripts": {
6-
"prepare": "wsrun -m prepare",
6+
"prepare": "yarn workspaces run prepare",
77
"lint": "eslint",
88
"format:write": "prettier --write \"**/*\"",
99
"format:check": "prettier --check \"**/*\"",
@@ -17,7 +17,9 @@
1717
},
1818
"workspaces": {
1919
"packages": [
20+
"packages/common",
2021
"packages/core/*",
22+
"packages/mcp",
2123
"packages/ui"
2224
],
2325
"nohoist": [
@@ -36,7 +38,6 @@
3638
"prettier-plugin-svelte": "^3.3.3",
3739
"typescript": "^5.7.3",
3840
"typescript-eslint": "^8.29.0",
39-
"wsrun": "^5.2.4",
4041
"@changesets/cli": "^2.29.2",
4142
"@changesets/changelog-github": "^0.5.1"
4243
}

packages/common/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog

0 commit comments

Comments
 (0)