feat(mcp): server-side permission enforcement and token auth for the AlianHub MCP server#238
Merged
Conversation
…the MCP server Adds Config/permissionGuard.js — a backend mirror of the frontend permission model — so API clients (the MCP server, scripts, curl) using a valid token obey the same roles and permissions as the web app instead of bypassing checks that previously ran only in Vue. Wires the requirePermission / requireRole guards onto the task, sprint, project, member, estimated-time and security-permission routes the MCP server calls, hardens the API-token auth, and adds token-management scripts (issue / toggle / clear / print-permissions). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…t keys Adds project_folder_create and the project name/description/details/ assignee permission keys to MCP_PERMISSION_KEYS so the MCP server can perform those project operations under the server-side permission guard. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Adds server-side permission enforcement and token auth so the MCP server (and any API client — scripts, curl) obeys the same roles & permissions as the web app, instead of bypassing checks that previously ran only in the Vue frontend.
Backend
Config/permissionGuard.js(new) — a backend mirror of the frontend permission model (single source of truth). Owner/admin bypass; role ≥ 3 evaluated against the company RULES doc; three-value result (no-access / read-only / write). Includes aDISABLE_PERMISSION_ENFORCEMENTops kill-switch for the fine-grained layer (role guards stay on regardless).Config/jwt.js/Config/setMiddleware.jsandModules/ApiTokens/{controller,routes}.js.requirePermission/requireRolewired onto the endpoints the MCP server calls: Tasks, Sprints, createProject, EstimatedTime, Project list, settings/Members, settings/securityPermissions.Scripts
scripts/issue-api-token.js,toggle-api-token.js,clear-api-tokens.js,print-permissions.js— token management / inspection helpers.Verification
node --check.Notes
🤖 Generated with Claude Code