Skip to content

feat(api): native MCP (Model Context Protocol) server - #41082

Merged
dionisio-bot[bot] merged 18 commits into
developfrom
feat/native-mcp-server
Aug 18, 2026
Merged

feat(api): native MCP (Model Context Protocol) server#41082
dionisio-bot[bot] merged 18 commits into
developfrom
feat/native-mcp-server

Conversation

@rodrigok

@rodrigok rodrigok commented Jun 25, 2026

Copy link
Copy Markdown
Member

Proposed changes

Adds a native Model Context Protocol server that lets MCP-capable clients use a bounded set of Rocket.Chat REST operations over JSON-RPC 2.0 and Streamable HTTP.

The implementation is enterprise code under apps/meteor/ee/server/api/mcp and intentionally reuses Rocket.Chat's existing REST route metadata, authentication, permission checks, validation, rate limiting, and audit behavior. It adds no runtime dependency and does not expose the full REST API.

How it works

  • Registers POST /api/v1/mcp as an authenticated API route. GET returns 405 Allow: POST because this stateless implementation does not expose an SSE stream.
  • Supports initialize, ping, tools/list, tools/call, and JSON-RPC notifications and batches.
  • Derives MCP tool names, descriptions, and input schemas from typed REST route metadata.
  • Exposes a small curated catalog by default and an explicitly allow-listed extended catalog when enabled.
  • Dispatches tool calls through the existing REST layer as the authenticated user, preserving endpoint validation and authorization.
  • Validates browser Origin values against the workspace origin or explicitly configured CORS origins to protect the local HTTP transport from DNS rebinding. Native clients without an Origin header remain supported.
  • Validates supported MCP-Protocol-Version values while retaining compatibility with clients that omit the header.
  • Applies a 20-second dispatch timeout, 5 MiB REST-body and final-response limits, bounded batches, redirect rejection, path-prefix support, and the existing REST rate limits.

Access control

The endpoint requires all of the following:

  1. Personal Access Token authentication using X-User-Id and X-Auth-Token; regular session tokens are rejected.
  2. The Rocket.Chat AI add-on license module (chat.rocket.rc-ai).
  3. The access-mcp permission, granted to admin by default.
  4. The MCP_Enabled setting, which is off by default.

Administration

MCP is configured from Administration → AI Center → MCP.

  • Enable MCP endpoint enables /api/v1/mcp.
  • Expose extended MCP toolset switches from the curated catalog to the bounded extended allow list. Its warning explains that the additional tools can modify workspace data.

The feature is labeled alpha and remains disabled by default. Its capabilities and configuration may evolve as feedback is collected.

Testing

  • 37 focused unit tests cover route registration and gates, transport security, JSON-RPC behavior, notifications and bounded-concurrency batches, catalog generation, schema normalization, dispatch failures, per-tool and aggregate response limits, and catalog selection. The shared CORS middleware's six tests cover the negotiated protocol header in browser preflight responses.
  • Focused MCP tests pass with 94.09% statement coverage and 100% function coverage.
  • Targeted ESLint, localization lint, Meteor typecheck, and REST typings typecheck/lint pass.
  • Live local protocol checks cover initialization, catalog discovery, tool calls, unsupported protocol versions, hostile origins, GET behavior, and bodyless notifications.
  • The extended catalog was audited against disposable local fixtures: all 68 write tools were exercised and cleaned up, and read-tool behavior was verified, including expected setting-dependent failures.

Documentation

See docs/features/mcp-server.md for client configuration, security behavior, tool catalogs, protocol details, and troubleshooting.

Manual smoke test

curl -s http://localhost:3000/api/v1/mcp \
  -H 'Content-Type: application/json' \
  -H 'X-User-Id: <user-id>' \
  -H 'X-Auth-Token: <personal-access-token>' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"smoke-test","version":"1.0.0"}}}'

Summary by CodeRabbit

  • New Features
    • Added an alpha, disabled-by-default MCP server endpoint for AI tool discovery and execution.
    • Added AI Center controls for enabling MCP and exposing extended tools.
    • Added permission and personal access token authentication support.
    • Added origin, protocol, request-size, timeout, and response validation safeguards.
  • Documentation
    • Added MCP configuration, usage, authentication, limitations, and client connection guidance.
  • Bug Fixes
    • Updated CORS handling to advertise MCP protocol support only when enabled.

@dionisio-bot

dionisio-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 265deb9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@rocket.chat/i18n Minor
@rocket.chat/meteor Minor
@rocket.chat/rest-typings Minor
@rocket.chat/mock-providers Patch
@rocket.chat/ui-contexts Major
@rocket.chat/web-ui-registration Major
@rocket.chat/uikit-playground Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/ui-voip Major
@rocket.chat/ui-composer Major
@rocket.chat/core-typings Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e26a1896-3d49-4d1f-8742-e448e968f175

📥 Commits

Reviewing files that changed from the base of the PR and between 241c18c and ce3dafb.

📒 Files selected for processing (13)
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/server.ts
  • apps/meteor/ee/server/startup/index.ts
  • apps/meteor/ee/server/startup/mcp.ts
  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
  • docs/features/mcp-server.md
  • packages/model-typings/src/models/IUsersModel.ts
  • packages/models/src/models/Users.ts
💤 Files with no reviewable changes (1)
  • apps/meteor/ee/server/api/mcp/server.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • apps/meteor/ee/server/api/mcp/index.ts
  • docs/features/mcp-server.md
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
⚠️ CI failures not shown inline (5)

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/ee/server/startup/mcp.ts
  • packages/models/src/models/Users.ts
  • apps/meteor/ee/server/startup/index.ts
  • packages/model-typings/src/models/IUsersModel.ts
  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
apps/meteor/**

📄 CodeRabbit inference engine (CLAUDE.md)

The main Rocket.Chat Meteor application resides in apps/meteor/; place its application code there rather than in other monorepo areas.

Files:

  • apps/meteor/ee/server/startup/mcp.ts
  • apps/meteor/ee/server/startup/index.ts
  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
packages/**

📄 CodeRabbit inference engine (CLAUDE.md)

Shared libraries belong in packages/, while other services belong in apps/ and ee/.

Files:

  • packages/models/src/models/Users.ts
  • packages/model-typings/src/models/IUsersModel.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
🧠 Learnings (10)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/ee/server/startup/mcp.ts
  • packages/models/src/models/Users.ts
  • apps/meteor/ee/server/startup/index.ts
  • packages/model-typings/src/models/IUsersModel.ts
  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/ee/server/startup/mcp.ts
  • packages/models/src/models/Users.ts
  • apps/meteor/ee/server/startup/index.ts
  • packages/model-typings/src/models/IUsersModel.ts
  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/ee/server/startup/mcp.ts
  • packages/models/src/models/Users.ts
  • apps/meteor/ee/server/startup/index.ts
  • packages/model-typings/src/models/IUsersModel.ts
  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
📚 Learning: 2026-05-09T13:18:06.264Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40274
File: packages/models/src/models/Users.ts:1104-1107
Timestamp: 2026-05-09T13:18:06.264Z
Learning: In `packages/models/src/models/Users.ts` (RocketChat/Rocket.Chat), `updatePresenceAndStatus` intentionally uses the `BaseRaw.findOneAndUpdate` wrapper (which updates `_updatedAt`) because the method performs real document mutations (status claims, previousState, statusExpiresAt, etc.). Only `updateStatusById` deliberately bypasses `_updatedAt` via `this.col.updateOne` — specifically to use `_updatedAt` as a change-detection sentinel, not as a general "avoid churn" policy. Do not flag `updatePresenceAndStatus` for using the wrapper.

Applied to files:

  • packages/models/src/models/Users.ts
📚 Learning: 2026-07-15T01:31:50.632Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 41382
File: packages/model-typings/src/models/IPushTokenModel.ts:10-10
Timestamp: 2026-07-15T01:31:50.632Z
Learning: In Rocket.Chat’s push-token model, APNs/GCM standard tokens and PushKit VoIP tokens use distinct, globally-unique token string values. As a result, when deduplicating/looking up tokens, key identity solely on `{ tokenValue, appName }` (e.g., for `findOneByTokenAndAppName`, `removeDuplicateTokens`) and do **not** include `tokenType` in the uniqueness criteria to avoid collisions between standard and VoIP tokens.

Applied to files:

  • packages/models/src/models/Users.ts
  • packages/model-typings/src/models/IUsersModel.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
📚 Learning: 2026-07-31T02:44:35.111Z
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 41635
File: apps/meteor/ee/server/api/sessions.ts:114-138
Timestamp: 2026-07-31T02:44:35.111Z
Learning: In Rocket.Chat typed REST response schemas, accept the composition of a Typia-generated entity schema with an `allOf` branch requiring `success: true`: `allOf: [{ $ref: <entity schema> }, { properties: { success: { type: 'boolean', enum: [true] } }, required: ['success'] }]`. Do not flag this pattern when used for REST endpoints, provided TEST_MODE response validation passes, as demonstrated by the `IOAuthApps` and `IEmailInbox` endpoints.

Applied to files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
📚 Learning: 2026-08-05T22:02:59.828Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 41707
File: apps/meteor/server/hooks/messages/processThreads.ts:66-68
Timestamp: 2026-08-05T22:02:59.828Z
Learning: In Rocket.Chat Meteor server code, `callbacks.runAsync` returns its input item rather than the asynchronous callback promise. Callers of `afterReadMessages` must invoke `callbacks.runAsync` without awaiting it, keeping read-receipt I/O off the message-send path; this includes `apps/meteor/server/hooks/messages/processThreads.ts`.

Applied to files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.

Applied to files:

  • apps/meteor/server/api/v1/middlewares/cors.ts
🪛 ast-grep (0.45.1)
apps/meteor/server/api/v1/middlewares/cors.spec.ts

[warning] 221-221: Express application should use Helmet
Context: express()
Note: [CWE-693] Protection Mechanism Failure (Express app without Helmet security headers).

(missing-helmet-typescript)

🔇 Additional comments (6)
apps/meteor/ee/server/startup/mcp.ts (1)

1-7: LGTM!

apps/meteor/ee/server/startup/index.ts (1)

9-9: LGTM!

apps/meteor/server/api/v1/middlewares/cors.ts (1)

10-20: LGTM!

Also applies to: 41-41, 60-60

apps/meteor/server/api/v1/middlewares/cors.spec.ts (1)

116-119: LGTM!

Also applies to: 145-157, 175-178, 204-240

packages/model-typings/src/models/IUsersModel.ts (1)

294-300: LGTM!

packages/models/src/models/Users.ts (1)

1796-1804: LGTM!


Walkthrough

Adds an AI-licensed native MCP server at /api/v1/mcp. The change adds administration controls, curated and extended REST tool catalogs, JSON-RPC handling, authenticated loopback dispatch, transport validation, CORS support, tests, documentation, and personal access token lookup.

Changes

Native MCP server

Layer / File(s) Summary
Configuration and administration
apps/meteor/client/views/admin/aiCenter/*, apps/meteor/server/settings/ai.ts, apps/meteor/ee/server/startup/*, apps/meteor/server/api/v1/middlewares/cors.*, packages/i18n/src/locales/en.i18n.json, packages/rest-typings/src/v1/*, docs/features/mcp-server.md, .changeset/native-mcp-server.md
Adds MCP settings, AI Center controls, the access-mcp permission, conditional CORS headers, REST schema descriptions, localization, documentation, and release metadata.
REST tool catalog
apps/meteor/ee/server/api/mcp/catalog.ts, apps/meteor/ee/server/api/mcp/catalog.spec.ts
Generates cached curated and allow-listed extended tools. Normalizes schemas, expands request variants, applies descriptions, and enforces unique MCP tool names.
MCP protocol and HTTP route
apps/meteor/ee/server/api/mcp/transport.ts, apps/meteor/ee/server/api/mcp/server.ts, apps/meteor/ee/server/api/mcp/index.ts, packages/model-typings/src/models/IUsersModel.ts, packages/models/src/models/Users.ts, apps/meteor/ee/server/api/mcp/*spec.ts
Adds origin and protocol validation, JSON-RPC request handling, tool listing and execution, route gating, batch processing, personal access token verification, and endpoint tests.
Authenticated REST dispatch
apps/meteor/ee/server/api/mcp/dispatch.ts, apps/meteor/ee/server/api/mcp/dispatch.spec.ts
Dispatches authenticated loopback requests with method-specific arguments, forwarded client IP data, redirect rejection, timeout handling, and shared response-size limits.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MCPClient
  participant MCPRoute
  participant MCPServer
  participant Catalog
  participant RESTAPI

  MCPClient->>MCPRoute: POST JSON-RPC request
  MCPRoute->>MCPServer: Validate transport and authentication
  MCPServer->>Catalog: List or resolve MCP tool
  Catalog-->>MCPServer: Return tool definition
  MCPServer->>RESTAPI: Dispatch authenticated REST request
  RESTAPI-->>MCPServer: Return bounded response
  MCPServer-->>MCPRoute: Build JSON-RPC response
  MCPRoute-->>MCPClient: Return MCP response
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding a native MCP server to the API.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.89403% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.21%. Comparing base (93aa04b) to head (265deb9).
⚠️ Report is 34 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #41082      +/-   ##
===========================================
+ Coverage    68.68%   69.21%   +0.52%     
===========================================
  Files         4166     4233      +67     
  Lines       159382   167281    +7899     
  Branches     28253    29809    +1556     
===========================================
+ Hits        109479   115790    +6311     
- Misses       44747    46332    +1585     
- Partials      5156     5159       +3     
Flag Coverage Δ
e2e 58.93% <ø> (+0.03%) ⬆️
e2e-api 46.07% <50.00%> (+0.34%) ⬆️
unit 71.15% <95.15%> (+0.57%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rodrigok
rodrigok force-pushed the feat/native-mcp-server branch from c652468 to 1341d98 Compare June 25, 2026 22:39
Expose the Rocket.Chat REST API to MCP-capable AI clients via a JSON-RPC 2.0
Streamable-HTTP endpoint, as enterprise (protected) code under `ee/`.

- Mounted as a normal API route at `/api/v1/mcp` (`API.v1.addRoute`), so it
  reuses the whole REST middleware chain: PAT authentication, remote-address
  resolution, CORS, logging, metrics and the built-in per-route rate limiter.
  No new runtime dependency — the JSON-RPC layer is implemented directly.
- Tool catalog is derived from the existing typed-route metadata (the same
  source as the OpenAPI doc): a minimal curated default set, plus an opt-in
  extended set (the catalog filtered by an allow-list) gated by
  `MCP_Expose_Extended_API`. The full API is never exposed. Routes whose
  schema is a oneOf/anyOf of sub-schemas are split into one tool per variant
  (e.g. `chat_postMessage_by_channel` / `_by_roomId`).
- Auth reuses Personal Access Tokens (`X-User-Id`/`X-Auth-Token`); tool calls
  dispatch to the REST layer as the authenticated user (forwarding the real
  client IP), preserving permission checks and parameter validation.
- Gated behind the `experimental-enterprise-features` license module — both the
  route (`license: [...]`) and the settings (`enterprise: true` + `modules`).
- rest-typings: add field/endpoint descriptions to `chat.postMessage` and
  `users.info` request schemas, reused as MCP tool docs. Validation behaviour
  is unchanged (verified across the full input matrix).
- Settings `MCP_Enabled` / `MCP_Expose_Extended_API` (off by default), flagged
  as an alpha feature.
- Docs: `docs/features/mcp-server.md`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rodrigok
rodrigok force-pushed the feat/native-mcp-server branch from 1341d98 to 328a8db Compare June 26, 2026 17:04
Add an `access-mcp` permission (granted to `admin` by default) and require it on
the `/api/v1/mcp` route via `permissionsRequired`, so every MCP action is gated by
it in addition to the existing `experimental-enterprise-features` license module
and the `MCP_Enabled` setting.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@engelgabriel

Copy link
Copy Markdown
Member

Can this be done in collaboration with https://github.com/RocketChat/MCPServerGenerator_GSoC2026 ?

@Dnouv
Dnouv marked this pull request as ready for review August 10, 2026 15:07
@Dnouv
Dnouv requested review from a team as code owners August 10, 2026 15:07
@coderabbitai coderabbitai Bot added the type: feature Pull requests that introduces new feature label Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (4)
apps/meteor/ee/server/api/mcp/server.spec.ts (1)

106-124: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for the tool-call error paths.

handleRpcMessage returns isError: true in two cases: a dispatch result with ok: false, and a thrown dispatch error mapped to a Tool execution failed: text. Neither case is asserted. Add one test for a rejected dispatchTool promise and one for { ok: false }.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/ee/server/api/mcp/server.spec.ts` around lines 106 - 124, Extend
the handleRpcMessage tests alongside the known-tool success case with two tests:
mock dispatchTool to reject and assert the response contains isError: true with
the “Tool execution failed:” text, then mock it to resolve with ok: false and
assert the corresponding error response. Keep the authenticated-user arguments
and JSON-RPC request shape consistent with the existing test.
apps/meteor/ee/server/api/mcp/catalog.ts (1)

21-43: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Align the curated names with toolNameFor.

The curated set names a route chat_postMessage, while the extended set names the same route post_chat_postMessage. When an administrator toggles the extended catalog, every tool identity changes. server.ts advertises capabilities: { tools: { listChanged: false } }, so a connected client keeps calling the old names and receives Unknown tool.

Generate curated names with toolNameFor as well, or keep a stable alias for both catalogs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/ee/server/api/mcp/catalog.ts` around lines 21 - 43, Update the
curated catalog definitions in CURATED to use the same tool-name generation as
the extended catalog, specifically toolNameFor, so shared routes retain
identical identities when the catalog changes. Preserve the existing route
paths, methods, and descriptions, and ensure clients can continue using the same
names without relying on stale aliases.
apps/meteor/ee/server/api/mcp/dispatch.ts (1)

83-91: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Harden the GET and DELETE query serialization.

JSON.stringify(undefined) returns undefined, and URLSearchParams.append then writes the literal string "undefined". Array arguments are also encoded as a JSON string, which only matches routes that expect a JSON-encoded query value.

Skip undefined values, and confirm that array-valued query parameters in the allow-listed routes accept JSON encoding.

♻️ Proposed change to skip undefined values
 		const qs = new URLSearchParams();
 		for (const [key, value] of Object.entries(args ?? {})) {
+			if (value === undefined) {
+				continue;
+			}
 			qs.append(key, typeof value === 'string' ? value : JSON.stringify(value));
 		}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/ee/server/api/mcp/dispatch.ts` around lines 83 - 91, Update the
GET/DELETE query serialization in the dispatch logic to skip entries whose
values are undefined before calling URLSearchParams.append, preventing the
literal "undefined" from being sent. Review the allow-listed routes that consume
array-valued query parameters and ensure they accept the existing JSON.stringify
encoding; adjust serialization or route parsing only where necessary to preserve
the expected array values.
apps/meteor/ee/server/api/mcp/transport.ts (1)

17-21: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove implementation comments.

The changed MCP implementation adds comments where the coding guideline requires code without implementation comments. Keep this context in external documentation or express it through identifiers and structure.

  • apps/meteor/ee/server/api/mcp/transport.ts#L17-L21: Remove the transport implementation comment.
  • apps/meteor/ee/server/api/mcp/server.ts#L9-L9: Remove the token forwarding comment.
  • apps/meteor/ee/server/api/mcp/server.ts#L54-L54: Remove the tool-list comment.
  • apps/meteor/ee/server/api/mcp/server.ts#L64-L67: Remove the handler behavior comment.
  • apps/meteor/ee/server/api/mcp/server.ts#L89-L89: Remove the notification comment.
  • apps/meteor/ee/server/api/mcp/index.ts#L52-L53: Remove the authentication forwarding comment.
  • apps/meteor/ee/server/api/mcp/index.ts#L74-L74: Remove the notification comment.
  • apps/meteor/ee/server/api/mcp/index.ts#L91-L91: Remove the transport comment.
  • apps/meteor/ee/server/api/mcp/index.ts#L99-L111: Remove the route implementation comment.

As per coding guidelines, “Avoid code comments in the implementation”.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/ee/server/api/mcp/transport.ts` around lines 17 - 21, Remove the
implementation comments from the MCP code without changing behavior: delete the
transport comment in apps/meteor/ee/server/api/mcp/transport.ts (lines 17-21);
delete the token forwarding, tool-list, handler behavior, and notification
comments in apps/meteor/ee/server/api/mcp/server.ts (lines 9, 54, 64-67, and
89); and delete the authentication forwarding, notification, transport, and
route implementation comments in apps/meteor/ee/server/api/mcp/index.ts (lines
52-53, 74, 91, and 99-111).

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/meteor/ee/server/api/mcp/catalog.ts`:
- Around line 307-320: Update toolNameFor and toolsForRoute to generate unique
MCP tool names: reserve space for the `_by_<discriminator>` suffix before
truncating the base name, then deduplicate any remaining collisions across
routes and variants using the existing catalog-generation flow. Ensure
handleRpcMessage can resolve every generated tool by its name without changing
variant descriptions or schemas.

In `@apps/meteor/ee/server/api/mcp/dispatch.spec.ts`:
- Around line 10-15: Update the afterEach cleanup around originalPort so it
restores the environment accurately: assign process.env.PORT only when
originalPort was defined, and delete process.env.PORT when it was originally
unset. Keep jest.restoreAllMocks() unchanged.

In `@apps/meteor/ee/server/api/mcp/dispatch.ts`:
- Around line 65-94: Update dispatchTool’s loopback URL construction to prepend
__meteor_runtime_config__.ROOT_URL_PATH_PREFIX (falling back to an empty string)
between the base URL and tool.path, so requests honor deployments under a
runtime path prefix. Preserve the existing TCP port handling and query/body
construction.

In `@apps/meteor/ee/server/api/mcp/index.ts`:
- Around line 112-115: Update the mcp route registration around handleMcpPost
and handleMcpGet to enforce a route-level token type of personalAccessToken,
ensuring Meteor session tokens are rejected while valid PATs remain accepted.
Reuse the existing token-model configuration pattern used by other routes.

In `@docs/features/mcp-server.md`:
- Around line 128-134: Update the limitation bullet near the MCP server
lifecycle notes to accurately describe POST batching: state that each POST
produces one HTTP response and may contain either a single message or a batch.
Keep the surrounding SSE and lifecycle limitations unchanged.
- Around line 136-149: Update the “Key Files” table in the MCP server
documentation so every application path uses the same repository-root base as
the existing packages paths. Prefix all ee/... and server/... entries, including
the remaining application entries, with apps/meteor/; leave packages/... paths
unchanged.

In `@packages/rest-typings/src/v1/chat.ts`:
- Line 782: Update the descriptions for ChatPostMessage at
packages/rest-typings/src/v1/chat.ts lines 782-782 and 843-843 to state that
text is optional, while retaining roomId as the required field and allowing
attachment-only calls.

---

Nitpick comments:
In `@apps/meteor/ee/server/api/mcp/catalog.ts`:
- Around line 21-43: Update the curated catalog definitions in CURATED to use
the same tool-name generation as the extended catalog, specifically toolNameFor,
so shared routes retain identical identities when the catalog changes. Preserve
the existing route paths, methods, and descriptions, and ensure clients can
continue using the same names without relying on stale aliases.

In `@apps/meteor/ee/server/api/mcp/dispatch.ts`:
- Around line 83-91: Update the GET/DELETE query serialization in the dispatch
logic to skip entries whose values are undefined before calling
URLSearchParams.append, preventing the literal "undefined" from being sent.
Review the allow-listed routes that consume array-valued query parameters and
ensure they accept the existing JSON.stringify encoding; adjust serialization or
route parsing only where necessary to preserve the expected array values.

In `@apps/meteor/ee/server/api/mcp/server.spec.ts`:
- Around line 106-124: Extend the handleRpcMessage tests alongside the
known-tool success case with two tests: mock dispatchTool to reject and assert
the response contains isError: true with the “Tool execution failed:” text, then
mock it to resolve with ok: false and assert the corresponding error response.
Keep the authenticated-user arguments and JSON-RPC request shape consistent with
the existing test.

In `@apps/meteor/ee/server/api/mcp/transport.ts`:
- Around line 17-21: Remove the implementation comments from the MCP code
without changing behavior: delete the transport comment in
apps/meteor/ee/server/api/mcp/transport.ts (lines 17-21); delete the token
forwarding, tool-list, handler behavior, and notification comments in
apps/meteor/ee/server/api/mcp/server.ts (lines 9, 54, 64-67, and 89); and delete
the authentication forwarding, notification, transport, and route implementation
comments in apps/meteor/ee/server/api/mcp/index.ts (lines 52-53, 74, 91, and
99-111).
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a99b20bc-a615-4cc2-82e2-14e326fdc353

📥 Commits

Reviewing files that changed from the base of the PR and between 73b6281 and f78c18c.

📒 Files selected for processing (22)
  • .changeset/native-mcp-server.md
  • apps/meteor/client/views/admin/aiCenter/AICenterOverview.tsx
  • apps/meteor/client/views/admin/aiCenter/AICenterRoute.tsx
  • apps/meteor/client/views/admin/aiCenter/AISettingsSection.tsx
  • apps/meteor/ee/server/api/index.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/ee/server/api/mcp/dispatch.spec.ts
  • apps/meteor/ee/server/api/mcp/dispatch.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • apps/meteor/ee/server/api/mcp/permissions.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/server.ts
  • apps/meteor/ee/server/api/mcp/transport.spec.ts
  • apps/meteor/ee/server/api/mcp/transport.ts
  • apps/meteor/jest.config.ts
  • apps/meteor/server/settings/ai.ts
  • docs/features/mcp-server.md
  • packages/i18n/src/locales/en.i18n.json
  • packages/rest-typings/src/v1/chat.ts
  • packages/rest-typings/src/v1/users/UsersInfoParamsGet.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/views/admin/aiCenter/AICenterRoute.tsx
  • apps/meteor/ee/server/api/mcp/permissions.ts
  • apps/meteor/client/views/admin/aiCenter/AICenterOverview.tsx
  • apps/meteor/ee/server/api/mcp/transport.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/index.ts
  • apps/meteor/ee/server/api/mcp/transport.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/jest.config.ts
  • apps/meteor/ee/server/api/mcp/dispatch.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • packages/rest-typings/src/v1/users/UsersInfoParamsGet.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/client/views/admin/aiCenter/AISettingsSection.tsx
  • apps/meteor/ee/server/api/mcp/dispatch.ts
  • apps/meteor/ee/server/api/mcp/server.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/server/settings/ai.ts
  • packages/rest-typings/src/v1/chat.ts
apps/meteor/**

📄 CodeRabbit inference engine (CLAUDE.md)

The main Rocket.Chat Meteor application resides in apps/meteor/; place its application code there rather than in other monorepo areas.

Files:

  • apps/meteor/client/views/admin/aiCenter/AICenterRoute.tsx
  • apps/meteor/ee/server/api/mcp/permissions.ts
  • apps/meteor/client/views/admin/aiCenter/AICenterOverview.tsx
  • apps/meteor/ee/server/api/mcp/transport.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/index.ts
  • apps/meteor/ee/server/api/mcp/transport.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/jest.config.ts
  • apps/meteor/ee/server/api/mcp/dispatch.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/client/views/admin/aiCenter/AISettingsSection.tsx
  • apps/meteor/ee/server/api/mcp/dispatch.ts
  • apps/meteor/ee/server/api/mcp/server.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/server/settings/ai.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/ee/server/api/mcp/transport.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/dispatch.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
packages/**

📄 CodeRabbit inference engine (CLAUDE.md)

Shared libraries belong in packages/, while other services belong in apps/ and ee/.

Files:

  • packages/rest-typings/src/v1/users/UsersInfoParamsGet.ts
  • packages/rest-typings/src/v1/chat.ts
  • packages/i18n/src/locales/en.i18n.json
🧠 Learnings (12)
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • apps/meteor/client/views/admin/aiCenter/AICenterRoute.tsx
  • apps/meteor/client/views/admin/aiCenter/AICenterOverview.tsx
  • apps/meteor/client/views/admin/aiCenter/AISettingsSection.tsx
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/client/views/admin/aiCenter/AICenterRoute.tsx
  • apps/meteor/ee/server/api/mcp/permissions.ts
  • apps/meteor/client/views/admin/aiCenter/AICenterOverview.tsx
  • apps/meteor/ee/server/api/mcp/transport.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/index.ts
  • apps/meteor/ee/server/api/mcp/transport.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/jest.config.ts
  • apps/meteor/ee/server/api/mcp/dispatch.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • packages/rest-typings/src/v1/users/UsersInfoParamsGet.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/client/views/admin/aiCenter/AISettingsSection.tsx
  • apps/meteor/ee/server/api/mcp/dispatch.ts
  • apps/meteor/ee/server/api/mcp/server.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/server/settings/ai.ts
  • packages/rest-typings/src/v1/chat.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/ee/server/api/mcp/permissions.ts
  • apps/meteor/ee/server/api/mcp/transport.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/index.ts
  • apps/meteor/ee/server/api/mcp/transport.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/jest.config.ts
  • apps/meteor/ee/server/api/mcp/dispatch.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • packages/rest-typings/src/v1/users/UsersInfoParamsGet.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/dispatch.ts
  • apps/meteor/ee/server/api/mcp/server.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/server/settings/ai.ts
  • packages/rest-typings/src/v1/chat.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/ee/server/api/mcp/permissions.ts
  • apps/meteor/ee/server/api/mcp/transport.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/index.ts
  • apps/meteor/ee/server/api/mcp/transport.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/jest.config.ts
  • apps/meteor/ee/server/api/mcp/dispatch.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • packages/rest-typings/src/v1/users/UsersInfoParamsGet.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/dispatch.ts
  • apps/meteor/ee/server/api/mcp/server.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/server/settings/ai.ts
  • packages/rest-typings/src/v1/chat.ts
📚 Learning: 2026-07-31T00:32:03.839Z
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 41635
File: apps/meteor/ee/server/api/roles.ts:101-111
Timestamp: 2026-07-31T00:32:03.839Z
Learning: In Rocket.Chat's typed EE REST API routes that use apps/meteor/ee/server/api/v1/middlewares/license.ts, account for unavailable route-level license modules returning HTTP 400 with { success: false, error, errorType: 'error-action-not-allowed' }, not HTTP 403. Declare the existing 400 bad-request response schema for these routes.

Applied to files:

  • apps/meteor/ee/server/api/mcp/permissions.ts
  • apps/meteor/ee/server/api/mcp/transport.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/index.ts
  • apps/meteor/ee/server/api/mcp/transport.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/ee/server/api/mcp/dispatch.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/dispatch.ts
  • apps/meteor/ee/server/api/mcp/server.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
📚 Learning: 2026-07-31T02:44:35.111Z
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 41635
File: apps/meteor/ee/server/api/sessions.ts:114-138
Timestamp: 2026-07-31T02:44:35.111Z
Learning: In Rocket.Chat typed REST response schemas, accept the composition of a Typia-generated entity schema with an `allOf` branch requiring `success: true`: `allOf: [{ $ref: <entity schema> }, { properties: { success: { type: 'boolean', enum: [true] } }, required: ['success'] }]`. Do not flag this pattern when used for REST endpoints, provided TEST_MODE response validation passes, as demonstrated by the `IOAuthApps` and `IEmailInbox` endpoints.

Applied to files:

  • apps/meteor/ee/server/api/mcp/permissions.ts
  • apps/meteor/ee/server/api/mcp/transport.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/index.ts
  • apps/meteor/ee/server/api/mcp/transport.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/ee/server/api/mcp/dispatch.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/dispatch.ts
  • apps/meteor/ee/server/api/mcp/server.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/ee/server/api/mcp/transport.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/dispatch.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/ee/server/api/mcp/transport.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/dispatch.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
📚 Learning: 2026-03-16T21:50:37.589Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: .changeset/migrate-users-register-openapi.md:3-3
Timestamp: 2026-03-16T21:50:37.589Z
Learning: For changes related to OpenAPI migrations in Rocket.Chat/OpenAPI, when removing endpoint types and validators from rocket.chat/rest-typings (e.g., UserRegisterParamsPOST, /v1/users.register) document this as a minor changeset (not breaking) per RocketChat/Rocket.Chat-Open-API#150 Rule 7. Note that the endpoint type is re-exposed via a module augmentation .d.ts in the consuming package (e.g., packages/web-ui-registration/src/users-register.d.ts). In reviews, ensure the changeset clearly states: this is a non-breaking change, the major version should not be bumped, and the changeset reflects a minor version bump. Do not treat this as a breaking change during OpenAPI migrations.

Applied to files:

  • .changeset/native-mcp-server.md
📚 Learning: 2026-05-11T23:14:59.316Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40469
File: packages/rest-typings/src/v1/users.ts:337-337
Timestamp: 2026-05-11T23:14:59.316Z
Learning: In Rocket.Chat REST endpoint typings (e.g., packages/rest-typings/src/v1/users.ts and other rest-typings files), keep the established convention of deriving field types from the domain model (e.g., use IUser indexed access like IUser['statusExpiresAt']) rather than swapping individual fields to serialized primitives (like string) in an ad-hoc way. If a truly different “serialized” representation is needed, perform the refactor consistently across the codebase (not just a single endpoint/field) and ensure all related REST typings stay aligned with the shared serialization types.

Applied to files:

  • packages/rest-typings/src/v1/users/UsersInfoParamsGet.ts
  • packages/rest-typings/src/v1/chat.ts
📚 Learning: 2026-08-05T22:02:59.828Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 41707
File: apps/meteor/server/hooks/messages/processThreads.ts:66-68
Timestamp: 2026-08-05T22:02:59.828Z
Learning: In Rocket.Chat Meteor server code, `callbacks.runAsync` returns its input item rather than the asynchronous callback promise. Callers of `afterReadMessages` must invoke `callbacks.runAsync` without awaiting it, keeping read-receipt I/O off the message-send path; this includes `apps/meteor/server/hooks/messages/processThreads.ts`.

Applied to files:

  • apps/meteor/server/settings/ai.ts
📚 Learning: 2026-08-10T13:36:55.243Z
Learnt from: abhinavkrin
Repo: RocketChat/Rocket.Chat PR: 41736
File: packages/i18n/src/locales/th-TH.i18n.json:398-398
Timestamp: 2026-08-10T13:36:55.243Z
Learning: During the coordinated i18n interpolation migration for `Channel_already_exist`, do not flag locale files that still use `%s` until the English base translation and all affected locales are converted together to `{{channelName}}`. Partial locale-only conversions fail the i18n `extra-placeholders` check; the coordinated conversion is owned by the related migration change.

Applied to files:

  • packages/i18n/src/locales/en.i18n.json
🔇 Additional comments (25)
apps/meteor/ee/server/api/mcp/catalog.ts (3)

188-224: LGTM!

Also applies to: 237-304, 328-374


54-172: 🎯 Functional Correctness

No action needed.

The direct-message allow-list entries match real route names.


227-233: 🗄️ Data Integrity & Integration

No change needed for schema completeness or $ref exposure.

Typed GET/DELETE routes advertise a single query parameter object, and the only $ref found is in packages/rest-typings/src/v1/me/meSuccessResponse.ts, which is a response schema, not an MCP input schema.

			> Likely an incorrect or invalid review comment.
packages/rest-typings/src/v1/users/UsersInfoParamsGet.ts (1)

18-115: LGTM!

apps/meteor/ee/server/api/mcp/catalog.spec.ts (1)

3-136: LGTM!

apps/meteor/ee/server/api/mcp/dispatch.ts (1)

13-44: LGTM!

Also applies to: 96-108

apps/meteor/ee/server/api/mcp/dispatch.spec.ts (1)

17-111: LGTM!

apps/meteor/ee/server/api/mcp/server.spec.ts (1)

6-47: LGTM!

Also applies to: 49-104, 126-137

packages/rest-typings/src/v1/chat.ts (1)

88-93: LGTM!

Also applies to: 794-840, 855-892

apps/meteor/ee/server/api/mcp/transport.ts (1)

3-15: LGTM!

Also applies to: 22-49

apps/meteor/ee/server/api/mcp/server.ts (1)

1-8: LGTM!

Also applies to: 13-52, 55-63, 68-88, 90-134

apps/meteor/ee/server/api/mcp/transport.spec.ts (1)

1-56: LGTM!

apps/meteor/ee/server/api/mcp/index.spec.ts (1)

1-126: LGTM!

apps/meteor/jest.config.ts (1)

41-41: LGTM!

apps/meteor/server/settings/ai.ts (1)

169-194: LGTM!

apps/meteor/ee/server/api/mcp/permissions.ts (1)

1-8: LGTM!

apps/meteor/client/views/admin/aiCenter/AICenterOverview.tsx (2)

18-20: LGTM!

Also applies to: 29-37, 73-80


17-17: 🎯 Functional Correctness

No change needed.

AICenterOverview runs inside the privileged admin settings context, so useSetting('MCP_Enabled', false) can read the non-public setting.

apps/meteor/client/views/admin/aiCenter/AICenterRoute.tsx (1)

24-27: LGTM!

apps/meteor/client/views/admin/aiCenter/AISettingsSection.tsx (1)

7-21: LGTM!

packages/i18n/src/locales/en.i18n.json (1)

153-153: LGTM!

Also applies to: 3548-3554, 6291-6292

apps/meteor/ee/server/api/index.ts (1)

11-11: LGTM!

.changeset/native-mcp-server.md (1)

1-7: LGTM!

docs/features/mcp-server.md (2)

1-115: LGTM!

Also applies to: 124-127


117-123: 🎯 Functional Correctness

No change needed. tools/list and tools/call work without a preceding initialize; pre-initialization discovery is supported by the implementation.

Comment thread apps/meteor/ee/server/api/mcp/catalog.ts
Comment thread apps/meteor/ee/server/api/mcp/dispatch.spec.ts
Comment thread apps/meteor/ee/server/api/mcp/dispatch.ts
Comment thread apps/meteor/ee/server/api/mcp/index.ts Outdated
Comment thread docs/features/mcp-server.md
Comment thread docs/features/mcp-server.md
Comment thread packages/rest-typings/src/v1/chat.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 22 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/meteor/ee/server/api/mcp/transport.ts
Comment thread apps/meteor/ee/server/api/mcp/dispatch.ts
Comment thread docs/features/mcp-server.md Outdated
Comment thread apps/meteor/ee/server/api/mcp/index.ts Outdated
Comment thread packages/rest-typings/src/v1/chat.ts Outdated
Comment thread apps/meteor/ee/server/api/mcp/dispatch.spec.ts
Comment thread apps/meteor/ee/server/api/mcp/server.ts Outdated
Comment thread docs/features/mcp-server.md Outdated
Comment thread docs/features/mcp-server.md Outdated
Comment thread apps/meteor/ee/server/api/mcp/dispatch.spec.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/meteor/ee/server/api/mcp/catalog.ts (1)

350-350: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove implementation comments.

The function names and code already describe these operations.

  • apps/meteor/ee/server/api/mcp/catalog.ts#L350-L350: Remove the toolsForRoute comment.
  • apps/meteor/ee/server/api/mcp/catalog.ts#L397-L397: Remove the getCuratedTools comment.

As per coding guidelines: “Avoid code comments in the implementation.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/ee/server/api/mcp/catalog.ts` at line 350, Remove the
implementation comments above toolsForRoute and getCuratedTools in
apps/meteor/ee/server/api/mcp/catalog.ts at lines 350-350 and 397-397; no code
changes are needed for either function.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/meteor/ee/server/api/mcp/catalog.ts`:
- Line 350: Remove the implementation comments above toolsForRoute and
getCuratedTools in apps/meteor/ee/server/api/mcp/catalog.ts at lines 350-350 and
397-397; no code changes are needed for either function.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 73530fb5-95e9-41d9-ad3f-06eb61793a56

📥 Commits

Reviewing files that changed from the base of the PR and between f78c18c and 0d1c5b7.

📒 Files selected for processing (12)
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/ee/server/api/mcp/dispatch.spec.ts
  • apps/meteor/ee/server/api/mcp/dispatch.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/server.ts
  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
  • docs/features/mcp-server.md
  • packages/rest-typings/src/v1/chat.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • docs/features/mcp-server.md
  • packages/rest-typings/src/v1/chat.ts
  • apps/meteor/ee/server/api/mcp/dispatch.ts
  • apps/meteor/ee/server/api/mcp/dispatch.spec.ts
  • apps/meteor/ee/server/api/mcp/server.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
apps/meteor/**

📄 CodeRabbit inference engine (CLAUDE.md)

The main Rocket.Chat Meteor application resides in apps/meteor/; place its application code there rather than in other monorepo areas.

Files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
🧠 Learnings (8)
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
📚 Learning: 2026-07-31T02:44:35.111Z
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 41635
File: apps/meteor/ee/server/api/sessions.ts:114-138
Timestamp: 2026-07-31T02:44:35.111Z
Learning: In Rocket.Chat typed REST response schemas, accept the composition of a Typia-generated entity schema with an `allOf` branch requiring `success: true`: `allOf: [{ $ref: <entity schema> }, { properties: { success: { type: 'boolean', enum: [true] } }, required: ['success'] }]`. Do not flag this pattern when used for REST endpoints, provided TEST_MODE response validation passes, as demonstrated by the `IOAuthApps` and `IEmailInbox` endpoints.

Applied to files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
📚 Learning: 2026-08-05T22:02:59.828Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 41707
File: apps/meteor/server/hooks/messages/processThreads.ts:66-68
Timestamp: 2026-08-05T22:02:59.828Z
Learning: In Rocket.Chat Meteor server code, `callbacks.runAsync` returns its input item rather than the asynchronous callback promise. Callers of `afterReadMessages` must invoke `callbacks.runAsync` without awaiting it, keeping read-receipt I/O off the message-send path; this includes `apps/meteor/server/hooks/messages/processThreads.ts`.

Applied to files:

  • apps/meteor/server/api/v1/middlewares/cors.spec.ts
  • apps/meteor/server/api/v1/middlewares/cors.ts
📚 Learning: 2026-07-31T00:32:03.839Z
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 41635
File: apps/meteor/ee/server/api/roles.ts:101-111
Timestamp: 2026-07-31T00:32:03.839Z
Learning: In Rocket.Chat's typed EE REST API routes that use apps/meteor/ee/server/api/v1/middlewares/license.ts, account for unavailable route-level license modules returning HTTP 400 with { success: false, error, errorType: 'error-action-not-allowed' }, not HTTP 403. Declare the existing 400 bad-request response schema for these routes.

Applied to files:

  • apps/meteor/ee/server/api/mcp/server.spec.ts
  • apps/meteor/ee/server/api/mcp/index.ts
  • apps/meteor/ee/server/api/mcp/catalog.spec.ts
  • apps/meteor/ee/server/api/mcp/index.spec.ts
  • apps/meteor/ee/server/api/mcp/catalog.ts
🔇 Additional comments (7)
apps/meteor/server/api/v1/middlewares/cors.ts (1)

7-8: LGTM!

apps/meteor/server/api/v1/middlewares/cors.spec.ts (1)

141-153: LGTM!

Also applies to: 196-208

apps/meteor/ee/server/api/mcp/catalog.ts (1)

1-1: LGTM!

Also applies to: 238-238, 309-347, 351-358, 363-363, 372-395, 398-407

apps/meteor/ee/server/api/mcp/catalog.spec.ts (1)

70-92: LGTM!

Also applies to: 133-154

apps/meteor/ee/server/api/mcp/index.ts (1)

2-2: LGTM!

Also applies to: 18-50, 78-80, 102-102, 111-125

apps/meteor/ee/server/api/mcp/server.spec.ts (1)

41-45: LGTM!

Also applies to: 67-67, 80-96, 144-158

apps/meteor/ee/server/api/mcp/index.spec.ts (1)

2-2: LGTM!

Also applies to: 11-14, 30-30, 39-39, 54-54, 92-112, 134-140

@gabriellsh gabriellsh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excited to test it out

@scuciatto scuciatto added the stat: QA assured Means it has been tested and approved by a company insider label Aug 18, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Aug 18, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Aug 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 18, 2026
@Dnouv Dnouv modified the milestone: 8.8.0 Aug 18, 2026
@dionisio-bot dionisio-bot Bot added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Aug 18, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Aug 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 18, 2026
@Dnouv Dnouv modified the milestone: 8.8.0 Aug 18, 2026
@dionisio-bot dionisio-bot Bot added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Aug 18, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Aug 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 18, 2026
@Dnouv Dnouv modified the milestone: 8.8.0 Aug 18, 2026
@dionisio-bot dionisio-bot Bot added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Aug 18, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Aug 18, 2026
Merged via the queue into develop with commit 18f5eb4 Aug 18, 2026
56 checks passed
@dionisio-bot
dionisio-bot Bot deleted the feat/native-mcp-server branch August 18, 2026 08:52
rodrigok added a commit that referenced this pull request Aug 18, 2026
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Dnouv <evan.shu.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants