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";
44import { join } from "node:path" ;
55import { homedir } from "node:os" ;
66import type { StdioServerParameters } from "@modelcontextprotocol/sdk/client/stdio.js" ;
7- import type { ServerConfig } from "./src/types" ;
87import type { InferenceProviderOrPolicy } from "@huggingface/inference" ;
98import { ANSI , urlToServerConfig } from "./src/utils" ;
109import { Agent } from "./src" ;
1110import { version as packageVersion } from "./package.json" ;
1211import { parseArgs } from "node:util" ;
12+ import type { ServerConfig } from "./src/types" ;
1313
1414const MODEL_ID = process . env . MODEL_ID ?? "Qwen/Qwen2.5-72B-Instruct" ;
1515const PROVIDER = ( process . env . PROVIDER as InferenceProviderOrPolicy ) ?? "nebius" ;
@@ -49,7 +49,7 @@ if (urls?.length) {
4949 }
5050 for ( const url of urls ) {
5151 try {
52- SERVERS . push ( urlToServerConfig ( url ) ) ;
52+ SERVERS . push ( urlToServerConfig ( url , process . env . HF_TOKEN ) ) ;
5353 } catch ( error ) {
5454 console . error ( `Error adding server from URL "${ url } ": ${ error . message } ` ) ;
5555 }
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export const ANSI = {
1515 RESET : "\x1b[0m" ,
1616} ;
1717
18- export function urlToServerConfig ( urlStr : string , token ?: string ) : ServerConfig {
18+ export function urlToServerConfig ( urlStr : string , authToken ?: string ) : ServerConfig {
1919 if ( ! urlStr . startsWith ( "http:" ) && ! urlStr . startsWith ( "https:" ) ) {
2020 throw new Error ( `Unsupported URL format: ${ urlStr } . Use http:// or https:// prefix.` ) ;
2121 }
@@ -34,7 +34,6 @@ export function urlToServerConfig(urlStr: string, token?: string): ServerConfig
3434 }
3535
3636 // Check if we should include the token
37- const authToken = token ?? process . env . HF_TOKEN ;
3837 const shouldIncludeToken =
3938 ! ! authToken &&
4039 ( hostname . endsWith ( ".hf.space" ) ||
You can’t perform that action at this time.
0 commit comments