@ppcantidio/openapi-mcp-server 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.
- package/LICENSE +21 -0
- package/README.md +112 -0
- package/dist/index.js +20417 -0
- package/package.json +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pedro Cantidio
|
|
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,112 @@
|
|
|
1
|
+
# @ppcantidio/openapi-mcp-server
|
|
2
|
+
|
|
3
|
+
[](https://github.com/ppcantidio/openapi-mcp-server/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@ppcantidio/openapi-mcp-server)
|
|
5
|
+
|
|
6
|
+
MCP Server that loads an OpenAPI 3.x spec and exposes it as tools for conversational API exploration — no more alt-tabbing to Swagger UI.
|
|
7
|
+
|
|
8
|
+
## Quick Start
|
|
9
|
+
|
|
10
|
+
No install required — use `npx`:
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"mcpServers": {
|
|
15
|
+
"my-api": {
|
|
16
|
+
"command": "npx",
|
|
17
|
+
"args": [
|
|
18
|
+
"@ppcantidio/openapi-mcp-server",
|
|
19
|
+
"--url",
|
|
20
|
+
"https://api.example.com/openapi.json"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Add to Claude Code:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
claude mcp add my-api -- npx @ppcantidio/openapi-mcp-server --url https://api.example.com/openapi.json
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Configuration
|
|
34
|
+
|
|
35
|
+
| Option | Description |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `--url <url>` | OpenAPI spec URL (JSON, OpenAPI 3.x) |
|
|
38
|
+
| `--ttl <seconds>` | Auto-refresh interval (optional) |
|
|
39
|
+
| `OPENAPI_URL` | Env var alternative to `--url` |
|
|
40
|
+
|
|
41
|
+
### Multiple APIs
|
|
42
|
+
|
|
43
|
+
Register multiple instances, one per API:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"mcpServers": {
|
|
48
|
+
"spryx-api": {
|
|
49
|
+
"command": "npx",
|
|
50
|
+
"args": ["@ppcantidio/openapi-mcp-server", "--url", "https://api.spryx.ai/openapi.json"]
|
|
51
|
+
},
|
|
52
|
+
"stripe-api": {
|
|
53
|
+
"command": "npx",
|
|
54
|
+
"args": ["@ppcantidio/openapi-mcp-server", "--url", "https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json"]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Available Tools
|
|
61
|
+
|
|
62
|
+
| Tool | Description |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `list_endpoints` | List all endpoints; filter by `tag`, `method`, `deprecated` |
|
|
65
|
+
| `get_endpoint` | Full details for a specific endpoint (path + method), with `$ref` resolved |
|
|
66
|
+
| `search_endpoints` | Free-text search across path, summary, description, operationId |
|
|
67
|
+
| `list_tags` | All tags with descriptions and endpoint counts |
|
|
68
|
+
| `get_tag_endpoints` | All endpoints for a specific tag |
|
|
69
|
+
| `get_schema` | Named schema from `components/schemas`, with optional `$ref` resolution |
|
|
70
|
+
| `get_server_info` | API title, version, server URLs, and totals |
|
|
71
|
+
| `refresh_spec` | Re-fetch the spec without restarting the server |
|
|
72
|
+
|
|
73
|
+
## Example Conversation
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
You: what modules does this API have?
|
|
77
|
+
Claude: [calls list_tags] → agents (8), billing (4), webhooks (3)
|
|
78
|
+
|
|
79
|
+
You: show me the agents endpoints
|
|
80
|
+
Claude: [calls get_tag_endpoints(tag="agents")] → list of 8 endpoints
|
|
81
|
+
|
|
82
|
+
You: what's the body for POST /v1/agents?
|
|
83
|
+
Claude: [calls get_endpoint(path="/v1/agents", method="POST")] → full details with resolved schema
|
|
84
|
+
|
|
85
|
+
You: is there anything webhook-related?
|
|
86
|
+
Claude: [calls search_endpoints(query="webhook")] → matching endpoints
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Development
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git clone https://github.com/ppcantidio/openapi-mcp-server
|
|
93
|
+
cd openapi-mcp-server
|
|
94
|
+
bun install
|
|
95
|
+
|
|
96
|
+
# Run from source
|
|
97
|
+
bun run dev --url https://api.example.com/openapi.json
|
|
98
|
+
|
|
99
|
+
# Test
|
|
100
|
+
bun test
|
|
101
|
+
|
|
102
|
+
# Lint
|
|
103
|
+
bun run lint
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Tests
|
|
107
|
+
|
|
108
|
+
36 tests across unit (resolver) and integration (Petstore, medium API, Stripe subset fixtures).
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT
|