86 Commits

Author SHA1 Message Date
enesgules
22bff079e0 fix: log sse every 100 requests 2025-10-30 11:51:29 +03:00
enesgules
7f86335cfa feat: log sse usage counter 2025-10-30 11:46:03 +03:00
enesgules
cd27582d61 feat: add deprecation notice for SSE transport users 2025-10-24 10:15:13 +03:00
enesgules
d43a64bc24 feat: add API key signup prompt to rate limit error messages if no api key is provided 2025-10-23 17:21:10 +03:00
enesgules
3c88f70291 refactor: remove integration tests 2025-10-07 14:46:15 +03:00
Cedric Hurst
1324ee14b2 test: add integration tests for CONTEXT7_API_KEY env var
- Add bun test infrastructure
- Test env var fallback behavior
- Test CLI flag precedence over env var
- Test operation without API key
- Test HTTP transport blocks --api-key flag

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-02 18:48:03 -05:00
Cedric Hurst
aa8f407906 feat: add CONTEXT7_API_KEY environment variable support
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-02 18:38:17 -05:00
enesgules
a170272c20 fix(api): improve error handling and logging for API responses 2025-09-27 18:23:00 +03:00
enesgules
63d2da0d9a fix(api): enhance unauthorized error message to include API key details 2025-09-27 17:25:44 +03:00
enesakar
4af3d6a46e docs(index): clarify version format in prompt
fixes CTX7-552
2025-09-25 10:41:42 -07:00
enesgules
217206c45f fix: improve URL parsing 2025-09-11 12:52:32 +03:00
enesgules
d959881167 feat: add connection initialization and standardize JSON error responses 2025-09-11 02:32:26 +03:00
enesgules
2730926ba6 feat: add cleanup handlers for transport and server on request close 2025-09-09 16:14:38 +03:00
enesgules
02d87cf33f refactor: update token limits and improve constant organization for documentation retrieval 2025-09-05 14:09:55 +03:00
enesgules
87306c876a fix: reduce default minimum token threshold from 10000 to 1000 2025-09-05 13:53:29 +03:00
enesgules
288d853048 refactor: change PROXY_URL to const and remove unnecessary type cast in ProxyAgent 2025-08-21 14:21:22 +03:00
Enes Gules
2edd546ec3
Merge branch 'master' into add-proxy 2025-08-21 13:07:10 +03:00
enesgules
1bf5f4fdeb feat: add support for case-insensitive API key headers and improve error handling 2025-08-19 17:53:06 +03:00
Scott Register
df2a8f9fae Honor https_proxy environment variables
If standard https_proxy environment variables exist, make proxied
requests to https://context7.com/api
2025-08-18 07:51:03 -07:00
enesgules
0e9ced5cea feat: add validation for transport-specific CLI flags 2025-08-13 09:37:32 +03:00
enesgules
3ddfe52e01 feat: reorganize IDE installation docs and standardize API key header formats 2025-08-12 16:26:33 +03:00
enesgules
75f5cbe1dc fix: update API base URL from localhost to production endpoint 2025-08-12 15:58:49 +03:00
enesgules
e42062d086 chore: update readme and tool titles 2025-08-12 15:33:59 +03:00
enesgules
20711bab91 refactor: header generation logic 2025-08-12 15:33:47 +03:00
enesgules
00ee0c7936 Merge remote-tracking branch 'origin/master' into feat/refactor-mcp-usage 2025-08-12 15:21:52 +03:00
enesgules
542c1a01e7 chore: remov unnecessary export keywords, format readme 2025-08-09 15:14:34 +03:00
buggyhunter
96be3f629d CTX7-272: ip address header 2025-08-01 12:50:16 +03:00
buggyhunter
68143b6509 CTX7-272: ip address header 2025-08-01 12:45:55 +03:00
enesgules
5a56b02e6b chore(format): run prettier 2025-07-23 11:53:37 +03:00
Nilanjan De
6d191d0141
fix: keep lower-cased headers as well 2025-07-21 20:15:33 +05:30
Nilanjan De
01a3eb0af5
fix: add MCP-Protocol-Version to CORS accept headers 2025-07-21 20:09:53 +05:30
Nilanjan De
31e659d63f
Correct CORS headers required for connecting from browser based MCP Clients 2025-07-21 14:21:54 +04:00
enesgules
2ba1b61960 refactor: header generation and ip encryption 2025-07-18 20:15:16 +03:00
buggyhunter
8b884f2a38 CTX7-272: ip address header 2025-07-18 19:28:55 +03:00
buggyhunter
ddac8928a6 CTX7-272: ip address header 2025-07-18 19:26:52 +03:00
buggyhunter
294df1d487 CTX7-272: ip address header 2025-07-18 19:24:48 +03:00
buggyhunter
086d4c2083 CTX7-272: ip address header 2025-07-18 19:21:46 +03:00
buggyhunter
7afcced137 CTX7-272: ip address header 2025-07-18 19:01:03 +03:00
buggyhunter
52a62e6129 CTX7-272: ip address header 2025-07-18 18:18:55 +03:00
buggyhunter
e1b6d7caae CTX7-272: ip address header 2025-07-18 11:10:45 +03:00
enesgules
5d5288cd1e feat: add Bearer token support in Authorization header for API authentication 2025-07-01 17:55:43 +03:00
enesgules
2896baa1ce refactor: update API authentication to use Bearer token format, format readme 2025-07-01 17:08:20 +03:00
enesgules
920c025d95 refactor: deprecate sse cli argument 2025-07-01 17:04:05 +03:00
enesgules
b8086438a6 feat: add API key support for authentication across all transports 2025-07-01 15:41:31 +03:00
enesgules
764765dd4e chore: bum @modelcontextprotocol/sdk to version 1.13.2 and refactor server tool registration in index.ts 2025-06-30 16:21:06 +03:00
Niel Thiart
fd2a2d6299
fix: Fix InitializeResult schema mismatch in Context7 server response
The response from the server was not matching the expected `InitializeResult` schema [^1].

1. The `serverInfo` field contained a `description` that was not part of the schema.
2. The `capabilities` field was incorrectly nested in `serverInfo`.
3. The `capabilities` field in the response included `resources`, even though this server does not support resources.

This change also adds an `instructions` field to the response, which provides guidance on how to use the server.

The SDK takes care of registering capabilities [^2], so we don't need to add this when instantiating the `server` object.

Response does not match `InitializeResult` schema:

```json
{
  "capabilities": {
    "tools": {
      "listChanged": true
    }
  },
  "serverInfo": {
    "name": "Context7",
    "version": "1.0.13",
    "description": "Retrieves up-to-date documentation and code examples for any library.",
    "capabilities": {
      "resources": {},
      "tools": {}
    }
  }
}
```

Response matches `InitializeResult` schema:

```json
{
  "capabilities": {
    "tools": {
      "listChanged": true
    }
  },
  "serverInfo": {
    "name": "Context7",
    "version": "1.0.13"
  },
  "instructions": "Use this server to retrieve up-to-date documentation and code examples for any library."
}
```

[^1]: https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-03-26/schema.ts#L179-L193

[^2]: 2cf4f0ca86/src/server/mcp.ts (L101)

Fixes https://github.com/upstash/context7/issues/282
2025-06-12 12:06:35 +02:00
Abdusshh
4f04e02851 refactor: replace url.parse with URL API for session ID extraction and validate transports 2025-06-11 14:58:26 +03:00
Abdusshh
2e6c9a6c6b feat: replace env vars with CLI arguments, remove dotenv and add commander 2025-06-11 14:49:50 +03:00
Abdusshh
a7b11bbee7 feat: improve error handling and response types for library search and documentation fetch 2025-06-07 00:20:52 +03:00
Abdusshh
d513d1a59f feat: add port fallback mechanism when initial port is in use 2025-05-28 14:37:30 +03:00