mirror of
https://github.com/upstash/context7.git
synced 2025-06-26 23:50:04 +00:00
feat: increase default minimum tokens from 5000 to 10000 and update documentation
This commit is contained in:
parent
48fa03ccde
commit
99a74eb5ee
@ -232,7 +232,7 @@ If you prefer to run the MCP server in a Docker container:
|
||||
|
||||
### Environment Variables
|
||||
|
||||
- `DEFAULT_MINIMUM_TOKENS`: Set the minimum token count for documentation retrieval (default: 5000).
|
||||
- `DEFAULT_MINIMUM_TOKENS`: Set the minimum token count for documentation retrieval (default: 10000).
|
||||
|
||||
Examples:
|
||||
|
||||
@ -257,7 +257,7 @@ Examples:
|
||||
- `get-library-docs`: Fetches documentation for a library using a Context7-compatible library ID.
|
||||
- `context7CompatibleLibraryID` (required)
|
||||
- `topic` (optional): Focus the docs on a specific topic (e.g., "routing", "hooks")
|
||||
- `tokens` (optional, default 5000): Max number of tokens to return. Values less than the configured `DEFAULT_MINIMUM_TOKENS` value are automatically increased to that value.
|
||||
- `tokens` (optional, default 10000): Max number of tokens to return. Values less than the configured `DEFAULT_MINIMUM_TOKENS` value or the default value of 10000 are automatically increased to that value.
|
||||
|
||||
## Development
|
||||
|
||||
|
@ -234,7 +234,7 @@ Wenn du den MCP-Server lieber in einem Docker-Container ausführen möchtest:
|
||||
- `get-library-docs`: Ruft die Dokumentation für eine Bibliothek mit einer Context7-kompatiblen Bibliotheks-ID ab.
|
||||
- `context7CompatibleLibraryID` (erforderlich)
|
||||
- `topic` (optional): Fokussiert die Dokumentation auf ein bestimmtes Thema (z.B. "routing", "hooks")
|
||||
- `tokens` (optional, Standard 5000): Maximale Anzahl von zurückzugebenden Tokens. Werte unter 5000 werden automatisch auf 5000 erhöht.
|
||||
- `tokens` (optional, Standard 10000): Maximale Anzahl von zurückzugebenden Tokens. Werte unter 10000 werden automatisch auf 10000 erhöht.
|
||||
|
||||
## Entwicklung
|
||||
|
||||
|
@ -160,7 +160,7 @@ Añade esto a tu archivo `claude_desktop_config.json` de Claude Desktop. Consult
|
||||
- `get-library-docs`: Obtiene documentación para una biblioteca utilizando un ID de biblioteca compatible con Context7.
|
||||
- `context7CompatibleLibraryID` (requerido)
|
||||
- `topic` (opcional): Enfoca la documentación en un tema específico (p. ej., "routing", "hooks")
|
||||
- `tokens` (opcional, por defecto 5000): Número máximo de tokens a devolver. Los valores inferiores a 5000 se aumentan automáticamente a 5000.
|
||||
- `tokens` (opcional, por defecto 10000): Número máximo de tokens a devolver. Los valores inferiores a 10000 se aumentan automáticamente a 10000.
|
||||
|
||||
## Desarrollo
|
||||
|
||||
|
@ -234,7 +234,7 @@ Si vous préférez exécuter le serveur MCP dans un conteneur Docker :
|
||||
- `get-library-docs` : Récupère la documentation d’une bibliothèque via un ID Context7.
|
||||
- `context7CompatibleLibraryID` (obligatoire)
|
||||
- `topic` (optionnel) : Focaliser la doc sur un sujet précis (ex : "routing", "hooks")
|
||||
- `tokens` (optionnel, par défaut 5000) : Nombre max de tokens à retourner. Les valeurs < 5000 sont automatiquement augmentées à 5000.
|
||||
- `tokens` (optionnel, par défaut 10000) : Nombre max de tokens à retourner. Les valeurs < 10000 sont automatiquement augmentées à 10000.
|
||||
|
||||
## Développement
|
||||
|
||||
|
@ -238,7 +238,7 @@ Jika Anda lebih suka menjalankan server MCP dalam kontainer Docker:
|
||||
- `get-library-docs`: Mengambil dokumentasi untuk library menggunakan ID library yang kompatibel dengan Context7.
|
||||
- `context7CompatibleLibraryID` (wajib)
|
||||
- `topic` (opsional): Fokuskan dokumentasi pada topik tertentu (misalnya, "routing", "hooks")
|
||||
- `tokens` (opsional, default 5000): Jumlah maksimum token yang akan dihasilkan. Nilai kurang dari 5000 secara otomatis ditingkatkan menjadi 5000.
|
||||
- `tokens` (opsional, default 10000): Jumlah maksimum token yang akan dihasilkan. Nilai kurang dari 10000 secara otomatis ditingkatkan menjadi 10000.
|
||||
|
||||
## Pengembangan
|
||||
|
||||
|
@ -237,7 +237,7 @@ Se preferisci eseguire il server MCP in un contenitore Docker:
|
||||
- `get-library-docs`: Recupera la documentazione per una libreria utilizzando un ID di libreria compatibile con Context7.
|
||||
- `context7CompatibleLibraryID` (obbligatorio)
|
||||
- `topic` (opzionale): Concentra la documentazione su un argomento specifico (es., "routing", "hooks")
|
||||
- `tokens` (opzionale, predefinito 5000): Numero massimo di token da restituire. I valori inferiori a 5000 vengono automaticamente aumentati a 5000.
|
||||
- `tokens` (opzionale, predefinito 10000): Numero massimo di token da restituire. I valori inferiori a 10000 vengono automaticamente aumentati a 10000.
|
||||
|
||||
## Sviluppo
|
||||
|
||||
|
@ -156,7 +156,7 @@ Claude Desktop의 `claude_desktop_config.json` 파일에 다음을 추가하세
|
||||
- `get-library-docs`: Context7이 인식하는 라이브러리 ID를 사용하여 해당 라이브러리의 문서를 가져옵니다.
|
||||
- `context7CompatibleLibraryID` (필수)
|
||||
- `topic` (선택): 특정 주제의 문서만 가져오기 (예: "routing", "hooks")
|
||||
- `tokens` (선택, 기본값 5000): 가져올 문서의 최대 토큰 수. 5000 미만으로 설정하면 자동으로 5000으로 조정됨
|
||||
- `tokens` (선택, 기본값 10000): 가져올 문서의 최대 토큰 수. 10000 미만으로 설정하면 자동으로 10000으로 조정됨
|
||||
|
||||
## 개발
|
||||
|
||||
|
@ -237,7 +237,7 @@ Se você preferir executar o servidor MCP em um contêiner Docker:
|
||||
- `get-library-docs`: Busca documentação para uma biblioteca usando um ID de biblioteca compatível com Context7.
|
||||
- `context7CompatibleLibraryID` (obrigatório)
|
||||
- `topic` (opcional): Concentra a documentação em um tópico específico (por exemplo, "routing", "hooks")
|
||||
- `tokens` (opcional, padrão 5000): Número máximo de tokens a retornar. Valores menores que 5000 são automaticamente aumentados para 5000.
|
||||
- `tokens` (opcional, padrão 10000): Número máximo de tokens a retornar. Valores menores que 10000 são automaticamente aumentados para 10000.
|
||||
|
||||
## Desenvolvimento
|
||||
|
||||
|
@ -216,7 +216,7 @@ claude mcp add context7 -- npx -y @upstash/context7-mcp@latest
|
||||
- `get-library-docs`: 使用Context7兼容的库ID获取库的文档。
|
||||
- `context7CompatibleLibraryID` (必需)
|
||||
- `topic` (可选): 将文档集中在特定主题上(例如"routing"、"hooks")
|
||||
- `tokens` (可选,默认5000): 返回的最大令牌数。小于5000的值会自动增加到5000。
|
||||
- `tokens` (可选,默认10000): 返回的最大令牌数。小于10000的值会自动增加到10000。
|
||||
|
||||
## 开发
|
||||
|
||||
|
@ -11,14 +11,14 @@ import dotenv from "dotenv";
|
||||
dotenv.config();
|
||||
|
||||
// Get DEFAULT_MINIMUM_TOKENS from environment variable or use default
|
||||
let DEFAULT_MINIMUM_TOKENS = 5000;
|
||||
let DEFAULT_MINIMUM_TOKENS = 10000;
|
||||
if (process.env.DEFAULT_MINIMUM_TOKENS) {
|
||||
const parsedValue = parseInt(process.env.DEFAULT_MINIMUM_TOKENS, 10);
|
||||
if (!isNaN(parsedValue) && parsedValue > 0) {
|
||||
DEFAULT_MINIMUM_TOKENS = parsedValue;
|
||||
} else {
|
||||
console.error(
|
||||
`Warning: Invalid DEFAULT_MINIMUM_TOKENS value provided in environment variable. Using default value of 5000`
|
||||
console.warn(
|
||||
`Warning: Invalid DEFAULT_MINIMUM_TOKENS value provided in environment variable. Using default value of 10000`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user