cli-mcp-mapper 1.0.0 → 1.0.2

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.
@@ -0,0 +1,92 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://github.com/SteffenBlake/cli-mcp-mapper/commands.schema.json",
4
+ "title": "CLI MCP Mapper Commands Schema",
5
+ "description": "Schema for defining CLI commands to be exposed as MCP tools",
6
+ "type": "object",
7
+ "required": ["commands"],
8
+ "properties": {
9
+ "commands": {
10
+ "type": "object",
11
+ "description": "Map of command names to command definitions",
12
+ "additionalProperties": {
13
+ "$ref": "#/definitions/command"
14
+ }
15
+ }
16
+ },
17
+ "definitions": {
18
+ "command": {
19
+ "type": "object",
20
+ "required": ["description", "command"],
21
+ "properties": {
22
+ "description": {
23
+ "type": "string",
24
+ "description": "Human-readable description of what the command does"
25
+ },
26
+ "command": {
27
+ "type": "string",
28
+ "description": "The base command to execute (e.g., 'git', 'ls', 'dotnet')"
29
+ },
30
+ "baseArgs": {
31
+ "type": "array",
32
+ "description": "Static arguments that are always passed to the command",
33
+ "items": {
34
+ "type": "string"
35
+ },
36
+ "default": []
37
+ },
38
+ "parameters": {
39
+ "type": "object",
40
+ "description": "Map of parameter names to parameter definitions",
41
+ "additionalProperties": {
42
+ "$ref": "#/definitions/parameter"
43
+ },
44
+ "default": {}
45
+ }
46
+ }
47
+ },
48
+ "parameter": {
49
+ "type": "object",
50
+ "required": ["type", "description"],
51
+ "properties": {
52
+ "type": {
53
+ "type": "string",
54
+ "enum": ["string", "boolean", "number"],
55
+ "description": "The data type of the parameter"
56
+ },
57
+ "description": {
58
+ "type": "string",
59
+ "description": "Human-readable description of the parameter"
60
+ },
61
+ "required": {
62
+ "type": "boolean",
63
+ "description": "Whether the parameter is required",
64
+ "default": false
65
+ },
66
+ "position": {
67
+ "type": "integer",
68
+ "minimum": 0,
69
+ "description": "Position for positional arguments (0-based). If set, the parameter is passed by position rather than by name"
70
+ },
71
+ "argName": {
72
+ "type": "string",
73
+ "description": "The argument name/flag to use (e.g., '--output', '-v'). Not used for positional parameters"
74
+ },
75
+ "argValue": {
76
+ "type": "string",
77
+ "description": "Static value to pass after argName for boolean flags (rarely used)"
78
+ },
79
+ "enum": {
80
+ "type": "array",
81
+ "description": "List of allowed values for the parameter",
82
+ "items": {
83
+ "type": "string"
84
+ }
85
+ },
86
+ "default": {
87
+ "description": "Default value for the parameter if not provided"
88
+ }
89
+ }
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,189 @@
1
+ {
2
+ "$schema": "../commands.schema.json",
3
+ "commands": {
4
+ "ls": {
5
+ "description": "List directory contents",
6
+ "command": "ls",
7
+ "baseArgs": ["-lah"],
8
+ "parameters": {
9
+ "path": {
10
+ "type": "string",
11
+ "description": "Path to directory or file (optional, uses current directory if omitted)",
12
+ "position": 0
13
+ },
14
+ "recursive": {
15
+ "type": "boolean",
16
+ "description": "List subdirectories recursively",
17
+ "argName": "-R"
18
+ },
19
+ "sort_by_time": {
20
+ "type": "boolean",
21
+ "description": "Sort by modification time, newest first",
22
+ "argName": "-t"
23
+ },
24
+ "sort_by_size": {
25
+ "type": "boolean",
26
+ "description": "Sort by file size, largest first",
27
+ "argName": "-S"
28
+ }
29
+ }
30
+ },
31
+ "cat": {
32
+ "description": "Display contents of a file",
33
+ "command": "cat",
34
+ "baseArgs": [],
35
+ "parameters": {
36
+ "file_path": {
37
+ "type": "string",
38
+ "description": "Path to the file to display",
39
+ "required": true,
40
+ "position": 0
41
+ },
42
+ "show_line_numbers": {
43
+ "type": "boolean",
44
+ "description": "Show line numbers",
45
+ "argName": "-n"
46
+ }
47
+ }
48
+ },
49
+ "mkdir": {
50
+ "description": "Create a new directory",
51
+ "command": "mkdir",
52
+ "baseArgs": [],
53
+ "parameters": {
54
+ "directory_path": {
55
+ "type": "string",
56
+ "description": "Path to the directory to create",
57
+ "required": true,
58
+ "position": 0
59
+ },
60
+ "parents": {
61
+ "type": "boolean",
62
+ "description": "Create parent directories as needed",
63
+ "argName": "-p"
64
+ },
65
+ "verbose": {
66
+ "type": "boolean",
67
+ "description": "Print a message for each created directory",
68
+ "argName": "-v"
69
+ }
70
+ }
71
+ },
72
+ "delete_file": {
73
+ "description": "Delete a file",
74
+ "command": "rm",
75
+ "baseArgs": ["-v"],
76
+ "parameters": {
77
+ "file_path": {
78
+ "type": "string",
79
+ "description": "Path to the file to delete",
80
+ "required": true,
81
+ "position": 0
82
+ },
83
+ "force": {
84
+ "type": "boolean",
85
+ "description": "Force deletion without prompting",
86
+ "argName": "-f"
87
+ }
88
+ }
89
+ },
90
+ "delete_directory": {
91
+ "description": "Delete a directory and its contents",
92
+ "command": "rm",
93
+ "baseArgs": ["-rv"],
94
+ "parameters": {
95
+ "directory_path": {
96
+ "type": "string",
97
+ "description": "Path to the directory to delete",
98
+ "required": true,
99
+ "position": 0
100
+ },
101
+ "force": {
102
+ "type": "boolean",
103
+ "description": "Force deletion without prompting",
104
+ "argName": "-f"
105
+ }
106
+ }
107
+ },
108
+ "pwd": {
109
+ "description": "Print the current working directory",
110
+ "command": "pwd",
111
+ "baseArgs": [],
112
+ "parameters": {}
113
+ },
114
+ "echo": {
115
+ "description": "Display a line of text",
116
+ "command": "echo",
117
+ "baseArgs": [],
118
+ "parameters": {
119
+ "text": {
120
+ "type": "string",
121
+ "description": "Text to display",
122
+ "required": true,
123
+ "position": 0
124
+ },
125
+ "no_newline": {
126
+ "type": "boolean",
127
+ "description": "Do not output the trailing newline",
128
+ "argName": "-n"
129
+ }
130
+ }
131
+ },
132
+ "find": {
133
+ "description": "Search for files in a directory hierarchy",
134
+ "command": "find",
135
+ "baseArgs": [],
136
+ "parameters": {
137
+ "path": {
138
+ "type": "string",
139
+ "description": "Starting directory for search (optional, uses current directory if omitted)",
140
+ "position": 0
141
+ },
142
+ "name": {
143
+ "type": "string",
144
+ "description": "File name pattern to match",
145
+ "argName": "-name"
146
+ },
147
+ "type": {
148
+ "type": "string",
149
+ "description": "File type (f for file, d for directory)",
150
+ "enum": ["f", "d", "l"],
151
+ "argName": "-type"
152
+ }
153
+ }
154
+ },
155
+ "grep": {
156
+ "description": "Search for a pattern in files",
157
+ "command": "grep",
158
+ "baseArgs": [],
159
+ "parameters": {
160
+ "pattern": {
161
+ "type": "string",
162
+ "description": "Pattern to search for",
163
+ "required": true,
164
+ "position": 0
165
+ },
166
+ "file_path": {
167
+ "type": "string",
168
+ "description": "File to search in (optional, reads from stdin if omitted)",
169
+ "position": 1
170
+ },
171
+ "ignore_case": {
172
+ "type": "boolean",
173
+ "description": "Ignore case distinctions",
174
+ "argName": "-i"
175
+ },
176
+ "recursive": {
177
+ "type": "boolean",
178
+ "description": "Search recursively in directories",
179
+ "argName": "-r"
180
+ },
181
+ "line_number": {
182
+ "type": "boolean",
183
+ "description": "Show line numbers",
184
+ "argName": "-n"
185
+ }
186
+ }
187
+ }
188
+ }
189
+ }
@@ -0,0 +1,208 @@
1
+ {
2
+ "$schema": "../commands.schema.json",
3
+ "commands": {
4
+ "cp": {
5
+ "description": "Copy files and directories",
6
+ "command": "cp",
7
+ "baseArgs": [],
8
+ "parameters": {
9
+ "source": {
10
+ "type": "string",
11
+ "description": "Source file or directory",
12
+ "required": true,
13
+ "position": 0
14
+ },
15
+ "destination": {
16
+ "type": "string",
17
+ "description": "Destination path",
18
+ "required": true,
19
+ "position": 1
20
+ },
21
+ "recursive": {
22
+ "type": "boolean",
23
+ "description": "Copy directories recursively",
24
+ "argName": "-r"
25
+ },
26
+ "verbose": {
27
+ "type": "boolean",
28
+ "description": "Explain what is being done",
29
+ "argName": "-v"
30
+ },
31
+ "force": {
32
+ "type": "boolean",
33
+ "description": "Force copy, overwriting existing files",
34
+ "argName": "-f"
35
+ }
36
+ }
37
+ },
38
+ "mv": {
39
+ "description": "Move or rename files and directories",
40
+ "command": "mv",
41
+ "baseArgs": [],
42
+ "parameters": {
43
+ "source": {
44
+ "type": "string",
45
+ "description": "Source file or directory",
46
+ "required": true,
47
+ "position": 0
48
+ },
49
+ "destination": {
50
+ "type": "string",
51
+ "description": "Destination path",
52
+ "required": true,
53
+ "position": 1
54
+ },
55
+ "verbose": {
56
+ "type": "boolean",
57
+ "description": "Explain what is being done",
58
+ "argName": "-v"
59
+ },
60
+ "force": {
61
+ "type": "boolean",
62
+ "description": "Force move, overwriting existing files",
63
+ "argName": "-f"
64
+ }
65
+ }
66
+ },
67
+ "touch": {
68
+ "description": "Create an empty file or update file timestamp",
69
+ "command": "touch",
70
+ "baseArgs": [],
71
+ "parameters": {
72
+ "file_path": {
73
+ "type": "string",
74
+ "description": "Path to the file to create or touch",
75
+ "required": true,
76
+ "position": 0
77
+ }
78
+ }
79
+ },
80
+ "chmod": {
81
+ "description": "Change file permissions",
82
+ "command": "chmod",
83
+ "baseArgs": [],
84
+ "parameters": {
85
+ "mode": {
86
+ "type": "string",
87
+ "description": "Permission mode (e.g., '755', '+x', 'u+rw')",
88
+ "required": true,
89
+ "position": 0
90
+ },
91
+ "file_path": {
92
+ "type": "string",
93
+ "description": "Path to the file or directory",
94
+ "required": true,
95
+ "position": 1
96
+ },
97
+ "recursive": {
98
+ "type": "boolean",
99
+ "description": "Change permissions recursively",
100
+ "argName": "-R"
101
+ },
102
+ "verbose": {
103
+ "type": "boolean",
104
+ "description": "Output a diagnostic for every file processed",
105
+ "argName": "-v"
106
+ }
107
+ }
108
+ },
109
+ "chown": {
110
+ "description": "Change file owner and group",
111
+ "command": "chown",
112
+ "baseArgs": [],
113
+ "parameters": {
114
+ "owner": {
115
+ "type": "string",
116
+ "description": "New owner (user:group format)",
117
+ "required": true,
118
+ "position": 0
119
+ },
120
+ "file_path": {
121
+ "type": "string",
122
+ "description": "Path to the file or directory",
123
+ "required": true,
124
+ "position": 1
125
+ },
126
+ "recursive": {
127
+ "type": "boolean",
128
+ "description": "Change ownership recursively",
129
+ "argName": "-R"
130
+ }
131
+ }
132
+ },
133
+ "tar_create": {
134
+ "description": "Create a tar archive",
135
+ "command": "tar",
136
+ "baseArgs": ["-czf"],
137
+ "parameters": {
138
+ "archive_name": {
139
+ "type": "string",
140
+ "description": "Name of the archive file to create",
141
+ "required": true,
142
+ "position": 0
143
+ },
144
+ "source_path": {
145
+ "type": "string",
146
+ "description": "Path to files/directories to archive",
147
+ "required": true,
148
+ "position": 1
149
+ },
150
+ "verbose": {
151
+ "type": "boolean",
152
+ "description": "Verbosely list files processed",
153
+ "argName": "-v"
154
+ }
155
+ }
156
+ },
157
+ "tar_extract": {
158
+ "description": "Extract a tar archive",
159
+ "command": "tar",
160
+ "baseArgs": ["-xzf"],
161
+ "parameters": {
162
+ "archive_name": {
163
+ "type": "string",
164
+ "description": "Name of the archive file to extract",
165
+ "required": true,
166
+ "position": 0
167
+ },
168
+ "destination": {
169
+ "type": "string",
170
+ "description": "Directory to extract into",
171
+ "argName": "-C"
172
+ },
173
+ "verbose": {
174
+ "type": "boolean",
175
+ "description": "Verbosely list files processed",
176
+ "argName": "-v"
177
+ }
178
+ }
179
+ },
180
+ "wc": {
181
+ "description": "Count lines, words, and bytes in files",
182
+ "command": "wc",
183
+ "baseArgs": [],
184
+ "parameters": {
185
+ "file_path": {
186
+ "type": "string",
187
+ "description": "File to analyze",
188
+ "position": 0
189
+ },
190
+ "lines": {
191
+ "type": "boolean",
192
+ "description": "Count lines only",
193
+ "argName": "-l"
194
+ },
195
+ "words": {
196
+ "type": "boolean",
197
+ "description": "Count words only",
198
+ "argName": "-w"
199
+ },
200
+ "bytes": {
201
+ "type": "boolean",
202
+ "description": "Count bytes only",
203
+ "argName": "-c"
204
+ }
205
+ }
206
+ }
207
+ }
208
+ }
@@ -0,0 +1,198 @@
1
+ {
2
+ "$schema": "../commands.schema.json",
3
+ "commands": {
4
+ "git_status": {
5
+ "description": "Show the working tree status",
6
+ "command": "git",
7
+ "baseArgs": ["status"],
8
+ "parameters": {
9
+ "short": {
10
+ "type": "boolean",
11
+ "description": "Give output in short format",
12
+ "argName": "-s"
13
+ },
14
+ "branch": {
15
+ "type": "boolean",
16
+ "description": "Show branch information",
17
+ "argName": "-b"
18
+ }
19
+ }
20
+ },
21
+ "git_diff": {
22
+ "description": "Show changes between commits, commit and working tree, etc",
23
+ "command": "git",
24
+ "baseArgs": ["diff"],
25
+ "parameters": {
26
+ "staged": {
27
+ "type": "boolean",
28
+ "description": "Show staged changes (--cached)",
29
+ "argName": "--cached"
30
+ },
31
+ "file_path": {
32
+ "type": "string",
33
+ "description": "Show changes for specific file",
34
+ "position": 0
35
+ }
36
+ }
37
+ },
38
+ "git_log": {
39
+ "description": "Show commit logs",
40
+ "command": "git",
41
+ "baseArgs": ["log"],
42
+ "parameters": {
43
+ "max_count": {
44
+ "type": "number",
45
+ "description": "Limit the number of commits to show",
46
+ "argName": "-n"
47
+ },
48
+ "oneline": {
49
+ "type": "boolean",
50
+ "description": "Show each commit on a single line",
51
+ "argName": "--oneline"
52
+ },
53
+ "graph": {
54
+ "type": "boolean",
55
+ "description": "Draw a text-based graph of commits",
56
+ "argName": "--graph"
57
+ }
58
+ }
59
+ },
60
+ "git_current_branch": {
61
+ "description": "Get the name of the current git branch",
62
+ "command": "git",
63
+ "baseArgs": ["branch", "--show-current"],
64
+ "parameters": {}
65
+ },
66
+ "git_checkout": {
67
+ "description": "Switch branches or restore working tree files",
68
+ "command": "git",
69
+ "baseArgs": ["checkout"],
70
+ "parameters": {
71
+ "branch_or_file": {
72
+ "type": "string",
73
+ "description": "Branch name or file path",
74
+ "required": true,
75
+ "position": 0
76
+ },
77
+ "create_branch": {
78
+ "type": "boolean",
79
+ "description": "Create a new branch",
80
+ "argName": "-b"
81
+ }
82
+ }
83
+ },
84
+ "git_add": {
85
+ "description": "Add file contents to the staging area",
86
+ "command": "git",
87
+ "baseArgs": ["add"],
88
+ "parameters": {
89
+ "path": {
90
+ "type": "string",
91
+ "description": "Files or directories to add (use '.' for all)",
92
+ "required": true,
93
+ "position": 0
94
+ },
95
+ "all": {
96
+ "type": "boolean",
97
+ "description": "Add all changes (new, modified, deleted)",
98
+ "argName": "-A"
99
+ }
100
+ }
101
+ },
102
+ "git_commit": {
103
+ "description": "Record changes to the repository",
104
+ "command": "git",
105
+ "baseArgs": ["commit"],
106
+ "parameters": {
107
+ "message": {
108
+ "type": "string",
109
+ "description": "Commit message",
110
+ "required": true,
111
+ "argName": "-m"
112
+ },
113
+ "all": {
114
+ "type": "boolean",
115
+ "description": "Automatically stage modified and deleted files",
116
+ "argName": "-a"
117
+ },
118
+ "amend": {
119
+ "type": "boolean",
120
+ "description": "Amend the previous commit",
121
+ "argName": "--amend"
122
+ }
123
+ }
124
+ },
125
+ "git_push": {
126
+ "description": "Update remote refs along with associated objects",
127
+ "command": "git",
128
+ "baseArgs": ["push"],
129
+ "parameters": {
130
+ "remote": {
131
+ "type": "string",
132
+ "description": "Remote repository name (default: origin)",
133
+ "position": 0
134
+ },
135
+ "branch": {
136
+ "type": "string",
137
+ "description": "Branch to push",
138
+ "position": 1
139
+ },
140
+ "force": {
141
+ "type": "boolean",
142
+ "description": "Force push (use with caution)",
143
+ "argName": "--force"
144
+ },
145
+ "set_upstream": {
146
+ "type": "boolean",
147
+ "description": "Set upstream for the branch",
148
+ "argName": "-u"
149
+ }
150
+ }
151
+ },
152
+ "git_pull": {
153
+ "description": "Fetch from and integrate with another repository or local branch",
154
+ "command": "git",
155
+ "baseArgs": ["pull"],
156
+ "parameters": {
157
+ "remote": {
158
+ "type": "string",
159
+ "description": "Remote repository name (default: origin)",
160
+ "position": 0
161
+ },
162
+ "branch": {
163
+ "type": "string",
164
+ "description": "Branch to pull",
165
+ "position": 1
166
+ },
167
+ "rebase": {
168
+ "type": "boolean",
169
+ "description": "Rebase instead of merge",
170
+ "argName": "--rebase"
171
+ }
172
+ }
173
+ },
174
+ "git_clone": {
175
+ "description": "Clone a repository into a new directory",
176
+ "command": "git",
177
+ "baseArgs": ["clone"],
178
+ "parameters": {
179
+ "repository": {
180
+ "type": "string",
181
+ "description": "Repository URL to clone",
182
+ "required": true,
183
+ "position": 0
184
+ },
185
+ "directory": {
186
+ "type": "string",
187
+ "description": "Directory to clone into",
188
+ "position": 1
189
+ },
190
+ "depth": {
191
+ "type": "number",
192
+ "description": "Create a shallow clone with specified depth",
193
+ "argName": "--depth"
194
+ }
195
+ }
196
+ }
197
+ }
198
+ }