fix: use ServerVersion for connection check instead of GetMyUserInfo #112
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/OpenSpec
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
RFC - Request For Comments
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
approved
area:client-host
area:item-interaction
area:meta-tooling
area:operator-dev-loop
area:repository-hygiene
area:typescript-sdk
area:website
blocked
bug
castra:bot-active
castra:human
change
checker:tobi
close-suggested
code
copilot-conflict
deferred
dependencies
docs-ok
enhancement
fast-track
groom:close-suggested
hermes-attempted
hermes-needs-clarification
hermes-ready
hermes-review
hermes-wip
human
human-required
intake
merge
merge-conflict
needs-scope
no-concept-doc
no-demo
plan-approved
plan-needs-revision
portfolio:infrastructure
portfolio:mixed
portfolio:product
portfolio:unknown
prioritize
prioritized
priority:high
priority:low
priority:medium
propose
ready
retro
retro-proposal
review
stage:backlog
stage:blocked
stage:code
stage:done
stage:intake
stage:merge
stage:propose
stage:review
stage:waiting
status:waiting
tracker
triage
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
agentic-forges/forgejo-mcp!112
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/112/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
VerifyConnection()andHealthCheck()both callGetMyUserInfo()as a connectivity probe. This requires theread:userscope.Forgejo enforces that tokens scoped to specific repositories can only use
read:issue,write:issue,read:repository, andwrite:repository—read:useris explicitly disallowed. This causes the server to crash at startup with:This affects any user following least-privilege token practices by scoping their token to specific repositories.
Fix
Replace
GetMyUserInfo()withClient().ServerVersion(), which hits/api/v1/version. That endpoint requires no authentication at all, making it a strictly better connectivity probe: it confirms the server is reachable and the URL is correct without imposing any scope requirements on the token.The log output is adjusted accordingly —
server_versionis logged instead ofauthenticated_user.Testing
Tested against Codeberg with a repository-scoped token (issue + repository scopes only). Server starts cleanly, registers all tools, and responds to MCP handshake.