Commit Graph

812 Commits

Author SHA1 Message Date
github-actions[bot] 13f3ef03d9 chore(release): version packages (#2576)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@upstash/context7-mcp@2.2.5 ctx7@0.4.2
2026-05-11 22:50:59 +03:00
Enes Gules e8b5a6122f feat: add more renamed variables to mcp (#2599) 2026-05-11 22:49:26 +03:00
Fahreddin Özcan 187287c690 fix(mcp): rewrite hallucinated tools/call argument names (#2598)
Some LLM clients send `context7CompatibleLibraryID`/`userQuery` instead of
the canonical `libraryId`/`query` — likely echoing phrasing from the tool
descriptions — and trip Zod validation before the tool ever runs.

Hook `Transport.onmessage` (set before `server.connect()` so the SDK chains
its dispatch over it) and rewrite those two keys in place on `tools/call`
requests where the canonical key is absent. Published `tools/list` schemas
are unchanged; the rewrite is a server-side compatibility shim.
2026-05-11 10:50:36 -07:00
Fahreddin Özcan 78b9826695 fix(mcp): exit stdio server when parent closes stdio (#2577)
Listen for stdin end/close and SIGHUP and exit with code 0. Without these,
an idle undici keep-alive socket left over from a recent fetch keeps
libuv's event loop alive past stdin EOF, leaving an orphan node process
when the parent (e.g. Claude Code) is force-killed.

Fixes #2542
2026-05-06 13:58:26 +03:00
Fahreddin Özcan 6c71e4deb4 fix(cli): handle malformed MCP config files in remove detection (#2574)
readJsonConfig only caught file-read errors, not JSON.parse errors.
During `ctx7 remove`, the detector iterates every agent's well-known
config path; an unparseable JSON file at any of them (e.g. a
hand-edited ~/.claude.json) crashed the command with an unhandled
SyntaxError before it could do anything.

Wrap the readJsonConfig call in hasMcpConfig with a try/catch that
logs a warning naming the path and parse error and skips that agent.
Keep readJsonConfig itself strict so write paths in setup and
uninstallMcp continue to surface failures via their existing handling.
2026-05-06 11:32:58 +03:00
Andrew Barnes 40568503ff fix(cli): respect CLAUDE_CONFIG_DIR for Claude setup (#2564)
* fix cli claude config dir

* chore: add changeset for CLAUDE_CONFIG_DIR support

---------

Co-authored-by: Fahreddin Özcan <ozcanfahrettinn@gmail.com>
2026-05-06 11:22:23 +03:00
Enes Gules 30df4a1cff docs: enhance library ID descriptions in API guide and OpenAPI spec (#2568) 2026-05-05 19:03:33 +03:00
Elif Nur Deniz 798a0f69d2 docs: update library auto refresh docs (#2565) 2026-05-05 13:52:28 +03:00
github-actions[bot] 85c3a0cbfd chore(release): version packages (#2533)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
ctx7@0.4.1 @upstash/context7-mcp@2.2.4
2026-05-04 20:37:03 +03:00
Enes Akar 1aa3430bf6 feat: remove research mode (#2554)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: enesgules <abdullah.enes.gules@gmail.com>
2026-05-04 20:33:42 +03:00
Fahreddin Özcan 795d5da720 CTX7-1567: Add Microsoft Entra SSO setup guide for on-premise (#2496) 2026-04-30 13:16:00 +03:00
Fahreddin Özcan d0e4a4834e Fix/mcp stream tool responses (#2526)
* fix(mcp): stream tool-call responses so headers flush before 60s

The remote MCP server's StreamableHTTPServerTransport runs in JSON mode
(`enableJsonResponse: true`), which buffers the entire response and writes
status + headers + body together at the end of the tool call. Long-running
tools — notably `query-docs` with `researchMode: true` — routinely take
60–250s, during which no bytes are written to the wire.

MCP HTTP clients cap the underlying `fetch()` waiting for headers
(Claude Code: 60s, hardcoded in @modelcontextprotocol/sdk consumers),
independent of the higher-level per-tool timeout. Production curl with
`-w time_starttransfer` shows `start_transfer ≈ total ≈ 125s` for a
research call — the connection sits silent for the full duration before
flushing in one burst, well past any reasonable client `fetch` timeout.

Switch to SSE responses for POST tool calls. The SDK then returns the
HTTP response synchronously after parsing the request, headers flush in
ms, and the body streams while the tool runs. Same total wall time, but
clients see headers immediately and don't time out.

The existing NGINX-timeout comment above (about rejecting GETs) is about
the standalone GET SSE channel for server-initiated notifications and
still applies — GETs remain rejected. Per-request POST SSE responses are
bounded by the tool call and work fine on the existing ingress
(`proxy-buffering: off`, `proxy-read-timeout: 3600`).

Streamable HTTP requires clients to accept both `application/json` and
`text/event-stream` (SDK enforces 406 otherwise), so this is transparent
to compliant clients including Claude Code.

* remove comment

* chore: add changeset

* fix(mcp): emit progress notifications during researchMode query-docs

The SSE-streaming change in the previous commit only addresses clients
whose timeout fires when response *headers* don't arrive (e.g. Claude
Code's `wrapFetchWithTimeout`). Clients using the MCP SDK's default
`Protocol.request()` timer (`DEFAULT_REQUEST_TIMEOUT_MSEC = 60000`) hit
a wall-clock timeout that bytes flowing don't reset.

Emit `notifications/progress` every 20s while the upstream fetch is in
flight, gated on `researchMode: true` and the client supplying a
`progressToken` in `_meta`. Clients that pass an `onprogress` handler
have the SDK include `progressToken` automatically; on each notification
the SDK resets their JSON-RPC request timer (when they also opted into
`resetTimeoutOnProgress: true`), keeping 60–250s research runs alive.

Clients that don't include a `progressToken` see no notifications and no
behavior change. Fast `query-docs` calls are unaffected — the interval
only arms when `researchMode` is true.

* Merge branch 'master' of https://github.com/upstash/context7 into fix/mcp-stream-tool-responses

# Conflicts:
#	packages/mcp/src/index.ts

* fix(mcp): restore researchMode and progress notifications on query-docs

Re-add the researchMode parameter to the query-docs input schema and
re-emit periodic notifications/progress while the upstream call is in
flight. Clients that opt into resetTimeoutOnProgress (e.g. opencode)
reset their per-request timer on each notification, which keeps the
long-running researchMode call alive past the SDK's default 60s
wall-clock timeout.

* fix(mcp): create a fresh McpServer per HTTP request

The HTTP transport is stateless (sessionIdGenerator: undefined), but the
handler shared one global McpServer across requests. McpServer extends
Protocol, which has a single _transport field. Each server.connect()
overwrites it, and any transport.close on any request fires the shared
Protocol's onclose, leaving _transport undefined for everyone else.

That meant a long-running researchMode call lost its transport every
time an unrelated short request (tool list refresh, init confirmation,
etc.) closed in the background, surfacing as "Not connected" on every
subsequent sendNotification and ultimately a -32001 timeout on the
client.

Switch to the per-request pattern from the SDK's
simpleStatelessStreamableHttp example: a createMcpServer factory builds
a fresh server, registers tools, and is closed alongside the transport
on res.on('close'). stdio mode keeps a single server, since stdio has
exactly one transport for the process lifetime.

* Merge remote-tracking branch 'origin/master' into fix/mcp-stream-tool-responses

# Conflicts:
#	packages/mcp/src/index.ts

* chore(mcp): minimize PR diff against master

Drop the now-redundant changeset that duplicated the SSE-streaming note
already released in 2.2.3, restore comments inadvertently dropped during
the createMcpServer refactor, and rename the changeset file to reflect
what this PR actually changes.

Net diff vs master is now wrapping the existing setup in a
createMcpServer factory, calling it per HTTP request, and closing the
server alongside the transport (12 logical lines added, ignoring
indentation introduced by Prettier).

* fix(mcp): move client info capture to MCP server initialization for stdio mode
2026-04-30 12:02:56 +03:00
github-actions[bot] 878272541a chore(release): version packages (#2525)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@upstash/context7-mcp@2.2.3
2026-04-29 16:15:06 +03:00
Fahreddin Özcan 772da3a164 fix(mcp): stream tool-call responses so headers flush before 60s (#2520) 2026-04-29 16:12:59 +03:00
github-actions[bot] 04b70c419f chore(release): version packages (#2522)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@upstash/context7-mcp@2.2.2
2026-04-29 00:18:11 +03:00
Fahreddin Özcan ff6c1bef4b chore(mcp): remove researchMode from query-docs tool params (#2524)
Hide the `researchMode` parameter from the MCP tool's input schema so
agents stop invoking it. The upstream `/api/v2/context` route still
accepts and serves the parameter; only the MCP-layer surface is
removed. Reasoning: several MCP clients hit per-request timeouts (60s
defaults in the SDK and in fetch-wrappers) on long-running research
calls in ways that can't all be solved server-side. Until the timeout
story is reliable across clients, agents shouldn't be able to call it
via MCP.

Updates:
- Drop the `researchMode` field from the `query-docs` input schema.
- Drop the workflow line in the tool description that referenced it.
- Stop forwarding `researchMode` to fetchLibraryContext; the field is
  optional on ContextRequest, so omitting it is equivalent to false.
2026-04-28 14:15:09 -07:00
Enes Gules 8274bd05ea feat(annotations): add missing tool annotations and enhance hints (#2521) 2026-04-28 16:38:40 +03:00
github-actions[bot] b4bf49f032 chore(release): version packages (#2518)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@upstash/context7-mcp@2.2.1
2026-04-27 17:58:50 +03:00
Enes Gules 1b0c211e66 feat(openai-apps): add OpenAI Apps SDK domain verification endpoint (#2517) 2026-04-27 17:52:40 +03:00
Enes Gules 8bf305b017 feat(metrics): add endpoint for retrieving library usage metrics (#2511) (#2516) 2026-04-27 17:34:13 +03:00
Enes Gules d4487448a3 feat(metrics): add endpoint for retrieving library usage metrics (#2511) 2026-04-27 13:16:45 +03:00
github-actions[bot] 5d284f2154 chore(release): version packages (#2489)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@upstash/context7-mcp@2.2.0 ctx7@0.4.0
2026-04-24 20:49:48 +03:00
Enes Akar 17b864f23f expose research mode through MCP and CLI (#2498)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: enesgules <abdullah.enes.gules@gmail.com>
2026-04-24 20:48:05 +03:00
Shannon Rumsey 4ed5db533e add author to power (#2497) 2026-04-22 10:55:41 -07:00
Shannon Rumsey 0b190c1b8d CTX7-1559: Update section titles and data safety content (#2491) 2026-04-22 00:54:31 +03:00
Fahreddin Özcan f056b14cde CTX7-1542: add uninstall command for Context7 setup (#2473)
* CTX7-1542: add uninstall command for Context7 setup

* CTX7-1542: refine uninstall mode flags

* CTX7-1542: rename uninstall command to remove

* CTX7-1542: rename remove command files and add tests

* CTX7-1542: show detected agents in remove prompt

* CTX7-1542: tighten remove detection and cleanup coverage

* CTX7-1542: add remove command changeset
2026-04-21 12:41:32 +03:00
Fahreddin Özcan 4feee1521e CTX7-1544: add CLI update notifications and upgrade command (#2477)
* CTX7-1544: add CLI update notifications and upgrade command

* CTX7-1544: stabilize upgrade output tests
2026-04-21 12:41:19 +03:00
Shannon Rumsey 051d4602f2 CTX7-1554: Update out-of-date security docs (#2487) 2026-04-21 10:12:35 +03:00
Elif Nur Deniz 648e5a2e06 chore: library refreshing docs (#2482) 2026-04-20 07:23:17 -07:00
Fahreddin Özcan a1a935cbe7 Update Kiro install config and docs (#2474)
* docs: update Kiro install config

* docs: update Kiro deeplink
2026-04-17 14:23:16 +03:00
Fahreddin Özcan abf293eddc Add Hermes Agent guide to MCP clients docs (#2462)
* Add Hermes Agent MCP guide

* Move Hermes guide after Gemini CLI
2026-04-17 11:33:36 +03:00
Shannon Rumsey 0627b71073 CTX7-1531: Create kiro power (#2456)
* add kiro power

---------

Co-authored-by: Fahreddin Özcan <ozcanfahrettinn@gmail.com>
2026-04-14 09:44:32 -07:00
github-actions[bot] c8506690ce chore(release): version packages (#2453)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
ctx7@0.3.13
2026-04-14 10:51:17 +03:00
Astrazenith 3f6e310630 fix: skill installation path check compatibility for Windows (#2441)
* fix(cli): support Windows backslash in skill installation path check

* chore(cli): add changeset for Windows path check fix

* style(cli): format Windows path guard

---------

Co-authored-by: Fahreddin Özcan <ozcanfahrettinn@gmail.com>
2026-04-13 14:12:14 +03:00
github-actions[bot] c31528d0cd chore(release): version packages (#2433) @upstash/context7-mcp@2.1.8 ctx7@0.3.12 2026-04-13 03:20:32 +03:00
Fahreddin Özcan 33f2338092 Handle Codex CLI sandbox DNS failures in setup (#2449) 2026-04-12 17:10:53 -07:00
Fahreddin Özcan 00833f9262 fix(mcp): preserve default CAs with NODE_EXTRA_CA_CERTS (#2432)
* fix(mcp): support NODE_EXTRA_CA_CERTS for enterprise MITM proxies

When NODE_EXTRA_CA_CERTS is set, reads the CA certificate file and
injects it into undici's global dispatcher. This fixes fetch failures
behind enterprise transparent SSL intercept proxies (Zscaler, etc.)
where the default TLS context does not trust the corporate CA.

The CA certs are also passed through when an explicit HTTPS_PROXY is
configured, so both proxy modes work with custom certificates.

Fixes #2268

This contribution was developed with AI assistance (Claude Code).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: add changeset for NODE_EXTRA_CA_CERTS support

* fix(mcp): preserve default CAs with NODE_EXTRA_CA_CERTS

* chore: add changeset for CA trust fix

* chore: remove superseded changeset

* fix(mcp): lint test files with test tsconfig

* fix(mcp): use explicit test file path

* fix(mcp): support older Node TLS CA APIs

* test(mcp): run certificate test with vitest

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 13:05:02 +03:00
Enes Gules 09d05bca29 docs: add new integrations for Factory AI, Mastra, and Tembo with corresponding setup instructions and images (#2428) 2026-04-09 17:32:20 +03:00
github-actions[bot] 5f108ecf88 chore(release): version packages (#2425)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
ctx7@0.3.11
2026-04-09 11:51:22 +03:00
Fahreddin Özcan bc8eaf11a6 Add all-agents option for ctx7 skills install (#2424)
* Add all-agents option for ctx7 skills install

* Update docs and add changeset for skills install flags
2026-04-09 11:44:56 +03:00
github-actions[bot] 36463ad6e3 chore(release): version packages (#2351)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
ctx7@0.3.10 @upstash/context7-tools-ai-sdk@0.2.3 @upstash/context7-mcp@2.1.7
2026-04-06 20:41:52 +03:00
Enes Gules 83228794e4 docs: enhance library name guidelines in CLI and documentation (#2408) 2026-04-06 20:40:00 +03:00
Fahreddin Özcan fb29170d85 feat(cli): add Gemini CLI support to setup command (#2406)
* feat(cli): add Gemini CLI support to setup command

Adds Gemini CLI as a supported agent in `ctx7 setup`. Configures MCP
server in `.gemini/settings.json` using `httpUrl` (Gemini's HTTP
streaming transport), appends rules to `GEMINI.md`, and installs skills
to `.gemini/skills/`. Also adds a permission fix tip when skill
installation fails with EACCES.

* chore: add changeset for Gemini CLI setup
2026-04-06 15:13:45 +03:00
Enes Gules 42dedb3ab7 docs: add Policies section to on-premise documentation for public documentation access control (#2394) 2026-04-06 10:46:35 +03:00
Enes Gules 6cba6fb29b docs: update API guide and OpenAPI schema and reorder the api docs (#2388) 2026-04-02 11:51:57 +03:00
Fahreddin Özcan 89d4862ebd fix(cli): use GITHUB_TOKEN for skill downloads to avoid rate limits (#2370)
* fix(cli): use GITHUB_TOKEN for skill downloads to avoid rate limits

Closes #2363

* chore: add changeset for gh ratelimit fix

* fix(cli): fallback to gh auth token for skill downloads

Supports private repos and users with gh CLI but no env vars set.

Closes #2369

* feat(cli): support installing skills from private/unindexed repos

When the Context7 backend doesn't know about a repo, the CLI now falls
back to fetching the repo tree from GitHub directly, parsing SKILL.md
frontmatter locally, and downloading skill files. Uses GitHub API status
codes to differentiate non-existent repos from repos without skills.

Closes #2369
2026-04-02 11:25:49 +03:00
Enes Gules 2273d528bb docs: add website filters (#2333) 2026-03-30 13:24:01 +03:00
Fahreddin Özcan b4f77af910 docs: add server URL reference to README and all-clients page (#2347)
* docs: add server URL reference to README and all-clients page

The remote server URL was not easily discoverable in the docs.
This surfaces it in the README installation section and in the
all-clients page intro so users can find it without digging
through individual client configurations.

* docs: align all-clients intro with README wording

* docs: restore unlisted client fallback sentence
2026-03-30 12:15:53 +03:00
vincent 658ec6796e feat(mcp): add --version/-v flag to CLI (#2325)
* docs: add CLAUDE.md with Context7 integration guidelines

Add documentation for Claude Code integration including:
- Quick setup instructions
- Usage examples with popular libraries
- Auto-trigger rules for NestJS, Prisma, SvelteKit, etc.
- Best practices for library documentation queries

Closes #2272

* feat(mcp): add --version/-v flag to CLI

Add version flag support using Commander.js .version() method.
Uses existing SERVER_VERSION constant from package.json.

Fixes #2284

* chore: remove unrelated CLAUDE.md from PR

* chore: add changeset for mcp version flag

---------

Co-authored-by: liwenjun-dev <liwenjun.dev@gmail.com>
Co-authored-by: Fahreddin Özcan <ozcanfahrettinn@gmail.com>
2026-03-28 17:35:32 +03:00
github-actions[bot] 3b9c9b2c44 chore(release): version packages (#2346)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
ctx7@0.3.9
2026-03-28 00:33:21 +03:00