Skip to content

Invalid credentials in Authorization header #104

@eduardoworrel

Description

@eduardoworrel

Hello everyone, I was unable to complete the MCP clients step using typescript due to the following

Error: Invalid credentials in Authorization header

eduardoworrel@MacBook-Pro-de-Eduardo MCP % huggingface-cli login

    _|    _|  _|    _|    _|_|_|    _|_|_|  _|_|_|  _|      _|    _|_|_|      _|_|_|_|    _|_|      _|_|_|  _|_|_|_|
    _|    _|  _|    _|  _|        _|          _|    _|_|    _|  _|            _|        _|    _|  _|        _|
    _|_|_|_|  _|    _|  _|  _|_|  _|  _|_|    _|    _|  _|  _|  _|  _|_|      _|_|_|    _|_|_|_|  _|        _|_|_|
    _|    _|  _|    _|  _|    _|  _|    _|    _|    _|    _|_|  _|    _|      _|        _|    _|  _|        _|
    _|    _|    _|_|      _|_|_|    _|_|_|  _|_|_|  _|      _|    _|_|_|      _|        _|    _|    _|_|_|  _|_|_|_|

    A token is already saved on your machine. Run `huggingface-cli whoami` to get more information or `huggingface-cli logout` if you want to log out.
    Setting a new token will erase the existing one.
    To log in, `huggingface_hub` requires a token generated from https://huggingface.co/settings/tokens .
Enter your token (input will not be visible): 
Add token as git credential? (Y/n) y
Token is valid (permission: fineGrained).
The token `map` has been saved to /Users/eduardoworrel/.cache/huggingface/stored_tokens
Your token has been saved in your configured git credential helpers (osxkeychain).
Your token has been saved to /Users/eduardoworrel/.cache/huggingface/token
Login successful.
The current active token is: `map`
eduardoworrel@MacBook-Pro-de-Eduardo MCP % npx @huggingface/tiny-agents run ./agent
Agent loaded with 25 tools:
- browser_close
- browser_resize
- browser_console_messages
- browser_handle_dialog
- browser_file_upload
- browser_install
- browser_press_key
- browser_navigate
- browser_navigate_back
- browser_navigate_forward
- browser_network_requests
- browser_pdf_save
- browser_take_screenshot
- browser_snapshot
- browser_click
- browser_drag
- browser_hover
- browser_type
- browser_select_option
- browser_tab_list
- browser_tab_new
- browser_tab_select
- browser_tab_close
- browser_generate_playwright_test
- browser_wait_for
> do a Web Search for HF inference providers on Brave Search and open the first result and then give me the list of the inference providers supported on Hugging Face

/Users/eduardoworrel/Documents/agents/MCP/node_modules/@huggingface/tiny-agents/dist/cli.js:120
    throw err;
    ^

Error: Invalid credentials in Authorization header
    at innerStreamingRequest (/Users/eduardoworrel/Documents/agents/MCP/node_modules/@huggingface/inference/dist/commonjs/utils/request.js:57:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async chatCompletionStream (/Users/eduardoworrel/Documents/agents/MCP/node_modules/@huggingface/inference/dist/commonjs/tasks/nlp/chatCompletionStream.js:13:5)
    at async Agent.processSingleTurnWithTools (/Users/eduardoworrel/Documents/agents/MCP/node_modules/@huggingface/mcp-client/dist/src/index.js:198:22)
    at async Agent.run (/Users/eduardoworrel/Documents/agents/MCP/node_modules/@huggingface/mcp-client/dist/src/index.js:328:9)
    at async mainCliLoop (/Users/eduardoworrel/Documents/agents/MCP/node_modules/@huggingface/tiny-agents/dist/cli.js:131:22)
    at async main (/Users/eduardoworrel/Documents/agents/MCP/node_modules/@huggingface/tiny-agents/dist/cli.js:301:5)

Node.js v22.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions