gemini-cli - 💡(How to fix) Fix JSON 설정 파일 내 MCP 서버 설정이 일부 무시되거나 로드되지 않는 현상 (Windows 환경) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#25675Fetched 2026-04-20 12:15:33
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Error Message

Error in C:\프로젝트경로.gemini\settings.json: Unexpected token '', "{ Error in C:\프로젝트경로.gemini\settings.json: Unexpected token '', "{

Code Example

Error in C:\프로젝트경로\.gemini\settings.json: Unexpected token '', "{
  "mcpS"... is not valid JSON
Please fix the configuration file(s) and try again.

---

Error in C:\프로젝트경로\.gemini\settings.json: Unexpected token '', "{
  "mcpS"... is not valid JSON
Please fix the configuration file(s) and try again.
RAW_BUFFERClick to expand / collapse

What happened?

Windows 환경에서 .gemini/settings.json 파일을 사용하여 MCP 서버(notion, sequential-thinking, notifier)를 등록했습니다.

  1. 현상:

    • 설정 파일에 3개의 MCP 서버를 정상적인 JSON 문법으로 작성했음에도 불구하고, Gemini CLI 내부에서 /mcp list를 실행하면 일부 서버(특히 마지막에 추가한 서버)가 누락되어 2개만 표시됩니다.
    • 설정 파일은 BOM(Byte Order Mark)이 없는 순수 UTF-8 형식임을 바이트 단위로 검증 완료하였습니다 ({로 시작).
    • 특정 서버 설정이 로드되지 않거나, Disconnected 상태로 방치되는 등의 불안정한 연결 현상이 반복됩니다.
  2. 환경:

    • OS: Windows 10/11
    • MCP 서버 설정: node 명령어를 이용한 로컬 실행 방식 (stdio transport)
  3. 에러 메세지:

 Error in C:\프로젝트경로\.gemini\settings.json: Unexpected token '', "{
"mcpS"... is not valid JSON
Please fix the configuration file(s) and try again.
  1. 기대 결과:

    • 설정 파일에 정의된 모든 MCP 서버가 인식되어야 합니다.
    • MCP 서버 로드 시 인코딩(BOM) 문제로 인해 전체 설정 파일이 거부되는 대신, 문제 있는 설정만 경고하고 나머지 설정은 로드되어야 합니다.
  2. 추가 제보:

    • 현재 Gemini CLI는 설정 파일의 시작 부분에 BOM이 미세하게 포함되거나, JSON 형식이 아주 엄격할 경우 해당 파일 전체를 무시하거나 파싱 에러를 발생시키는 것으로 보입니다. 개발자 경험(DX)을 위해 JSON 파서의 유연성을 높여주기를 요청합니다.

What did you expect to happen?

Windows 환경에서 .gemini/settings.json 파일을 사용하여 MCP 서버(notion, sequential-thinking, notifier)를 등록했습니다.

  1. 현상:

    • 설정 파일에 3개의 MCP 서버를 정상적인 JSON 문법으로 작성했음에도 불구하고, Gemini CLI 내부에서 /mcp list를 실행하면 일부 서버(특히 마지막에 추가한 서버)가 누락되어 2개만 표시됩니다.
    • 설정 파일은 BOM(Byte Order Mark)이 없는 순수 UTF-8 형식임을 바이트 단위로 검증 완료하였습니다 ({로 시작).
    • 특정 서버 설정이 로드되지 않거나, Disconnected 상태로 방치되는 등의 불안정한 연결 현상이 반복됩니다.
  2. 환경:

    • OS: Windows 10/11
    • MCP 서버 설정: node 명령어를 이용한 로컬 실행 방식 (stdio transport)
  3. 에러 메세지:

 Error in C:\프로젝트경로\.gemini\settings.json: Unexpected token '', "{
"mcpS"... is not valid JSON
Please fix the configuration file(s) and try again.
  1. 기대 결과:

    • 설정 파일에 정의된 모든 MCP 서버가 인식되어야 합니다.
    • MCP 서버 로드 시 인코딩(BOM) 문제로 인해 전체 설정 파일이 거부되는 대신, 문제 있는 설정만 경고하고 나머지 설정은 로드되어야 합니다.
  2. 추가 제보:

    • 현재 Gemini CLI는 설정 파일의 시작 부분에 BOM이 미세하게 포함되거나, JSON 형식이 아주 엄격할 경우 해당 파일 전체를 무시하거나 파싱 에러를 발생시키는 것으로 보입니다. 개발자 경험(DX)을 위해 JSON 파서의 유연성을 높여주기를 요청합니다.

Client information

  • CLI Version: 0.38.2
  • Git Commit: b0ed611a0
  • Session ID: 385af5ee-bd9c-4809-84de-c5be1ded0a03
  • Operating System: win32 v24.14.0
  • Sandbox Environment: no sandbox
  • Model Version: gemini-3.1-flash-lite-preview
  • Auth Type: oauth-personal
  • Memory Usage: 306.1 MB
  • Terminal Name: Unknown
  • Terminal Background: #0c0c0c
  • Kitty Keyboard Protocol: Unsupported

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

The issue can be fixed by removing the zero-width space character ('') from the beginning of the JSON configuration file.

Guidance

  • Verify that the JSON configuration file does not contain any invisible characters, such as zero-width spaces, by opening it in a text editor that can display these characters.
  • Remove any invisible characters from the beginning of the file to ensure it starts with a valid JSON syntax.
  • Consider using a JSON linter or validator to check the configuration file for any syntax errors.
  • If the issue persists, try saving the configuration file with a different encoding, such as UTF-8 without BOM, to rule out any encoding-related issues.

Example

No code snippet is provided as the issue is related to a specific character in the configuration file.

Notes

The error message indicates that there is an unexpected token '' at the beginning of the JSON configuration file, which suggests that there is a zero-width space character present. Removing this character should resolve the issue.

Recommendation

Apply workaround: Remove the zero-width space character from the beginning of the JSON configuration file. This should allow the Gemini CLI to parse the configuration file correctly and load all the defined MCP servers.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING