@donkeylabs/mcp 0.4.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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +131 -0
  3. package/package.json +53 -0
  4. package/src/server.ts +2524 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 DonkeyLabs
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,131 @@
1
+ # @donkeylabs/mcp
2
+
3
+ MCP (Model Context Protocol) server for AI-assisted development with `@donkeylabs/server`.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ bun add @donkeylabs/mcp
9
+ ```
10
+
11
+ ## Configuration
12
+
13
+ Add to your Claude Code MCP settings (`.mcp.json` or IDE settings):
14
+
15
+ ```json
16
+ {
17
+ "mcpServers": {
18
+ "donkeylabs": {
19
+ "command": "bun",
20
+ "args": ["node_modules/@donkeylabs/mcp/src/server.ts"]
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ Or if using from the monorepo:
27
+
28
+ ```json
29
+ {
30
+ "mcpServers": {
31
+ "donkeylabs": {
32
+ "command": "bun",
33
+ "args": ["packages/mcp/src/server.ts"]
34
+ }
35
+ }
36
+ }
37
+ ```
38
+
39
+ ## Available Tools
40
+
41
+ | Tool | Description |
42
+ |------|-------------|
43
+ | `create_plugin` | Create a new plugin with correct directory structure and files |
44
+ | `add_route` | Add a route to a router with proper typing |
45
+ | `add_migration` | Create a numbered migration file for a plugin |
46
+ | `add_service_method` | Add a method to a plugin's service |
47
+ | `generate_types` | Run type generation (registry, context, client) |
48
+ | `list_plugins` | List all plugins with their service methods |
49
+ | `get_project_info` | Get project structure information |
50
+
51
+ ## Tool Details
52
+
53
+ ### create_plugin
54
+
55
+ Creates a new plugin with the correct directory structure:
56
+
57
+ ```
58
+ src/plugins/<name>/
59
+ ├── index.ts # Plugin definition
60
+ ├── schema.ts # Database types (if hasSchema: true)
61
+ └── migrations/ # SQL migrations (if hasSchema: true)
62
+ ```
63
+
64
+ **Parameters:**
65
+ - `name` (required): Plugin name in camelCase
66
+ - `hasSchema` (optional): Whether the plugin needs a database schema
67
+ - `dependencies` (optional): Names of plugins this plugin depends on
68
+
69
+ ### add_route
70
+
71
+ Adds a new route to an existing router file with proper TypeScript typing.
72
+
73
+ **Parameters:**
74
+ - `routerFile` (required): Path to the router file
75
+ - `routeName` (required): Route name (appended to router namespace)
76
+ - `handler` (required): Handler code (the async function body)
77
+ - `inputSchema` (optional): Zod schema for input validation
78
+ - `outputType` (optional): TypeScript type for output
79
+
80
+ ### add_migration
81
+
82
+ Creates a numbered migration file for a plugin.
83
+
84
+ **Parameters:**
85
+ - `pluginName` (required): Name of the plugin
86
+ - `migrationName` (required): Descriptive name (e.g., `create_users`)
87
+ - `upSql` (required): SQL for the up migration
88
+ - `downSql` (optional): SQL for the down migration
89
+
90
+ ### add_service_method
91
+
92
+ Adds a method to a plugin's service.
93
+
94
+ **Parameters:**
95
+ - `pluginName` (required): Name of the plugin
96
+ - `methodName` (required): Name of the method
97
+ - `implementation` (required): Method implementation code
98
+ - `params` (optional): Method parameters (e.g., `userId: string, data: Data`)
99
+ - `returnType` (optional): Return type (e.g., `Promise<User>`)
100
+
101
+ ### generate_types
102
+
103
+ Runs type generation for the project.
104
+
105
+ **Parameters:**
106
+ - `target` (optional): What to generate - `all`, `registry`, `context`, or `client`
107
+
108
+ ### list_plugins
109
+
110
+ Lists all plugins in the project with their service methods.
111
+
112
+ ### get_project_info
113
+
114
+ Returns project structure information including:
115
+ - Project root path
116
+ - Config file location
117
+ - Plugins directory
118
+ - Output directory
119
+ - Available plugins
120
+
121
+ ## Documentation
122
+
123
+ For detailed documentation on `@donkeylabs/server`, see:
124
+
125
+ - [Plugins](https://github.com/donkeylabs/server/blob/main/packages/server/docs/plugins.md)
126
+ - [Router](https://github.com/donkeylabs/server/blob/main/packages/server/docs/router.md)
127
+ - [CLI](https://github.com/donkeylabs/server/blob/main/packages/server/docs/cli.md)
128
+
129
+ ## License
130
+
131
+ MIT
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@donkeylabs/mcp",
3
+ "version": "0.4.0",
4
+ "description": "MCP server for AI-assisted development with @donkeylabs/server",
5
+ "type": "module",
6
+ "main": "./src/server.ts",
7
+ "types": "./src/server.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./src/server.ts",
11
+ "import": "./src/server.ts"
12
+ }
13
+ },
14
+ "bin": {
15
+ "donkeylabs-mcp": "./src/server.ts"
16
+ },
17
+ "files": [
18
+ "src",
19
+ "LICENSE",
20
+ "README.md"
21
+ ],
22
+ "scripts": {
23
+ "start": "bun run src/server.ts"
24
+ },
25
+ "dependencies": {
26
+ "@modelcontextprotocol/sdk": "^1.0.0"
27
+ },
28
+ "devDependencies": {
29
+ "@anthropic-ai/claude-agent-sdk": "^0.2.9",
30
+ "@anthropic-ai/claude-code": "^2.1.9",
31
+ "@anthropic-ai/sdk": "^0.71.2",
32
+ "bun-types": "latest",
33
+ "typescript": "^5.0.0",
34
+ "zod": "^4.3.5"
35
+ },
36
+ "peerDependencies": {
37
+ "@donkeylabs/server": "^0.4.0"
38
+ },
39
+ "keywords": [
40
+ "mcp",
41
+ "model-context-protocol",
42
+ "ai",
43
+ "donkeylabs",
44
+ "plugin",
45
+ "code-generation"
46
+ ],
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "https://github.com/donkeylabs/server",
50
+ "directory": "packages/mcp"
51
+ },
52
+ "license": "MIT"
53
+ }