oastools / plugin
CLAUDE.md7 starsChanged 9 months agoMITView on GitHub
You have access to the oastools MCP server, which provides 17 tools for working with OpenAPI Specification (OAS 2.0-3.2) documents. This plugin requires the oastools CLI binary on your PATH. The MCP server runs as oastools mcp. Install via Homebrew: Or from source (requires Go 1.25+): Check version: oastools version If MCP tools are unavailable or returning errors, verify the binary is installed and up to date. New tool parameters (like output on fix) require the corresponding binary version. Version…
- Installs packages
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- corpus-testSkill
- gen-testSkill
- prepare-releaseSkill
- prereviewSkill
- publish-releaseSkill
- quality-gateSkill
The file
We split this CLAUDE.md into the rules it gives an agent
12 rules. About 0 are common, 0 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
If MCP tools are unavailable or returning errors, verify the binary is installed and up to date.
- Very specific: line 35
Every tool accepts a spec via one of three methods inside a spec object:
- Very specific: line 79
Explore before modifying: Use parse for a high-level overview and walk_* tools to drill into specific parts before running fix or convert.
- Very specific: line 80
Validate after changes: Always run validate after fix, convert, or overlay_apply to confirm the result is valid.
- Very specific: line 86
Use detail: true only after filtering to specific items — full objects can be very large
- Very specific: line 87
Check breaking changes: When diffing specs, use breaking_only: true to focus on changes that will break API consumers.
- Very specific: line 103
When output is omitted, the document is returned inline (automatically for convert/join/overlay_apply.
- Very specific: line 131
Use a temp directory for intermediate files (e.g., /tmp/) and copy the final result to the desired location when the pipeline succeeds.
- Very specific: line 153
Use walk_operations on the revision to understand new/modified endpoints
- Very specific: line 169
When spec.url returns an error containing "blocked request to private/loopback IP" or "redirect to private/loopback IP blocked", this is …
- Very specific: line 171
Fix: Add OASTOOLS_ALLOW_PRIVATE_IPS=true to the MCP server's env config:
- Very specific: line 187
Do NOT work around this by downloading the spec with curl, fetch, or other tools — use the proper env var so the MCP tools can fetch and …
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
oastools MCP Plugin
You have access to the oastools MCP server, which provides 17 tools for working with OpenAPI Specification (OAS 2.0-3.2) documents.
Prerequisites
This plugin requires the oastools CLI binary on your PATH. The MCP server runs as oastools mcp.
Install via Homebrew:
brew install erraggy/oastools/oastoolsOr from source (requires Go 1.25+):
go install github.com/erraggy/oastools/cmd/oastools@latestCheck version: oastools version
If MCP tools are unavailable or returning errors, verify the binary is installed and up to date. New tool parameters (like output on fix) require the corresponding binary version.
Version mismatch detection: On session start, the plugin checks whether the installed oastools binary version matches the plugin version. If a mismatch is detected, a warning is surfaced so you can update accordingly. Dev and unknown builds skip this check.
Available Tools
Core (9): validate, parse, fix, convert, diff, join, overlay_apply, overlay_validate, generate
Walk (8): walk_operations, walk_schemas, walk_parameters, walk_responses, walk_headers, walk_security, walk_paths, walk_refs
Input Model
Every tool accepts a spec via one of three methods inside a spec object:
file-- Path to an OAS file on disk (preferred for large specs)url-- URL to fetch an OAS document fromcontent-- Inline OAS content as a string (JSON or YAML)
Exactly one must be provided. Example: {"spec": {"file": "openapi.yaml"}}
Special cases:
diffusesbaseandrevisioninstead ofspecjoinuses aspecsarrayoverlay_applyusesspecandoverlay
Configuration
The MCP server reads OASTOOLS_* environment variables for default behavior. These are set by the user in their MCP client config (e.g., the env field in .mcp.json). You don't need to configure these yourself — just be aware that defaults may differ from the documented values.
Key settings that affect tool behavior:
| Variable | Default | Effect |
OASTOOLS_VALIDATE_STRICT | false | When true, validate uses strict mode unless the call explicitly sets strict: false |
OASTOOLS_VALIDATE_NO_WARNINGS | false | When true, validate suppresses warnings unless the call explicitly sets no_warnings: false |
OASTOOLS_WALK_LIMIT | 100 | Default result limit for walk tools (override with limit per call) |
OASTOOLS_WALK_DETAIL_LIMIT | 25 | Default limit in detail mode |
OASTOOLS_JOIN_PATH_STRATEGY | (none) | Default path collision strategy for join |
OASTOOLS_JOIN_SCHEMA_STRATEGY | (none) | Default schema collision strategy for join |
OASTOOLS_CACHE_ENABLED | true | Disable spec caching entirely with false |
OASTOOLS_CACHE_MAX_SIZE | 10 | Maximum number of parsed specs held in the LRU cache |
OASTOOLS_CACHE_FILE_TTL | 15m | How long file-based specs are cached |
OASTOOLS_CACHE_URL_TTL | 5m | How long URL-fetched specs are cached |
OASTOOLS_CACHE_CONTENT_TTL | 15m | How long inline content specs are cached |
OASTOOLS_CACHE_SWEEP_INTERVAL | 60s | How often the background cache sweeper runs |
OASTOOLS_ALLOW_PRIVATE_IPS | false | Allow URL resolution to private/loopback/link-local IPs (for internal APIs) |
OASTOOLS_MAX_INLINE_SIZE | 10485760 | Max inline content size in bytes (10 MiB) |
OASTOOLS_MAX_LIMIT | 1000 | Max pagination limit for walk tools |
OASTOOLS_MAX_JOIN_SPECS | 20 | Max number of specs in a join operation |
Tool-level parameters (e.g., strict, no_warnings, limit) always override the env var defaults when explicitly provided.
Best Practices
- Prefer
fileovercontentfor specs already on disk. Avoids copying large documents into tool calls. - Explore before modifying. Use
parsefor a high-level overview andwalk_*tools to drill into specific parts before runningfixorconvert. - Validate after changes. Always run
validateafterfix,convert, oroverlay_applyto confirm the result is valid. - Use
dry_runfor fix. Preview what thefixtool will change before applying. - 🔍 Filter before paging. All walk tools and
validate,fix,diffsupport filters that reduce result size more effectively than pagination. Key filters:walk_*:tag,method,path,status,name,type,component(schemas only)validate:no_warnings: true— suppresses warnings for error-focused triagediff:breaking_only: true— shows only breaking changes (usually fewest and most important)- Use
detail: trueonly after filtering to specific items — full objects can be very large
- Check breaking changes. When diffing specs, use
breaking_only: trueto focus on changes that will break API consumers. - 📄 Page through large results. Tools that return arrays (
validate,fix,diff,walk_*) supportoffsetandlimitparams (default limit: 100). Whenreturnedis less than the total count, useoffsetto page through. Prefer filtering over paging when possible. - 📊 Aggregate with
group_by. Most walk tools (walk_operations,walk_schemas,walk_parameters,walk_responses,walk_headers,walk_paths,walk_refs) support agroup_byparameter (walk_securitydoes not, since specs rarely have more than 3 schemes) that returns{key, count}groups instead of individual items.walk_pathssupportsgroup_by: "segment"(group by first path segment) andwalk_refssupportsgroup_by: "node_type"(group by reference target type). Use this for distribution questions ("how many operations per tag?") instead of paging through all results. - 🔍 Parameter filters auto-resolve refs.
walk_parametersautomatically resolves$refparameters when filtering byinorname. No need to setresolve_refs: truemanually for these filters. - 📏 Detail mode has a lower default limit (25).
detail=truedefaults to 25 results instead of 100 to keep output manageable. Setlimitexplicitly for more results.
💾 Persisting Results
Tools that transform documents (fix, convert, join, overlay_apply) do not modify input files in-place. The file input is read-only. To persist results, use the output parameter:
{"spec": {"file": "openapi.yaml"}, "output": "/tmp/fixed.yaml"}The response includes written_to confirming the file path. Both output and include_document can be used together when you need to write to disk AND inspect the result inline.
When output is omitted, the document is returned inline (automatically for convert/join/overlay_apply; only when include_document: true for fix). For large specs, prefer output over inline to avoid excessive token usage.
🔗 Pipelining Tools
Chain tools by writing intermediate results to files and referencing them in subsequent calls:
Fix → Validate:
fix(spec.file="api.yaml", output="/tmp/api-fixed.yaml")
validate(spec.file="/tmp/api-fixed.yaml")Fix → Convert → Validate:
fix(spec.file="api.yaml", output="/tmp/api-fixed.yaml")
convert(spec.file="/tmp/api-fixed.yaml", target="3.1", output="/tmp/api-3.1.yaml")
validate(spec.file="/tmp/api-3.1.yaml")Fix → Generate:
fix(spec.file="api.yaml", output="/tmp/api-fixed.yaml")
generate(spec.file="/tmp/api-fixed.yaml", client=true, output_dir="./generated")Use a temp directory for intermediate files (e.g., /tmp/) and copy the final result to the desired location when the pipeline succeeds.
Common Workflows
Validate and fix:
validatethe spec to find issuesfixwithdry_run: trueto preview fixesfixwithoutputto apply fixes and persist the resultvalidatethe output file to confirm the spec is now valid
Explore an API:
parseto get title, version, path/schema/operation countswalk_operationsto list endpoints (filter by tag, method, or path)walk_schemasto list data modelswalk_operationswithdetail: trueon specific endpoints for full request/response details
Compare API versions:
diffwith both specs to see all changes- Review breaking changes and their severity
- Use
walk_operationson the revision to understand new/modified endpoints
Explore a large API (100+ operations):
- 📊
parseto get counts and tag list - 📊
walk_operationswithgroup_by: "tag"— operation count per tag at a glance - 🏷️
walk_operationswithtagfilter — work through one tag at a time - 📋
walk_schemaswithcomponent: true— named schemas only (skip inline) - 🔗
walk_refsto find most-referenced schemas and trace usage patterns - 🔍 Drill into specifics with
operation_idorpath+detail: true - ✅ Use
validatewithno_warnings: truefor error-focused triage
Troubleshooting
Private/internal URLs blocked
When spec.url returns an error containing "blocked request to private/loopback IP" or "redirect to private/loopback IP blocked", this is SSRF protection preventing URL resolution to private, loopback, or link-local IP addresses. The error message itself includes the fix (set OASTOOLS_ALLOW_PRIVATE_IPS=true to allow). This is expected for internal/company APIs.
Fix: Add OASTOOLS_ALLOW_PRIVATE_IPS=true to the MCP server's env config:
{
"mcpServers": {
"oastools": {
"command": "oastools",
"args": ["mcp"],
"env": {
"OASTOOLS_ALLOW_PRIVATE_IPS": "true"
}
}
}
}Do NOT work around this by downloading the spec with curl, fetch, or other tools — use the proper env var so the MCP tools can fetch and cache the spec directly.
Inline content too large
When content exceeds 10 MiB, the server returns an error containing "use file input instead, or set OASTOOLS_MAX_INLINE_SIZE to increase". Follow the error's guidance: use file input instead of content. If the spec is only available as a string (e.g., from an API response), write it to a temp file first, then reference that file.
Env var changes require restart
The MCP server reads environment variables at startup. After changing env values in .mcp.json (or project settings), the MCP server must be restarted. In Claude Code: use /mcp and restart the server, or restart the session.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

