@thupham/volley-mcp 1.0.1 → 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.
- package/README.md +159 -0
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# @thupham/volley-mcp
|
|
2
|
+
|
|
3
|
+
An [MCP server](https://modelcontextprotocol.io) that gives AI agents a full API
|
|
4
|
+
testing toolkit — REST, GraphQL, WebSocket, and SSE — without bloating the
|
|
5
|
+
context window.
|
|
6
|
+
|
|
7
|
+
Volley is **agent-native**: every tool returns a small, structured summary the
|
|
8
|
+
LLM can act on immediately. Large payloads are spilled to a Rust-side store and
|
|
9
|
+
referenced by handle. Tests are declarative JSON (`assert` + `extract`), not
|
|
10
|
+
imperative JavaScript.
|
|
11
|
+
|
|
12
|
+
**See more:** <https://volley.thupham.io.vn/>
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g @thupham/volley-mcp
|
|
18
|
+
# or use via npx (no global install needed):
|
|
19
|
+
npx -y @thupham/volley-mcp
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Register with an MCP client
|
|
23
|
+
|
|
24
|
+
Add Volley to any MCP-capable client's config:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"mcpServers": {
|
|
29
|
+
"volley": {
|
|
30
|
+
"command": "npx",
|
|
31
|
+
"args": ["-y", "@thupham/volley-mcp"]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Config file locations for common clients:
|
|
38
|
+
|
|
39
|
+
| Client | Path |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| Cursor | `~/.cursor/mcp.json` or `.cursor/mcp.json` |
|
|
42
|
+
| Windsurf | `~/.codeium/windsurf/mcp_config.json` |
|
|
43
|
+
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
44
|
+
| Devin CLI | `~/.config/devin/config.json` |
|
|
45
|
+
| VS Code | `~/.vscode/mcp.json` or `.vscode/mcp.json` |
|
|
46
|
+
|
|
47
|
+
Restart the client and ask the agent to list tools — you should see
|
|
48
|
+
`http_request`, `graphql_request`, `ws_session`, `sse_session`,
|
|
49
|
+
`inspect_response`, and the rest of the surface below.
|
|
50
|
+
|
|
51
|
+
## Tools
|
|
52
|
+
|
|
53
|
+
### Request
|
|
54
|
+
|
|
55
|
+
| Tool | Signature | Notes |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| `http_request` | `http_request(url, method?, body?, auth?, assert?, extract?)` | REST/HTTP with inline assertions and `{{var}}` extraction. |
|
|
58
|
+
| `graphql_request` | `graphql_request(url, query, variables?, auth?, extract?)` | Queries + mutations. Separates GraphQL errors from HTTP status. |
|
|
59
|
+
| `graphql_introspect` | `graphql_introspect(url)` | Returns an enriched, token-efficient schema (field signatures, nested fields, input types, enums). |
|
|
60
|
+
| `ws_session` | `ws_session(url, send?, collect?, assert?)` | Bounded WebSocket session: connect → send → collect until stop condition. |
|
|
61
|
+
| `ws_open` / `ws_send` / `ws_recv` / `ws_close` | `ws_open(url) → handle; ws_send(handle, msg); ws_recv(handle); ws_close(handle)` | Persistent WebSocket handles for interactive flows. |
|
|
62
|
+
| `sse_session` | `sse_session(url, headers?, collect?, assert?)` | Bounded SSE collector with event assertions. |
|
|
63
|
+
|
|
64
|
+
### Inspect
|
|
65
|
+
|
|
66
|
+
| Tool | Signature | Notes |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| `inspect_response` | `inspect_response(handle, jsonpath?, maxItems?)` | RFC 9535 JSONPath with filters (`$.items[?@.id==1]`), `maxItems` truncation, parse-error surfacing. |
|
|
69
|
+
|
|
70
|
+
### Env
|
|
71
|
+
|
|
72
|
+
| Tool | Signature | Notes |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| `set_env` / `list_envs` | `set_env(name, vars); list_envs()` | Manage environments and variables. Secret values are masked in summaries. |
|
|
75
|
+
|
|
76
|
+
### Collection
|
|
77
|
+
|
|
78
|
+
| Tool | Signature | Notes |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `run_collection` / `list_collections` | `run_collection(path, only?, tags?); list_collections()` | Run declarative YAML/JSON collections: ordered steps, variable threading, `only`/`tags` filters. |
|
|
81
|
+
|
|
82
|
+
### Import
|
|
83
|
+
|
|
84
|
+
| Tool | Signature | Notes |
|
|
85
|
+
| --- | --- | --- |
|
|
86
|
+
| `import_curl` | `import_curl(cmd)` | Parse a cURL command into a request definition. |
|
|
87
|
+
| `import_openapi` | `import_openapi(spec)` | Import operations from an OpenAPI spec. |
|
|
88
|
+
| `import_har` | `import_har(file)` | Import entries from a HAR archive. |
|
|
89
|
+
|
|
90
|
+
### Policy
|
|
91
|
+
|
|
92
|
+
| Tool | Signature | Notes |
|
|
93
|
+
| --- | --- | --- |
|
|
94
|
+
| `save_request` | `save_request(name, def)` | Persist an ad-hoc request for reuse. |
|
|
95
|
+
| `set_policy` | `set_policy(rules)` | Configure safety policies (allowed hosts, timeouts, redaction). |
|
|
96
|
+
|
|
97
|
+
## Example: declarative test
|
|
98
|
+
|
|
99
|
+
```jsonc
|
|
100
|
+
// http_request with inline assertions + extraction
|
|
101
|
+
{
|
|
102
|
+
"method": "POST",
|
|
103
|
+
"url": "https://api.example.com/login",
|
|
104
|
+
"body": { "user": "a", "pass": "{{secret_pass}}" },
|
|
105
|
+
"assert": [
|
|
106
|
+
{ "status": 200 },
|
|
107
|
+
{ "jsonpath": "$.token", "exists": true },
|
|
108
|
+
{ "timeMs": { "lt": 500 } }
|
|
109
|
+
],
|
|
110
|
+
"extract": { "token": "$.token" }
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
```jsonc
|
|
115
|
+
// response
|
|
116
|
+
{
|
|
117
|
+
"status": 200,
|
|
118
|
+
"timeMs": 142,
|
|
119
|
+
"assertions": { "passed": 3, "failed": 0 },
|
|
120
|
+
"extracted": { "token": "***redacted***" },
|
|
121
|
+
"bodySummary": { "type": "object", "keys": ["token", "expiresIn"] },
|
|
122
|
+
"responseHandle": "resp_a1b2"
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Assertion matchers: `equals`, `notEquals`, `in`, `contains`, `matches`,
|
|
127
|
+
`exists`, `gt`, `gte`, `lt`, `lte`, `length`, plus `not:` negation and
|
|
128
|
+
`schema:` for JSON Schema validation.
|
|
129
|
+
|
|
130
|
+
## Architecture
|
|
131
|
+
|
|
132
|
+
This package is the thin TypeScript MCP layer. The execution engine
|
|
133
|
+
(HTTP/GraphQL/WS/SSE clients, assertions, JSONPath, summarization) lives in a
|
|
134
|
+
Rust core compiled to a native addon via [napi-rs](https://napi.rs), published
|
|
135
|
+
as [`@thupham/volley-core`](https://www.npmjs.com/package/@thupham/volley-core)
|
|
136
|
+
with platform-specific binary packages (`@thupham/volley-core-darwin-arm64`,
|
|
137
|
+
`@thupham/volley-core-linux-x64-gnu`, etc.).
|
|
138
|
+
|
|
139
|
+
The FFI contract is JSON string in / JSON string out; results are parsed in
|
|
140
|
+
`src/native.ts` so the rest of the server works with plain objects.
|
|
141
|
+
|
|
142
|
+
## Run from source
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
git clone <repo>
|
|
146
|
+
cd volley
|
|
147
|
+
pnpm install
|
|
148
|
+
pnpm build # builds the Rust core, then this server
|
|
149
|
+
|
|
150
|
+
# run the server over stdio
|
|
151
|
+
node packages/mcp-server/dist/index.js
|
|
152
|
+
|
|
153
|
+
# end-to-end verification (spins up a local test server, drives every tool)
|
|
154
|
+
pnpm e2e
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { registerSaveTool } from "./tools/save.js";
|
|
|
15
15
|
import { registerPolicyTool } from "./tools/policy.js";
|
|
16
16
|
import { registerImporterTools } from "./tools/importers.js";
|
|
17
17
|
async function main() {
|
|
18
|
-
const server = new McpServer({ name: "volley", version: "1.0.
|
|
18
|
+
const server = new McpServer({ name: "volley", version: "1.0.2" });
|
|
19
19
|
const session = new Session();
|
|
20
20
|
registerRequestTools(server, session);
|
|
21
21
|
registerStreamTools(server, session);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thupham/volley-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "MCP server for AI-agent-driven API testing (REST/GraphQL/WS/SSE/gRPC)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
15
15
|
"yaml": "^2.6.1",
|
|
16
16
|
"zod": "^3.23.8",
|
|
17
|
-
"@thupham/volley-core": "1.0.
|
|
17
|
+
"@thupham/volley-core": "1.0.2"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/node": "^22.10.0",
|