mcp-new 0.1.0 → 1.2.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.
- package/README.md +206 -97
- package/dist/{chunk-QRUHMGU5.js → chunk-BHGUGEHE.js} +746 -22
- package/dist/cli.js +65 -5
- package/dist/index.d.ts +38 -7
- package/dist/index.js +14 -2
- package/package.json +1 -1
- package/templates/go/.env.example +5 -0
- package/templates/go/.gitignore.ejs +30 -0
- package/templates/go/README.md.ejs +151 -0
- package/templates/go/cmd/server/main.go.ejs +101 -0
- package/templates/go/go.mod.ejs +7 -0
- package/templates/go/internal/tools/example.go.ejs +40 -0
- package/templates/python/README.md.ejs +58 -15
- package/templates/rust/.env.example +8 -0
- package/templates/rust/.gitignore.ejs +19 -0
- package/templates/rust/Cargo.toml.ejs +18 -0
- package/templates/rust/README.md.ejs +155 -0
- package/templates/rust/src/main.rs.ejs +46 -0
- package/templates/rust/src/tools.rs.ejs +105 -0
- package/templates/typescript/README.md.ejs +56 -15
package/README.md
CHANGED
|
@@ -1,162 +1,246 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# mcp-new
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
**CLI generator for MCP servers in seconds**
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/mcp-new)
|
|
8
|
+
[](https://www.npmjs.com/package/mcp-new)
|
|
9
|
+
[](https://github.com/d1maash/mcp-new/blob/main/LICENSE)
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
npx mcp-new my-server
|
|
9
|
-
```
|
|
11
|
+
Like `create-react-app`, but for [Model Context Protocol](https://spec.modelcontextprotocol.io/) servers.
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
[Getting Started](#-getting-started) •
|
|
14
|
+
[Features](#-features) •
|
|
15
|
+
[Presets](#-presets) •
|
|
16
|
+
[Documentation](#-documentation) •
|
|
17
|
+
[Contributing](#-contributing)
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
- **TypeScript and Python** — support for both languages
|
|
15
|
-
- **OpenAPI generation** — auto-create tools from OpenAPI/Swagger specification
|
|
16
|
-
- **AI generation** — create tools from text description using Claude
|
|
17
|
-
- **Ready-to-use templates** — working code with examples out of the box
|
|
19
|
+
</div>
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## ⚡ Getting Started
|
|
20
24
|
|
|
21
25
|
```bash
|
|
22
|
-
|
|
26
|
+
npx mcp-new my-server
|
|
23
27
|
```
|
|
24
28
|
|
|
25
|
-
Or
|
|
29
|
+
Or install globally:
|
|
26
30
|
|
|
27
31
|
```bash
|
|
28
|
-
|
|
32
|
+
npm install -g mcp-new
|
|
33
|
+
mcp-new my-server
|
|
29
34
|
```
|
|
30
35
|
|
|
31
|
-
|
|
36
|
+
---
|
|
32
37
|
|
|
33
|
-
|
|
38
|
+
## ✨ Features
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
| Feature | Description |
|
|
41
|
+
|---------|-------------|
|
|
42
|
+
| 🧙 **Interactive Wizard** | Step-by-step prompts to configure your MCP server |
|
|
43
|
+
| 🌍 **Multi-Language** | TypeScript, Python, Go, and Rust support |
|
|
44
|
+
| 📦 **Preset Templates** | Ready-to-use templates for common use cases |
|
|
45
|
+
| 📄 **OpenAPI Import** | Auto-generate tools from OpenAPI/Swagger specs |
|
|
46
|
+
| 🤖 **AI Generation** | Create tools from natural language using Claude |
|
|
47
|
+
| 📚 **Rich Documentation** | Generated README with examples and Claude Desktop config |
|
|
37
48
|
|
|
38
|
-
|
|
39
|
-
# ? Project name: my-weather-api
|
|
40
|
-
# ? Select language: TypeScript
|
|
41
|
-
# ? Select transport: stdio
|
|
42
|
-
# ? Add example tool? Yes
|
|
49
|
+
---
|
|
43
50
|
|
|
44
|
-
|
|
45
|
-
cd my-weather-api
|
|
46
|
-
npm install
|
|
47
|
-
npm run dev
|
|
48
|
-
```
|
|
51
|
+
## 🎯 Presets
|
|
49
52
|
|
|
50
|
-
|
|
53
|
+
Skip the setup and start with pre-configured tools:
|
|
51
54
|
|
|
52
55
|
```bash
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
mcp-new my-project --preset <name> -y
|
|
57
|
+
```
|
|
55
58
|
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
| Preset | Description | Included Tools |
|
|
60
|
+
|--------|-------------|----------------|
|
|
61
|
+
| `database` | Database CRUD operations | `query` `insert` `update` `delete` `list_tables` |
|
|
62
|
+
| `rest-api` | HTTP client wrapper | `http_get` `http_post` `http_put` `http_delete` `set_base_url` |
|
|
63
|
+
| `filesystem` | File system operations | `read_file` `write_file` `list_directory` `search_files` `file_info` |
|
|
58
64
|
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
<details>
|
|
66
|
+
<summary>📋 Example: Database preset</summary>
|
|
61
67
|
|
|
62
|
-
|
|
63
|
-
|
|
68
|
+
```bash
|
|
69
|
+
mcp-new my-db --preset database -t -y
|
|
64
70
|
```
|
|
65
71
|
|
|
66
|
-
|
|
72
|
+
Creates a TypeScript MCP server with these tools ready to implement:
|
|
73
|
+
|
|
74
|
+
- **query** — Execute SQL queries with parameters
|
|
75
|
+
- **insert** — Insert records into tables
|
|
76
|
+
- **update** — Update existing records
|
|
77
|
+
- **delete** — Delete records from tables
|
|
78
|
+
- **list_tables** — List all database tables
|
|
79
|
+
|
|
80
|
+
</details>
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 🚀 Usage
|
|
85
|
+
|
|
86
|
+
### Basic Creation
|
|
67
87
|
|
|
68
88
|
```bash
|
|
69
|
-
|
|
89
|
+
# Interactive mode
|
|
90
|
+
mcp-new my-server
|
|
91
|
+
|
|
92
|
+
# With language flag
|
|
93
|
+
mcp-new my-server -t # TypeScript
|
|
94
|
+
mcp-new my-server -p # Python
|
|
95
|
+
mcp-new my-server -g # Go
|
|
96
|
+
mcp-new my-server -r # Rust
|
|
70
97
|
|
|
71
|
-
#
|
|
98
|
+
# Skip prompts with defaults
|
|
99
|
+
mcp-new my-server -t -y
|
|
72
100
|
```
|
|
73
101
|
|
|
74
|
-
### From
|
|
102
|
+
### From OpenAPI Specification
|
|
75
103
|
|
|
76
104
|
```bash
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
# Describe your API in the editor
|
|
80
|
-
# Claude will generate tools automatically
|
|
105
|
+
mcp-new my-api --from-openapi ./openapi.yaml
|
|
81
106
|
```
|
|
82
107
|
|
|
83
|
-
|
|
108
|
+
Select which endpoints to include as MCP tools.
|
|
84
109
|
|
|
85
|
-
###
|
|
110
|
+
### From AI Description
|
|
86
111
|
|
|
87
112
|
```bash
|
|
88
|
-
|
|
89
|
-
|
|
113
|
+
export ANTHROPIC_API_KEY=your-key
|
|
114
|
+
mcp-new my-server --from-prompt
|
|
90
115
|
```
|
|
91
116
|
|
|
92
|
-
|
|
117
|
+
Describe your API in natural language, Claude generates the tools.
|
|
118
|
+
|
|
119
|
+
### Additional Commands
|
|
93
120
|
|
|
94
121
|
```bash
|
|
95
|
-
|
|
96
|
-
|
|
122
|
+
# Initialize in existing directory
|
|
123
|
+
mcp-new init
|
|
124
|
+
|
|
125
|
+
# Add a new tool to existing project
|
|
126
|
+
mcp-new add-tool
|
|
97
127
|
```
|
|
98
128
|
|
|
99
|
-
|
|
129
|
+
---
|
|
100
130
|
|
|
101
|
-
|
|
102
|
-
|---------|-------------|
|
|
103
|
-
| `mcp-new <name>` | Create new MCP server |
|
|
104
|
-
| `mcp-new init` | Initialize MCP in current directory |
|
|
105
|
-
| `mcp-new add-tool` | Add tool to existing server |
|
|
131
|
+
## 📖 Documentation
|
|
106
132
|
|
|
107
|
-
|
|
133
|
+
### CLI Reference
|
|
108
134
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
135
|
+
```
|
|
136
|
+
Usage: mcp-new [options] [command] [project-name]
|
|
137
|
+
|
|
138
|
+
Options:
|
|
139
|
+
-t, --typescript Use TypeScript
|
|
140
|
+
-p, --python Use Python
|
|
141
|
+
-g, --go Use Go
|
|
142
|
+
-r, --rust Use Rust
|
|
143
|
+
--preset <name> Use preset (database, rest-api, filesystem)
|
|
144
|
+
--from-openapi <path> Generate from OpenAPI spec
|
|
145
|
+
--from-prompt Generate using AI
|
|
146
|
+
--skip-install Skip dependency installation
|
|
147
|
+
-y, --yes Use defaults
|
|
148
|
+
-V, --version Show version
|
|
149
|
+
-h, --help Show help
|
|
150
|
+
|
|
151
|
+
Commands:
|
|
152
|
+
init Initialize in current directory
|
|
153
|
+
add-tool Add tool to existing project
|
|
154
|
+
```
|
|
117
155
|
|
|
118
|
-
|
|
156
|
+
### Generated Project Structure
|
|
119
157
|
|
|
120
|
-
|
|
158
|
+
<details>
|
|
159
|
+
<summary>TypeScript</summary>
|
|
121
160
|
|
|
122
161
|
```
|
|
123
162
|
my-server/
|
|
163
|
+
├── src/
|
|
164
|
+
│ └── index.ts
|
|
124
165
|
├── package.json
|
|
125
166
|
├── tsconfig.json
|
|
126
167
|
├── README.md
|
|
127
168
|
├── .gitignore
|
|
128
|
-
|
|
129
|
-
└── src/
|
|
130
|
-
├── index.ts # Main server file
|
|
131
|
-
└── tools/
|
|
132
|
-
└── example-tool.ts
|
|
169
|
+
└── .env.example
|
|
133
170
|
```
|
|
134
171
|
|
|
135
|
-
|
|
172
|
+
</details>
|
|
173
|
+
|
|
174
|
+
<details>
|
|
175
|
+
<summary>Python</summary>
|
|
136
176
|
|
|
137
177
|
```
|
|
138
178
|
my-server/
|
|
179
|
+
├── src/
|
|
180
|
+
│ ├── __init__.py
|
|
181
|
+
│ ├── server.py
|
|
182
|
+
│ └── tools/
|
|
183
|
+
│ └── __init__.py
|
|
139
184
|
├── pyproject.toml
|
|
140
185
|
├── requirements.txt
|
|
141
186
|
├── README.md
|
|
142
187
|
├── .gitignore
|
|
143
|
-
|
|
144
|
-
└── src/
|
|
145
|
-
├── __init__.py
|
|
146
|
-
├── server.py # Main server file
|
|
147
|
-
└── tools/
|
|
148
|
-
├── __init__.py
|
|
149
|
-
└── example_tool.py
|
|
188
|
+
└── .env.example
|
|
150
189
|
```
|
|
151
190
|
|
|
152
|
-
|
|
191
|
+
</details>
|
|
192
|
+
|
|
193
|
+
<details>
|
|
194
|
+
<summary>Go</summary>
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
my-server/
|
|
198
|
+
├── cmd/
|
|
199
|
+
│ └── server/
|
|
200
|
+
│ └── main.go
|
|
201
|
+
├── internal/
|
|
202
|
+
│ └── tools/
|
|
203
|
+
├── go.mod
|
|
204
|
+
├── README.md
|
|
205
|
+
├── .gitignore
|
|
206
|
+
└── .env.example
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
</details>
|
|
210
|
+
|
|
211
|
+
<details>
|
|
212
|
+
<summary>Rust</summary>
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
my-server/
|
|
216
|
+
├── src/
|
|
217
|
+
│ ├── main.rs
|
|
218
|
+
│ └── tools.rs
|
|
219
|
+
├── Cargo.toml
|
|
220
|
+
├── README.md
|
|
221
|
+
├── .gitignore
|
|
222
|
+
└── .env.example
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
</details>
|
|
226
|
+
|
|
227
|
+
### Generated README
|
|
228
|
+
|
|
229
|
+
Each project includes a detailed README with:
|
|
230
|
+
|
|
231
|
+
- ✅ Parameter tables for each tool
|
|
232
|
+
- ✅ JSON examples for tool calls
|
|
233
|
+
- ✅ Claude Desktop configuration snippet
|
|
234
|
+
- ✅ Project structure overview
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## 🛠 Development
|
|
153
239
|
|
|
154
240
|
```bash
|
|
155
|
-
# Clone
|
|
241
|
+
# Clone and install
|
|
156
242
|
git clone https://github.com/d1maash/mcp-new.git
|
|
157
243
|
cd mcp-new
|
|
158
|
-
|
|
159
|
-
# Install dependencies
|
|
160
244
|
npm install
|
|
161
245
|
|
|
162
246
|
# Development
|
|
@@ -165,20 +249,45 @@ npm run dev
|
|
|
165
249
|
# Build
|
|
166
250
|
npm run build
|
|
167
251
|
|
|
168
|
-
#
|
|
169
|
-
npm test
|
|
170
|
-
|
|
171
|
-
# Local CLI testing
|
|
252
|
+
# Test locally
|
|
172
253
|
npm link
|
|
173
|
-
mcp-new test-project
|
|
254
|
+
mcp-new test-project --preset database -t -y
|
|
174
255
|
```
|
|
175
256
|
|
|
176
|
-
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 🔗 Resources
|
|
177
260
|
|
|
178
261
|
- [MCP Specification](https://spec.modelcontextprotocol.io/)
|
|
179
|
-
- [
|
|
180
|
-
- [
|
|
262
|
+
- [TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)
|
|
263
|
+
- [Python SDK](https://github.com/modelcontextprotocol/python-sdk)
|
|
264
|
+
- [Go SDK](https://github.com/mark3labs/mcp-go)
|
|
265
|
+
- [Rust SDK](https://github.com/modelcontextprotocol/rust-sdk)
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## 🤝 Contributing
|
|
270
|
+
|
|
271
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
272
|
+
|
|
273
|
+
1. Fork the repository
|
|
274
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
275
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
276
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
277
|
+
5. Open a Pull Request
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## 📄 License
|
|
282
|
+
|
|
283
|
+
MIT © [Dinmukhanbet Aizharykov](https://github.com/d1maash)
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
<div align="center">
|
|
288
|
+
|
|
289
|
+
**[⬆ Back to top](#mcp-new)**
|
|
181
290
|
|
|
182
|
-
|
|
291
|
+
Made with ❤️ for the MCP community
|
|
183
292
|
|
|
184
|
-
|
|
293
|
+
</div>
|