@titikaka2026/mcptools 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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +328 -0
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +17 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/commands/create.d.ts +3 -0
  8. package/dist/commands/create.d.ts.map +1 -0
  9. package/dist/commands/create.js +564 -0
  10. package/dist/commands/create.js.map +1 -0
  11. package/dist/commands/inspect.d.ts +3 -0
  12. package/dist/commands/inspect.d.ts.map +1 -0
  13. package/dist/commands/inspect.js +140 -0
  14. package/dist/commands/inspect.js.map +1 -0
  15. package/dist/commands/test.d.ts +3 -0
  16. package/dist/commands/test.d.ts.map +1 -0
  17. package/dist/commands/test.js +125 -0
  18. package/dist/commands/test.js.map +1 -0
  19. package/dist/commands/wrap.d.ts +3 -0
  20. package/dist/commands/wrap.d.ts.map +1 -0
  21. package/dist/commands/wrap.js +114 -0
  22. package/dist/commands/wrap.js.map +1 -0
  23. package/dist/core/client.d.ts +21 -0
  24. package/dist/core/client.d.ts.map +1 -0
  25. package/dist/core/client.js +144 -0
  26. package/dist/core/client.js.map +1 -0
  27. package/dist/core/validator.d.ts +13 -0
  28. package/dist/core/validator.d.ts.map +1 -0
  29. package/dist/core/validator.js +120 -0
  30. package/dist/core/validator.js.map +1 -0
  31. package/dist/core/wrap-cli.d.ts +3 -0
  32. package/dist/core/wrap-cli.d.ts.map +1 -0
  33. package/dist/core/wrap-cli.js +144 -0
  34. package/dist/core/wrap-cli.js.map +1 -0
  35. package/dist/core/wrap-rest.d.ts +4 -0
  36. package/dist/core/wrap-rest.d.ts.map +1 -0
  37. package/dist/core/wrap-rest.js +157 -0
  38. package/dist/core/wrap-rest.js.map +1 -0
  39. package/dist/index.d.ts +6 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +5 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/types.d.ts +93 -0
  44. package/dist/types.d.ts.map +1 -0
  45. package/dist/types.js +2 -0
  46. package/dist/types.js.map +1 -0
  47. package/package.json +62 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 mcptools contributors
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,328 @@
1
+ <div align="center">
2
+
3
+ # mcptools
4
+
5
+ ### The Swiss Army knife for MCP (Model Context Protocol)
6
+
7
+ Create, test, inspect, and wrap MCP servers with ease.
8
+
9
+ [![npm version](https://img.shields.io/npm/v/mcptools.svg?style=flat-square)](https://www.npmjs.com/package/mcptools)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
11
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg?style=flat-square)](https://nodejs.org)
12
+ [![GitHub stars](https://img.shields.io/github/stars/titikaka2024/mcptools?style=flat-square)](https://github.com/titikaka2024/mcptools/stargazers)
13
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/titikaka2024/mcptools/pulls)
14
+
15
+ [Getting Started](#quick-start) | [Commands](#commands) | [API](#programmatic-api) | [Examples](#examples) | [Contributing](#contributing)
16
+
17
+ </div>
18
+
19
+ ---
20
+
21
+ MCP is the open protocol that lets AI assistants (Claude, GPT, etc.) call external tools, read data, and interact with the world. **mcptools** makes building and debugging MCP servers fast and painless.
22
+
23
+ ## Why mcptools?
24
+
25
+ Building MCP servers today means writing boilerplate JSON-RPC handling, manually testing with `echo | node`, and guessing why your server isn't connecting. mcptools fixes all of that:
26
+
27
+ - **`mcptools create`** — Scaffold a new MCP server in seconds (TypeScript or Python)
28
+ - **`mcptools test`** — Connect to any MCP server and verify it works
29
+ - **`mcptools inspect`** — Watch all JSON-RPC messages in real-time
30
+ - **`mcptools wrap rest`** — Turn any REST API into an MCP server automatically
31
+ - **`mcptools wrap cli`** — Turn any CLI tool into an MCP server automatically
32
+
33
+ ## Quick Start
34
+
35
+ ```bash
36
+ # Install globally
37
+ npm install -g mcptools
38
+
39
+ # Create a new MCP server
40
+ mcptools create my-server
41
+
42
+ # Build and test it
43
+ cd my-server
44
+ npm install && npm run build
45
+ mcptools test --command "node dist/index.js"
46
+ ```
47
+
48
+ ## Installation
49
+
50
+ ```bash
51
+ npm install -g mcptools
52
+ ```
53
+
54
+ Or use with npx:
55
+
56
+ ```bash
57
+ npx mcptools create my-server
58
+ ```
59
+
60
+ ## Commands
61
+
62
+ ### `mcptools create <name>`
63
+
64
+ Scaffold a new MCP server project with everything you need.
65
+
66
+ ```bash
67
+ # Basic TypeScript server
68
+ mcptools create my-server
69
+
70
+ # Server with multiple tools
71
+ mcptools create my-server --template tools
72
+
73
+ # Server with resources
74
+ mcptools create my-server --template resources
75
+
76
+ # Python server
77
+ mcptools create my-server --language python
78
+ ```
79
+
80
+ **Templates:**
81
+ | Template | Description |
82
+ |----------|-------------|
83
+ | `basic` | Simple server with one tool (default) |
84
+ | `tools` | Server with multiple tools and proper typing |
85
+ | `resources` | Server exposing resources |
86
+
87
+ ### `mcptools test`
88
+
89
+ Connect to an MCP server and verify it responds correctly.
90
+
91
+ ```bash
92
+ # Test a local server
93
+ mcptools test --command "node dist/index.js"
94
+
95
+ # Test with validation
96
+ mcptools test --command "node dist/index.js" --validate
97
+
98
+ # Output as JSON (for CI/CD)
99
+ mcptools test --command "node dist/index.js" --json
100
+ ```
101
+
102
+ **Output includes:**
103
+ - List of all tools, resources, and prompts
104
+ - Input schema details for each tool
105
+ - Validation errors and warnings (with `--validate`)
106
+ - Machine-readable JSON (with `--json`)
107
+
108
+ ### `mcptools inspect`
109
+
110
+ Debug MCP communication by watching all JSON-RPC messages flowing between client and server.
111
+
112
+ ```bash
113
+ # Inspect server communication
114
+ mcptools inspect --command "node dist/index.js"
115
+
116
+ # Show raw JSON messages
117
+ mcptools inspect --command "node dist/index.js" --raw
118
+ ```
119
+
120
+ **Output shows:**
121
+ - Timestamped messages with direction arrows
122
+ - Method names, request IDs, and parameters
123
+ - Server capabilities and tool counts
124
+ - Errors highlighted in red
125
+
126
+ ### `mcptools wrap rest`
127
+
128
+ Automatically generate an MCP server from a REST API definition.
129
+
130
+ ```bash
131
+ mcptools wrap rest --config api.json --output ./generated
132
+ ```
133
+
134
+ **Config format (`api.json`):**
135
+ ```json
136
+ {
137
+ "name": "my-api",
138
+ "baseUrl": "https://api.example.com",
139
+ "endpoints": [
140
+ {
141
+ "method": "GET",
142
+ "path": "/users/{id}",
143
+ "name": "get_user",
144
+ "description": "Get a user by ID",
145
+ "parameters": [
146
+ {
147
+ "name": "id",
148
+ "type": "string",
149
+ "description": "User ID",
150
+ "required": true,
151
+ "in": "path"
152
+ }
153
+ ]
154
+ }
155
+ ]
156
+ }
157
+ ```
158
+
159
+ ### `mcptools wrap cli`
160
+
161
+ Turn any CLI tool into an MCP server.
162
+
163
+ ```bash
164
+ mcptools wrap cli --config cli.json --output ./generated
165
+ ```
166
+
167
+ **Config format (`cli.json`):**
168
+ ```json
169
+ {
170
+ "name": "my-tool",
171
+ "command": "mytool",
172
+ "description": "My CLI tool as an MCP server",
173
+ "subcommands": [
174
+ {
175
+ "name": "list",
176
+ "description": "List all items",
177
+ "args": [
178
+ {
179
+ "name": "format",
180
+ "type": "string",
181
+ "description": "Output format (json, table)",
182
+ "required": false
183
+ }
184
+ ]
185
+ }
186
+ ]
187
+ }
188
+ ```
189
+
190
+ ## Programmatic API
191
+
192
+ Use mcptools as a library in your own projects:
193
+
194
+ ```typescript
195
+ import { McpClient, McpValidator } from "mcptools";
196
+
197
+ // Connect to an MCP server
198
+ const client = new McpClient({
199
+ name: "my-server",
200
+ command: "node",
201
+ args: ["server.js"],
202
+ });
203
+
204
+ await client.connect();
205
+
206
+ // List available tools
207
+ const tools = await client.listTools();
208
+ console.log("Tools:", tools);
209
+
210
+ // Call a tool
211
+ const result = await client.callTool("hello", { name: "World" });
212
+ console.log("Result:", result);
213
+
214
+ // Validate a tool definition
215
+ const validator = new McpValidator();
216
+ const validation = validator.validateToolDefinition(tools[0]);
217
+ console.log("Valid:", validation.valid);
218
+
219
+ await client.disconnect();
220
+ ```
221
+
222
+ ## Examples
223
+
224
+ ### Create and test a server in 60 seconds
225
+
226
+ ```bash
227
+ mcptools create hello-world
228
+ cd hello-world
229
+ npm install && npm run build
230
+ mcptools test --command "node dist/index.js"
231
+ ```
232
+
233
+ ### Wrap the GitHub API
234
+
235
+ ```json
236
+ {
237
+ "name": "github-mcp",
238
+ "baseUrl": "https://api.github.com",
239
+ "endpoints": [
240
+ {
241
+ "method": "GET",
242
+ "path": "/repos/{owner}/{repo}",
243
+ "name": "get_repo",
244
+ "description": "Get repository information",
245
+ "parameters": [
246
+ { "name": "owner", "type": "string", "required": true, "in": "path", "description": "Repository owner" },
247
+ { "name": "repo", "type": "string", "required": true, "in": "path", "description": "Repository name" }
248
+ ]
249
+ },
250
+ {
251
+ "method": "GET",
252
+ "path": "/repos/{owner}/{repo}/issues",
253
+ "name": "list_issues",
254
+ "description": "List repository issues",
255
+ "parameters": [
256
+ { "name": "owner", "type": "string", "required": true, "in": "path", "description": "Repository owner" },
257
+ { "name": "repo", "type": "string", "required": true, "in": "path", "description": "Repository name" },
258
+ { "name": "state", "type": "string", "required": false, "in": "query", "description": "Filter by state: open, closed, all" }
259
+ ]
260
+ }
261
+ ]
262
+ }
263
+ ```
264
+
265
+ ```bash
266
+ mcptools wrap rest --config github-api.json
267
+ mcptools test --command "node github-mcp-mcp-server.mjs"
268
+ ```
269
+
270
+ ### Use with Claude Desktop
271
+
272
+ After building your MCP server, add it to Claude Desktop's config:
273
+
274
+ **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
275
+ **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
276
+
277
+ ```json
278
+ {
279
+ "mcpServers": {
280
+ "my-server": {
281
+ "command": "node",
282
+ "args": ["/path/to/my-server/dist/index.js"]
283
+ }
284
+ }
285
+ }
286
+ ```
287
+
288
+ ## Why mcptools vs. building from scratch?
289
+
290
+ | Feature | From Scratch | mcptools |
291
+ |---------|:---:|:---:|
292
+ | Project scaffolding | Manual setup | `mcptools create` in 5 seconds |
293
+ | Protocol compliance | Read the spec yourself | Built-in validator |
294
+ | Testing | `echo '{}' \| node server.js` | `mcptools test --validate` |
295
+ | Debugging | `console.log` everywhere | `mcptools inspect` with live view |
296
+ | Wrap existing APIs | Write hundreds of lines | One JSON config file |
297
+ | TypeScript + Python | DIY | Templates for both |
298
+
299
+ ## Roadmap
300
+
301
+ - [ ] SSE transport support
302
+ - [ ] OpenAPI → MCP auto-conversion (import Swagger/OpenAPI specs directly)
303
+ - [ ] MCP server registry (discover and install community servers)
304
+ - [ ] Visual inspector (web-based MCP debugger UI)
305
+ - [ ] `mcptools bench` — performance benchmarking for MCP servers
306
+ - [ ] Plugin system for custom templates
307
+
308
+ ## Contributing
309
+
310
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
311
+
312
+ ```bash
313
+ git clone https://github.com/titikaka2024/mcptools.git
314
+ cd mcptools
315
+ npm install
316
+ npm run build
317
+ npm test
318
+ ```
319
+
320
+ ## Star History
321
+
322
+ If you find this useful, please star the repo — it helps others discover mcptools!
323
+
324
+ [![Star History Chart](https://api.star-history.com/svg?repos=titikaka2024/mcptools&type=Date)](https://star-history.com/#titikaka2024/mcptools&Date)
325
+
326
+ ## License
327
+
328
+ MIT
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from "commander";
3
+ import { createCommand } from "./commands/create.js";
4
+ import { testCommand } from "./commands/test.js";
5
+ import { inspectCommand } from "./commands/inspect.js";
6
+ import { wrapCommand } from "./commands/wrap.js";
7
+ const program = new Command();
8
+ program
9
+ .name("mcptools")
10
+ .description("The Swiss Army knife for MCP (Model Context Protocol) — create, test, inspect, and wrap MCP servers with ease.")
11
+ .version("0.1.0");
12
+ program.addCommand(createCommand);
13
+ program.addCommand(testCommand);
14
+ program.addCommand(inspectCommand);
15
+ program.addCommand(wrapCommand);
16
+ program.parse();
17
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CACV,gHAAgH,CACjH;KACA,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAEhC,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const createCommand: Command;
3
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,aAAa,SA2CtB,CAAC"}