File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ import { stdin, stdout } from "node:process";
4
4
import { join } from "node:path" ;
5
5
import { homedir } from "node:os" ;
6
6
import type { StdioServerParameters } from "@modelcontextprotocol/sdk/client/stdio.js" ;
7
- import type { ServerConfig } from "./src/types" ;
8
7
import type { InferenceProviderOrPolicy } from "@huggingface/inference" ;
9
8
import { ANSI , urlToServerConfig } from "./src/utils" ;
10
9
import { Agent } from "./src" ;
11
10
import { version as packageVersion } from "./package.json" ;
12
11
import { parseArgs } from "node:util" ;
12
+ import type { ServerConfig } from "./src/types" ;
13
13
14
14
const MODEL_ID = process . env . MODEL_ID ?? "Qwen/Qwen2.5-72B-Instruct" ;
15
15
const PROVIDER = ( process . env . PROVIDER as InferenceProviderOrPolicy ) ?? "nebius" ;
@@ -49,7 +49,7 @@ if (urls?.length) {
49
49
}
50
50
for ( const url of urls ) {
51
51
try {
52
- SERVERS . push ( urlToServerConfig ( url ) ) ;
52
+ SERVERS . push ( urlToServerConfig ( url , process . env . HF_TOKEN ) ) ;
53
53
} catch ( error ) {
54
54
console . error ( `Error adding server from URL "${ url } ": ${ error . message } ` ) ;
55
55
}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export const ANSI = {
15
15
RESET : "\x1b[0m" ,
16
16
} ;
17
17
18
- export function urlToServerConfig ( urlStr : string , token ?: string ) : ServerConfig {
18
+ export function urlToServerConfig ( urlStr : string , authToken ?: string ) : ServerConfig {
19
19
if ( ! urlStr . startsWith ( "http:" ) && ! urlStr . startsWith ( "https:" ) ) {
20
20
throw new Error ( `Unsupported URL format: ${ urlStr } . Use http:// or https:// prefix.` ) ;
21
21
}
@@ -34,7 +34,6 @@ export function urlToServerConfig(urlStr: string, token?: string): ServerConfig
34
34
}
35
35
36
36
// Check if we should include the token
37
- const authToken = token ?? process . env . HF_TOKEN ;
38
37
const shouldIncludeToken =
39
38
! ! authToken &&
40
39
( hostname . endsWith ( ".hf.space" ) ||
You can’t perform that action at this time.
0 commit comments