Skip to content

Add MCP to feature overviews#2342

Merged
suhasdeshpande merged 1 commit intomainfrom
suhas/docs-update
Aug 19, 2025
Merged

Add MCP to feature overviews#2342
suhasdeshpande merged 1 commit intomainfrom
suhas/docs-update

Conversation

@suhasdeshpande
Copy link
Copy Markdown
Contributor

@suhasdeshpande suhasdeshpande commented Aug 19, 2025

Summary by CodeRabbit

  • Documentation
    • Added a new guide on connecting MCP servers with CopilotKit in React/Next.js.
    • Includes Quickstart (CLI flow and obtaining an MCP server), manual setup, and an end-to-end example with chat UI integration.
    • Introduces advanced guidance for visualizing MCP tool calls.
    • Provides self-hosting instructions for Copilot Runtime with configuration tips.
    • Updated docs navigation to include the new page under Feature Overviews.

@changesets-bot-copilotkit
Copy link
Copy Markdown

⏭️ Changeset Not Required

Latest commit: bad0c3c

No changes in this PR affected the @copilitkit/* packages. Merging this PR will not cause a version bump for any packages.

Changeset is not required for this PR.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 19, 2025

Walkthrough

Adds a new documentation page detailing how to connect Model Context Protocol (MCP) servers to React/Next.js apps using CopilotKit, including CLI and manual setup paths, example code for chat integration and tool visualization, and guidance for self-hosting. Updates the docs navigation to include this page.

Changes

Cohort / File(s) Summary
Docs: MCP servers integration guide
docs/content/docs/(root)/connect-mcp-servers.mdx
New MDX page explaining MCP concepts, quickstart (CLI and manual), Next.js integration examples, tool call visualization component, and self-hosting setup with runtime and API route examples.
Docs navigation update
docs/content/docs/(root)/meta.json
Adds "connect-mcp-servers" to the root Overview pages list under the Feature Overviews section.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as React App (CopilotChat)
  participant CK as CopilotKit Provider
  participant MCP as MCP Client
  participant S as MCP Server (SSE)

  User->>UI: Enters prompt / interacts with chat
  UI->>CK: useCopilotChat.submitMessage()
  CK->>MCP: setMcpServers([...]) / create client
  MCP-->>S: Connect via SSE (subscribe/tools)
  S-->>MCP: Stream tool calls/results
  MCP-->>CK: Forward tool events/results
  CK-->>UI: Update messages & tool call UI
  UI-->>User: Render assistant output and tool results

  rect rgb(235, 245, 255)
  note over CK,MCP: Optional: Self-hosted Copilot Runtime proxy
  UI->>CK: Calls runtime endpoint (if self-hosted)
  CK->>MCP: Route via runtime
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch suhas/docs-update

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Aug 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Aug 19, 2025 6:04pm
examples-coagents-ai-travel-app Ready Ready Preview Comment Aug 19, 2025 6:04pm
examples-coagents-research-canvas-ui Ready Ready Preview Comment Aug 19, 2025 6:04pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
examples-coagents-ai-researcher-ui Ignored Ignored Aug 19, 2025 6:04pm

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (7)
docs/content/docs/(root)/connect-mcp-servers.mdx (7)

11-19: Remove unused imports to avoid MDX/TS build warnings.

Only SquareTerminal and SquareChartGantt are used; Link and the other lucide icons are unused.

Apply this diff:

-import Link from "next/link";
-import {
-  Database,
-  Code,
-  Server,
-  Bot,
-  SquareTerminal,
-  SquareChartGantt,
-} from "lucide-react";
+import { SquareTerminal, SquareChartGantt } from "lucide-react";

39-45: Fix grammar in Composio step.

“find a server the suits your needs” → “find a server that suits your needs”

Apply this diff:

-          To get started, go to [Composio](https://mcp.composio.dev/), find a server the suits your needs and copy the SSE URL before continuing here.
+          To get started, go to [Composio](https://mcp.composio.dev/), find a server that suits your needs, and copy the SSE URL before continuing here.

66-79: Improve phrasing and punctuation for the CLI instruction.

“Just run this following command …” → “Just run the following command …” and use a colon before the code block.

Apply this diff:

-        Just run this following command in your Next.js application to get started!
+        Just run the following command in your Next.js application to get started:

121-128: Avoid placing MCP SSE URLs or tokens directly in client code.

If the MCP endpoint requires auth, embedding it in a client component can leak credentials. Prefer configuring MCP server connections on the server (runtime) and exposing only safe identifiers client-side.

Would you add a short note here advising readers to avoid hardcoding secrets in the browser and to route MCP connections via their Copilot runtime or a server API? If helpful, I can draft that note.


169-186: Simplify the generic type for the catch-all action renderer.

Catch-all tools can have varied arg types; using unknown is clearer than [] and avoids implying an empty tuple type.

Apply this diff:

-            render: ({ name, status, args, result }: CatchAllActionRenderProps<[]>) => (
+            render: ({ name, status, args, result }: CatchAllActionRenderProps<unknown>) => (
               <McpToolCall status={status} name={name} args={args} result={result} />
             ),

241-246: Align component name with import to reduce confusion.

Earlier you import McpToolCall (camel-cased acronym). Renaming the exported default to McpToolCall improves consistency in the example.

Apply this diff:

-export default function MCPToolCall({
+export default function McpToolCall({
   status,
   name = "",
   args,
   result,
 }: ToolCallProps) {

345-363: Add file placement guidance for the Next.js App Router example.

A brief note like “Place this in app/api/copilotkit/route.ts” helps readers wire the endpoint correctly. Also ensure the endpoint option matches the actual route path.

Do you want me to append a one-liner above the snippet clarifying the file path and the need to align endpoint with the route?

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f1f0a91 and bad0c3c.

📒 Files selected for processing (2)
  • docs/content/docs/(root)/connect-mcp-servers.mdx (1 hunks)
  • docs/content/docs/(root)/meta.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
docs/**/*

📄 CodeRabbit Inference Engine (.cursor/rules/quick-reference.mdc)

Check [docs/] for documentation site

Files:

  • docs/content/docs/(root)/meta.json
  • docs/content/docs/(root)/connect-mcp-servers.mdx
docs/content/docs/**/*

📄 CodeRabbit Inference Engine (.cursor/rules/quick-reference.mdc)

See [docs/content/docs/] for markdown documentation files

Files:

  • docs/content/docs/(root)/meta.json
  • docs/content/docs/(root)/connect-mcp-servers.mdx
🪛 LanguageTool
docs/content/docs/(root)/connect-mcp-servers.mdx

[grammar] ~7-~7: There might be a mistake here.
Context: ...ns" icon: "lucide/Network" --- import { TailoredContent, TailoredContentOption...

(QB_NEW_EN)


[grammar] ~8-~8: There might be a mistake here.
Context: ...etwork" --- import { TailoredContent, TailoredContentOption, } from "@/compone...

(QB_NEW_EN)


[grammar] ~9-~9: There might be a mistake here.
Context: ...ailoredContent, TailoredContentOption, } from "@/components/react/tailored-cont...

(QB_NEW_EN)


[grammar] ~10-~10: There might be a mistake here.
Context: .../components/react/tailored-content.tsx"; import Link from "next/link"; import { ...

(QB_NEW_EN)


[grammar] ~11-~11: There might be a mistake here.
Context: ...tent.tsx"; import Link from "next/link"; import { Database, Code, Server, ...

(QB_NEW_EN)


[grammar] ~12-~12: There might be a mistake here.
Context: ...; import Link from "next/link"; import { Database, Code, Server, Bot, Squ...

(QB_NEW_EN)


[grammar] ~13-~13: There might be a mistake here.
Context: ...k from "next/link"; import { Database, Code, Server, Bot, SquareTerminal,...

(QB_NEW_EN)


[grammar] ~14-~14: There might be a mistake here.
Context: ...next/link"; import { Database, Code, Server, Bot, SquareTerminal, Squar...

(QB_NEW_EN)


[grammar] ~15-~15: There might be a mistake here.
Context: ...; import { Database, Code, Server, Bot, SquareTerminal, SquareChartGant...

(QB_NEW_EN)


[grammar] ~16-~16: There might be a mistake here.
Context: ...t { Database, Code, Server, Bot, SquareTerminal, SquareChartGantt, } fr...

(QB_NEW_EN)


[grammar] ~17-~17: There might be a mistake here.
Context: ...Code, Server, Bot, SquareTerminal, SquareChartGantt, } from "lucide-react";...

(QB_NEW_EN)


[grammar] ~18-~18: There might be a mistake here.
Context: ...t, SquareTerminal, SquareChartGantt, } from "lucide-react"; ## Introduction ...

(QB_NEW_EN)

🔇 Additional comments (3)
docs/content/docs/(root)/meta.json (1)

11-11: Nav entry looks good; slug matches new page.

The new "connect-mcp-servers" entry is correctly added under Feature Overviews and matches the MDX filename, so the route should resolve as expected.

docs/content/docs/(root)/connect-mcp-servers.mdx (2)

33-47: Confirm global availability of MDX UI components.

Steps, Step, Accordions, Accordion, Callout, and LinkToCopilotCloud are used without imports. If your MDX provider registers them globally, great—otherwise the page will error at runtime.

If not globally registered, import them explicitly or add a brief note indicating they’re provided by the docs framework.


115-129: Double-check API names: useCopilotChat.setMcpServers.

API surfaces evolve; please verify useCopilotChat exposes setMcpServers in the current @copilotkit/react-core. If the setter lives elsewhere (e.g., a different hook or provider prop), update the snippet accordingly.

To verify across the repo, run a quick grep locally for setMcpServers and confirm the import path and types.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 19, 2025

Preview environments destroyed for this pull request.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 19, 2025

Test Results

Status: ✅ Passed (View Run)

Commit: a4c1591

Duration: 288.7s

Total Tests: 37

Pass Rate: 100.0%

Failed Tests: 0

🔍 Detailed Results

coagents-research-canvas

CoAgents Research Canvas (UI) - Local Depenencies

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -
CrewAI chromium ✅ PASSED -

coagents-qa-native

CoAgents QA Native (UI) - Local

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -

coagents-qa-text

CoAgents QA Text (UI) - Local

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -
OpenAI (LGC Python) chromium ✅ PASSED -
Anthropic (LGC Python) chromium ✅ PASSED -
OpenAI (LGC JS) chromium ✅ PASSED -
Anthropic (LGC JS) chromium ✅ PASSED -

coagents-routing

CoAgents Routing (UI) - Local

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -

next-openai

Next OpenAI - Self Hosted

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -
LangChain (OpenAI) chromium ✅ PASSED -
Groq chromium ✅ PASSED -

@suhasdeshpande suhasdeshpande merged commit bb30faf into main Aug 19, 2025
23 checks passed
@suhasdeshpande suhasdeshpande deleted the suhas/docs-update branch August 19, 2025 18:28
@coderabbitai coderabbitai bot mentioned this pull request Sep 8, 2025
@coderabbitai coderabbitai bot mentioned this pull request Dec 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant