mcp-new 0.1.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/LICENSE +21 -0
- package/README.md +184 -0
- package/bin/mcp-new.js +3 -0
- package/dist/chunk-QRUHMGU5.js +1540 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +25 -0
- package/dist/index.d.ts +516 -0
- package/dist/index.js +351 -0
- package/package.json +73 -0
- package/templates/python/.env.example +8 -0
- package/templates/python/.gitignore.ejs +37 -0
- package/templates/python/README.md.ejs +78 -0
- package/templates/python/pyproject.toml.ejs +20 -0
- package/templates/python/requirements.txt.ejs +1 -0
- package/templates/python/src/__init__.py.ejs +3 -0
- package/templates/python/src/server.py.ejs +98 -0
- package/templates/python/src/tools/__init__.py.ejs +1 -0
- package/templates/python/src/tools/example_tool.py.ejs +47 -0
- package/templates/typescript/.env.example +8 -0
- package/templates/typescript/.gitignore.ejs +22 -0
- package/templates/typescript/README.md.ejs +78 -0
- package/templates/typescript/package.json.ejs +29 -0
- package/templates/typescript/src/index.ts.ejs +121 -0
- package/templates/typescript/src/tools/example-tool.ts.ejs +36 -0
- package/templates/typescript/tsconfig.json.ejs +19 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# mcp-new
|
|
2
|
+
|
|
3
|
+
> CLI generator for MCP servers in seconds. Like `create-react-app`, but for MCP.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx mcp-new my-server
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Interactive wizard** — create MCP server through step-by-step prompts
|
|
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
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install -g mcp-new
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or use directly via npx:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx mcp-new my-server
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
### Basic creation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx mcp-new my-weather-api
|
|
37
|
+
|
|
38
|
+
# Answer the questions:
|
|
39
|
+
# ? Project name: my-weather-api
|
|
40
|
+
# ? Select language: TypeScript
|
|
41
|
+
# ? Select transport: stdio
|
|
42
|
+
# ? Add example tool? Yes
|
|
43
|
+
|
|
44
|
+
# Done!
|
|
45
|
+
cd my-weather-api
|
|
46
|
+
npm install
|
|
47
|
+
npm run dev
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### With flags
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# TypeScript project (skips language prompt)
|
|
54
|
+
npx mcp-new my-server -t
|
|
55
|
+
|
|
56
|
+
# Python project (skips language prompt)
|
|
57
|
+
npx mcp-new my-server -p
|
|
58
|
+
|
|
59
|
+
# Skip dependency installation
|
|
60
|
+
npx mcp-new my-server --skip-install
|
|
61
|
+
|
|
62
|
+
# Use default values
|
|
63
|
+
npx mcp-new my-server -y
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### From OpenAPI specification
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npx mcp-new stripe-mcp --from-openapi ./stripe-api.yaml
|
|
70
|
+
|
|
71
|
+
# CLI will show found endpoints and let you select the ones you need
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### From text description (AI)
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx mcp-new notion-mcp --from-prompt
|
|
78
|
+
|
|
79
|
+
# Describe your API in the editor
|
|
80
|
+
# Claude will generate tools automatically
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Requires `ANTHROPIC_API_KEY` environment variable.
|
|
84
|
+
|
|
85
|
+
### Initialize in existing project
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
cd my-existing-project
|
|
89
|
+
npx mcp-new init
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Add new tool
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
cd my-mcp-server
|
|
96
|
+
npx mcp-new add-tool
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## CLI Commands
|
|
100
|
+
|
|
101
|
+
| Command | Description |
|
|
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 |
|
|
106
|
+
|
|
107
|
+
## Options
|
|
108
|
+
|
|
109
|
+
| Flag | Description |
|
|
110
|
+
|------|-------------|
|
|
111
|
+
| `-t, --typescript` | Use TypeScript (skips language prompt) |
|
|
112
|
+
| `-p, --python` | Use Python (skips language prompt) |
|
|
113
|
+
| `--skip-install` | Skip dependency installation |
|
|
114
|
+
| `--from-openapi <path>` | Create from OpenAPI specification |
|
|
115
|
+
| `--from-prompt` | Create via AI from description |
|
|
116
|
+
| `-y, --yes` | Use default values |
|
|
117
|
+
|
|
118
|
+
## Generated Project Structure
|
|
119
|
+
|
|
120
|
+
### TypeScript
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
my-server/
|
|
124
|
+
├── package.json
|
|
125
|
+
├── tsconfig.json
|
|
126
|
+
├── README.md
|
|
127
|
+
├── .gitignore
|
|
128
|
+
├── .env.example
|
|
129
|
+
└── src/
|
|
130
|
+
├── index.ts # Main server file
|
|
131
|
+
└── tools/
|
|
132
|
+
└── example-tool.ts
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Python
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
my-server/
|
|
139
|
+
├── pyproject.toml
|
|
140
|
+
├── requirements.txt
|
|
141
|
+
├── README.md
|
|
142
|
+
├── .gitignore
|
|
143
|
+
├── .env.example
|
|
144
|
+
└── src/
|
|
145
|
+
├── __init__.py
|
|
146
|
+
├── server.py # Main server file
|
|
147
|
+
└── tools/
|
|
148
|
+
├── __init__.py
|
|
149
|
+
└── example_tool.py
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Development
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# Clone repository
|
|
156
|
+
git clone https://github.com/d1maash/mcp-new.git
|
|
157
|
+
cd mcp-new
|
|
158
|
+
|
|
159
|
+
# Install dependencies
|
|
160
|
+
npm install
|
|
161
|
+
|
|
162
|
+
# Development
|
|
163
|
+
npm run dev
|
|
164
|
+
|
|
165
|
+
# Build
|
|
166
|
+
npm run build
|
|
167
|
+
|
|
168
|
+
# Tests
|
|
169
|
+
npm test
|
|
170
|
+
|
|
171
|
+
# Local CLI testing
|
|
172
|
+
npm link
|
|
173
|
+
mcp-new test-project
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Links
|
|
177
|
+
|
|
178
|
+
- [MCP Specification](https://spec.modelcontextprotocol.io/)
|
|
179
|
+
- [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)
|
|
180
|
+
- [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk)
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
MIT
|
package/bin/mcp-new.js
ADDED