added context7 connector to extra tools

This commit is contained in:
Luxferre
2026-08-17 10:00:33 +03:00
parent b298c53406
commit e9dd44d97b
2 changed files with 232 additions and 0 deletions
+33
View File
@@ -247,6 +247,39 @@ Options include `-l/--location`, `-u/--units` (`m`/`u`/`M`), `-L/--lang`,
`https://wttr.in`) and `WEATHER_TIMEOUT` (default `20`s).
Dependencies: `curl`, `jq` (only required for the JSON format).
Dependencies: `curl`, `jq` (only required for the JSON format).
### `extras/context7`
A documentation lookup tool for Bantam backed by the
[Context7 public MCP server](https://mcp.context7.com/mcp). It speaks the same
JSON-RPC MCP protocol as `websearch` (`initialize` ->
`notifications/initialized` -> `tools/call`) and prints the returned text.
Context7 keeps up-to-date docs and code examples for thousands of libraries and
exposes two tools, both wrapped here:
- `resolve-library-id` — maps a library name to a Context7 ID
(`/org/project`).
- `query-docs` — fetches documentation and code examples for a resolved ID.
Usage:
```sh
extras/context7 resolve "React" "hooks" # list candidate library IDs
extras/context7 query "/reactjs/react.dev" "useEffect cleanup" # fetch docs
extras/context7 docs "Express" "middleware error handling" # resolve + query
extras/context7 --help
```
The `docs` subcommand is a convenience that resolves the library, auto-selects
the top-ranked match, and immediately queries it (the chosen ID is printed to
stderr so stdout stays clean for piping). Environment overrides:
`CONTEXT7_MCP_ENDPOINT` (default `https://mcp.context7.com/mcp`) and
`CONTEXT7_API_KEY` (optional; sent as the `X-Context7-API-Key` header for
higher rate limits / private docs).
Dependencies: `curl`, `jq`.
## FAQ