mcp-insomnia 0.7.0 → 0.7.1
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 +47 -10
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MCP-Insomnia
|
|
2
2
|
|
|
3
|
-
MCP-Insomnia is an MCP (Model Context Protocol) server that enables AI agents to create and manage API collections in Insomnia-compatible format. This server provides tools
|
|
3
|
+
MCP-Insomnia is an MCP (Model Context Protocol) server that enables AI agents to create and manage API collections in Insomnia-compatible format. This server provides tools for managing collections, requests, and environments that can be exported to Insomnia.
|
|
4
4
|
|
|
5
5
|
## Installation and Usage
|
|
6
6
|
|
|
@@ -85,8 +85,7 @@ npm run build
|
|
|
85
85
|
- `get_collection_detail` - Get full details and statistics of a collection
|
|
86
86
|
- `export_collection` - Export collection to JSON format
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
### Folder Management
|
|
88
|
+
### Folder Management
|
|
90
89
|
|
|
91
90
|
- `create_folder` - Create folder within collection
|
|
92
91
|
|
|
@@ -97,17 +96,20 @@ npm run build
|
|
|
97
96
|
- `create_request_in_collection` - Create new request
|
|
98
97
|
- `update_request` - Update existing request
|
|
99
98
|
- `delete_request` - Delete request
|
|
100
|
-
- `execute_request` - Execute request and
|
|
101
|
-
- `get_request_history` - Get execution history of a request
|
|
102
|
-
- `generate_code_snippet` - Generate a code snippet for a request in various languages/frameworks
|
|
99
|
+
- `execute_request` - Execute an MCP-stored request and return the response (supports environment resolution, timeouts, and response size limits — see [Request execution](#request-execution))
|
|
100
|
+
- `get_request_history` - Get execution history of a request (up to 20 entries per request)
|
|
103
101
|
|
|
104
102
|
### Import Tools
|
|
105
103
|
|
|
106
104
|
- `import_from_curl` - Parse cURL command into a request
|
|
107
105
|
- `import_from_postman` - Import Postman Collection (v2.1) JSON
|
|
108
|
-
- `import_from_openapi` - Import OpenAPI
|
|
106
|
+
- `import_from_openapi` - Import OpenAPI 3.x or Swagger 2.x JSON
|
|
109
107
|
- `import_from_insomnia_export` - Import collections from a standard Insomnia V4 export file
|
|
110
108
|
|
|
109
|
+
### Utility Tools
|
|
110
|
+
|
|
111
|
+
- `generate_code_snippet` - Generate a code snippet for a request. Requires `requestId` and `target`. Supported targets: `c`, `clojure`, `csharp`, `go`, `http`, `java`, `javascript`, `kotlin`, `node`, `objc`, `ocaml`, `php`, `powershell`, `python`, `ruby`, `shell`, `swift`. Optional `client` selects a library (e.g. `axios` for `javascript`, `curl` for `shell`).
|
|
112
|
+
|
|
111
113
|
### Insomnia Direct Integration (NeDB)
|
|
112
114
|
|
|
113
115
|
Interact directly with the local Insomnia application database (macOS, Linux, Windows).
|
|
@@ -119,13 +121,42 @@ Interact directly with the local Insomnia application database (macOS, Linux, Wi
|
|
|
119
121
|
- `sync_from_insomnia` - Import a workspace from Insomnia to MCP
|
|
120
122
|
- `sync_all_from_insomnia` - Import all workspaces from Insomnia to MCP
|
|
121
123
|
- `sync_to_insomnia` - Export an MCP collection back to Insomnia
|
|
122
|
-
- `execute_insomnia_request` - Execute a request directly from Insomnia (
|
|
124
|
+
- `execute_insomnia_request` - Execute a request directly from Insomnia without syncing (supports environment resolution and timeouts — see [Request execution](#request-execution))
|
|
123
125
|
|
|
124
126
|
### Environment Management
|
|
125
127
|
|
|
126
128
|
- `set_environment_variable` - Set environment variable
|
|
127
129
|
- `get_environment_variables` - Get environment variables
|
|
128
130
|
|
|
131
|
+
When executing requests, environment variables are merged in layers (later layers override earlier ones):
|
|
132
|
+
|
|
133
|
+
**MCP collections** (`execute_request`):
|
|
134
|
+
1. Workspace/base environments attached to the collection
|
|
135
|
+
2. Sub-environment (`environmentId`, if provided)
|
|
136
|
+
3. Folder environments along the request's ancestor chain
|
|
137
|
+
4. `overrideVariables` (per-call overrides)
|
|
138
|
+
5. `environmentVariables` (legacy final override layer)
|
|
139
|
+
|
|
140
|
+
**Insomnia app** (`execute_insomnia_request`):
|
|
141
|
+
1. Global environment (project level)
|
|
142
|
+
2. Base environment (workspace level)
|
|
143
|
+
3. Sub-environment (`environmentId`, if provided)
|
|
144
|
+
4. Folder environments along the request's ancestor chain
|
|
145
|
+
5. `overrideVariables` (per-call overrides)
|
|
146
|
+
|
|
147
|
+
### Request execution
|
|
148
|
+
|
|
149
|
+
Both execution tools accept optional runtime parameters:
|
|
150
|
+
|
|
151
|
+
| Parameter | `execute_request` | `execute_insomnia_request` | Description |
|
|
152
|
+
|-----------|:-:|:-:|-------------|
|
|
153
|
+
| `requestId` | ✓ | ✓ | ID of the request to run |
|
|
154
|
+
| `environmentId` | ✓ | ✓ | Sub-environment ID for variable substitution |
|
|
155
|
+
| `overrideVariables` | ✓ | ✓ | Per-call variable overrides (e.g. `{"token": "abc123"}`) |
|
|
156
|
+
| `environmentVariables` | ✓ | | Legacy final override layer for MCP collections |
|
|
157
|
+
| `timeoutMs` | ✓ | ✓ | Request timeout in ms (default `30000`; set `<= 0` for no timeout — MCP cancellation still applies) |
|
|
158
|
+
| `maxResponseBytes` | ✓ | | Max serialized response body size in tool output; exceeded bodies are truncated to a preview |
|
|
159
|
+
|
|
129
160
|
### Search & Statistics
|
|
130
161
|
|
|
131
162
|
- `search` - Search across all collections, folders, and requests
|
|
@@ -160,10 +191,16 @@ Set Insomnia environment variable "baseUrl" with value "https://api.example.com"
|
|
|
160
191
|
Execute "Get Users" request using the configured environment variables
|
|
161
192
|
```
|
|
162
193
|
|
|
194
|
+
With optional parameters:
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
Execute request req_abc123 with environmentId env_xyz, timeout 15000ms, and override baseUrl to https://staging.api.example.com
|
|
198
|
+
```
|
|
199
|
+
|
|
163
200
|
### Generate Code Snippet
|
|
164
201
|
|
|
165
202
|
```
|
|
166
|
-
Generate a code snippet for
|
|
203
|
+
Generate a code snippet for request req_abc123 in javascript using axios
|
|
167
204
|
```
|
|
168
205
|
|
|
169
206
|
## Data Storage
|
|
@@ -207,7 +244,7 @@ If Insomnia is installed in a non-default location, you can set the `INSOMNIA_DA
|
|
|
207
244
|
|
|
208
245
|
**Scenario A: Creating/Modifying Content**
|
|
209
246
|
1. **Import/Fetch**: Pull data from Insomnia (`sync_from_insomnia` or `import_from_openapi`)
|
|
210
|
-
2. **Edit**: Modify requests/folders using MCP tools (`
|
|
247
|
+
2. **Edit**: Modify requests/folders using MCP tools (`create_request_in_collection`, `update_request`)
|
|
211
248
|
3. **Publish**: Sync changes back to Insomnia (`sync_to_insomnia`)
|
|
212
249
|
|
|
213
250
|
**Scenario B: Running Existing Requests**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-insomnia",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "MCP server for making HTTP requests and managing API collections",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -59,9 +59,10 @@
|
|
|
59
59
|
},
|
|
60
60
|
"overrides": {
|
|
61
61
|
"@hono/node-server": "^1.19.13",
|
|
62
|
-
"
|
|
62
|
+
"esbuild": "^0.28.1",
|
|
63
|
+
"hono": "^4.12.25",
|
|
63
64
|
"httpsnippet": {
|
|
64
|
-
"form-data": "^4.0.
|
|
65
|
+
"form-data": "^4.0.6"
|
|
65
66
|
},
|
|
66
67
|
"minimatch@3.1.5": {
|
|
67
68
|
"brace-expansion": "^1.1.13"
|