2025.06.17
How MCP empowers Roo Code, with examples using Context7, Fetch, and more
こんにちは、次世代システム研究室のN.M.です。
Introduction
In this blog post, we will look at 3 popular MCP servers and how to set them up in your project using Roo Code, a VS Code AI assistant with strong MCP support.
What is MCP?
MCP is an open JSON-RPC 2.0 protocol that standardizes how LLM-based apps connect to external tools, data, and prompts.
Why it matters:
MCP (Model Context Protocol) addresses the same “many-to-many” integration challenge that LSP (Language Server Protocol) solved for editors: instead of hardcoding support for every tool–client pairing, MCP lets any LLM client communicate with any MCP server over the same JSON-RPC interface—greatly simplifying and scaling integrations.
A single MCP server can serve multiple types of clients, and a single client can discover and use multiple MCP servers.
MCP Servers
MCP servers can connect with their clients via JSON-RPC. MCP servers also use HTTP with Server-Sent Events (SSE) as a transport protocol. In this mode, clients send requests to the server via HTTP POST, and the server pushes asynchronous event-driven messages back to the client over a persistent SSE connection. Both stdio and HTTP/SSE transports use JSON-RPC 2.0 formatted messages for communication. There is also the option to use Docker containers to host the MCP Servers. We will keep this simple by using, local stdio MCP servers.
Roo Code Setup
Roo Code is an AI-powered autonomous coding assistant, that works as a VS Code extension.
Configure Roo Code globally and per project:
- Global config (shared among all projects)
{ "mcpServers": { "context7": { "command": "npx", "args": [ "-y", "@upstash/context7-mcp" ], "alwaysAllow": [ "resolve-library-id", "get-library-docs" ] }, "sequential-thinking": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-sequential-thinking" ], "alwaysAllow": [ "sequentialthinking" ] }, "playwright": { "command": "npx", "args": [ "-y", "@executeautomation/playwright-mcp-server" ] }, "memory": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-memory" ] }, "fetch": { "command": "uvx", "args": ["mcp-server-fetch"] } } }
- Project Specific Config (specific to the current project, and allows MCP servers to be added on a per-project basis)
{ "mcpServers": { "obsidian": { "command": "npx", "args": [ "-y", "mcp-obsidian", "./docs" ] } } }
Note: The tools used to run these MCP servers need to be installed globally on your system.
– install `npx` globally via node:
brew install node npx --version
– install `uvx` globally via npm:
curl -LsSf https://astral.sh/uv/install.sh | sh
Roo Code starts these MCP servers over stdio, enabling them within the Roo Code panel
Hints:
- Use a good model to handle interacting with MCP, such as Gemini 2.5 Pro, OpenAI GPT-4o (or other o-series models).
Context7 – Up-to-date Context Information
https://github.com/upstash/context7
What it does: gives LLMs access to the latest documentation, code examples, and patterns from popular libraries like React, Node.js, and more.
How to add new sources: use https://context7.com/add-library?tab=github and the other tabs to upload your own repo, URL, or text docs.
Prompt:
using context7, refactor this typescript chat to use ai-sdk
Sequential Thinking – Structured Refactoring
https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking
What it offers:
- breaks complex tasks into planning, implementing, reviewing, and concluding steps
- Plans are updated in real-time as you work, allowing for iterative improvements
How it helps: helps for smoother methodical code refactoring and development, especially for complex tasks.
Generally, input could follow a pattern like this:
- description of existing project and architecture
- description of goals, eg. desired refactor
- optionally, images of new screen interfaces or components
- description of test requirements
- example code to reference for similar implementation patterns
- other notes, regarding desired tools, and architecture for example
Hint
- Don’t attempt to build something you couldn’t build without AI assistance.
- If you don’t have the necessary understanding to build the feature yourself, use the AI to help you understand the concepts first, then use it to do the coding.
- Put Roo Code in architect mode when using Sequential Thinking at the planning stage. This limits Roo Code to planning oriented activities and writing to markdown files.
- Iterate until you have a plan you are happy with, then write that plan to are markdown file. You can then use this markdown content as prompt input for another session, where you implement the plan.
Fetch – URL Scraping
https://github.com/modelcontextprotocol/servers/tree/main/src/fetch
What it does: grabs web content from any URL to include in LLM context
Context7 is powerful, but sometimes you need to target a specific URL for information. This could be because the information is not yet in Context7, or, if you are using a cheaper model, the information is unable to be located.
Prompt:
use fetch to summarize https://example.com/my-lib/docs.html
Comparative Merits
Context7
Purpose:
- Access to up-to-date curated docs & patterns
Strengths:
- Fast, relevant, curated data; GitHub and text uploads
Example Prompt:
refactor this to use ai-sdk (using context7)
Sequential Thinking
Purpose:
- Structured problem solving & task planning
Strengths:
- Planning + execution loop; increases ability to handle complex tasks
Example Prompt:
describe how to modularize this monolith (sequentialthinking)
Fetch
Purpose:
- Scrape arbitrary web content into context
Strengths:
- Operates on a specific URL, simple
Example Prompt:
use fetch to summarize https://example.com/docs/api.html
Conclusion
Roo Code is one of the best MCP clients and is easy to configure. Enhanced by Context7, Sequential Thinking, and Fetch, the power of Roo Code to get work done is given a nice boost.
References
次世代システム研究室では、グループ全体のインテグレーションを支援してくれるアーキテクトを募集しています。インフラ設計、構築経験者の方、次世代システム研究室にご興味を持って頂ける方がいらっしゃいましたら、ぜひ募集職種一覧からご応募をお願いします。
グループ研究開発本部の最新情報をTwitterで配信中です。ぜひフォローください。
Follow @GMO_RD