MCP Integrations
Relevant source files
The following files were used as context for generating this wiki page:
Model Context Protocol (MCP) Integrations allow Rebase to connect to external servers that provide additional context, tools, and resources to AI models. Rebase acts as a host for these servers, enabling models to query specialized data or execute external functions during a session. Sources: src/features/sessions/ui/Composer.test.ts, src/features/settings/ui/McpSettings.test.ts
Architecture and Discovery
Rebase discovers MCP servers by scanning configuration files associated with various AI providers like Claude Code, Cursor, and Codex. The backend uses a discovery mechanism to identify servers based on their scope (Project, User, or Local) and transport method (STDIO or HTTP). Sources: src/features/sessions/ui/Composer.test.ts:133-145, crates/rebase-gpui/src/settings/management.rs:188-212
Discovery Flow
The following diagram illustrates how the system discovers and ranks MCP servers for the user interface.
Configuration and Management
Users manage MCP servers through the Settings interface or the Composer. Rebase supports adding servers by providing a JSON configuration block. Each server is defined by its provider, scope, and transport details. Sources: crates/rebase-gpui/src/settings/management.rs:170-185, src/features/settings/ui/McpSettings.test.ts:107-133
Server Properties
| Property | Description | Values / Examples |
|---|---|---|
| Provider | The AI tool managing the server | claude, cursor, codex, opencode |
| Scope | Visibility of the server | project, user, local |
| Transport | Communication method | stdio, http |
| Status | Current operational health | Connected, Needs authentication, Disabled |
Sources: src/features/settings/model/mcp.ts, crates/rebase-gpui/src/settings/management.rs:188-212, src/features/sessions/model/mcpPicker.test.ts:50-58
Adding a Server
When you add a server, you must select the provider and scope. For instance, claude_desktop and codex typically default to user scope, while others may default to project. You then paste a JSON object containing the command and args for the server. Sources: crates/rebase-gpui/src/settings/management.rs:60-70, crates/rebase-gpui/src/settings/management.rs:200-210
Composer Integration
The Composer allows you to tag specific MCP servers to include their context in a turn. Typing /mcp opens a searchable picker. Selecting a server inserts an inline tag (e.g., @mcp/docs) into the text area. Sources: src/features/sessions/ui/Composer.test.ts:175-210, src/features/sessions/model/mcpPicker.test.ts:60-68
Context Submission Sequence
This diagram shows the sequence from selecting an MCP server to submitting the final prompt with context.
Health and Authentication
Rebase monitors server health by parsing output from provider-specific status commands. If a server requires authentication, the UI displays a "Sign in" button that triggers mcp_provider_login. Sources: src/features/settings/model/mcp.ts, src/features/settings/ui/McpSettings.test.ts:80-92
- Connected: Server is active and reachable.
- Needs Authentication: Server is configured but requires user login (common with HTTP transports).
- Disabled: Server is present in configuration but explicitly disabled by the provider.
Sources: src/features/settings/model/mcp.test.ts:5-13, src/features/sessions/model/mcpPicker.test.ts:50-58
Summary
MCP Integrations expand the capabilities of AI models within Rebase by bridging them to external data sources and tools. By managing these servers through a unified interface and allowing targeted context selection in the Composer, Rebase ensures that models have the precise information required to execute complex tasks. Sources: README.md, src/features/settings/ui/McpSettings.test.ts