The GitHub Blog 14小时前
5 ways to transform your workflow using GitHub Copilot and MCP
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

文章探讨了Model Context Protocol (MCP) 如何通过连接AI助手(如GitHub Copilot)与外部工具和服务,革新软件开发流程。MCP允许AI助手安全地访问设计规范、知识库、测试工具和监控系统,从而简化任务、提高效率。文章以JWT身份验证系统为例,详细介绍了MCP在Figma设计集成、Obsidian知识库访问、Playwright测试、Pull Request生成和Grafana监控等方面的应用,展示了MCP如何提升开发者的工作效率。

🎨 通过MCP,AI助手可以连接Figma,直接获取设计规范,生成与设计一致的代码,减少手动转换,提高设计与开发的协同效率。

🧠 MCP能够将AI助手与Obsidian知识库连接,方便开发者检索团队的历史决策、架构笔记和研究成果,从而快速获取上下文信息,加速开发流程。

🧪 利用MCP,AI助手可以与Playwright集成,自动生成测试用例并运行,简化测试过程,提高代码质量,特别是在复杂的身份验证流程中。

🚀 MCP支持AI助手自动生成Pull Request,分析代码更改、相关问题和团队审查模式,并推荐审查者,加速代码合并,提高团队协作效率。

📊 通过MCP,AI助手可以连接Grafana,监控应用程序的性能指标,如延迟和错误率,帮助开发者快速定位问题,优化应用程序的性能。

Traditional AI coding assistants typically operate in isolation, limited to the code in your current workspace. Now with the introduction of the Model Context Protocol (MCP), AI development workflows are further evolving to incorporate more tools and context. 

MCP can enable AI assistants to interact with external systems like knowledge bases, data stores, and testing applications.

The real value of MCP integration is that you can now perform tasks that previously required multiple tools, context switching, and manual effort—all directly in your IDE. That means you can save time, maintain focus, and ship code faster.

In this article, we’ll explore five practical ways MCP integrations with GitHub Copilot can streamline your workflow. We’ll follow a realistic scenario: implementing a secure JWT (JSON Web Token) authentication system for a web application, illustrating an end-to-end workflow with MCP.

Let’s jump in. 

1. Using MCP to bridge design and development with Figma 

The gap between design and development has long been a source of friction in product teams. MCP provides a standardized way for GitHub Copilot to securely access and interpret design specifications directly. 

Instead of manually translating design details into code, MCP enables Copilot to automatically retrieve exact design parameters—such as colors, spacing, typography, and component states—and generate accurate, ready-to-use code. This integration reduces guesswork and streamlines the handoff between designers and developers.

We’ll start developing our new JWT authentication system by taking a look at the user-facing side. Let’s say the design team updated the authentication UI components in Figma, including login forms, error states, loading spinners, and success messages. Now, you need to implement these changes to match the new design system.

Start by asking Copilot, “What are the latest design updates for the login form and authentication components?” It will then retrieve specs for the elements that need to change. Then you can prompt it to create React components for each element:

Copilot will then give you ready-to-use code that maintains consistency with the design specifications from Figma.

Learn more about Figma’s MCP server beta >

2. Tap into your Obsidian knowledge base with MCP

When implementing complex features like JWT authentication, you often need to reference past decisions, architectural notes, and research findings scattered across your knowledge base. The unofficial, community-maintained Obsidian MCP server bridges this gap by connecting GitHub Copilot directly to your Obsidian vault.

Let’s say you’re implementing JWT token validation and need to understand your team’s previous security decisions. You tell Copilot: “Search for all files where JWT or token validation is mentioned and explain the context.”

With that, Copilot can:

You might follow up with the following prompt: “Get the contents of the last architecture call note about authentication and summarize the key decisions.” Copilot will locate the relevant file and extract the critical information you need to inform your implementation approach.

Once you’ve gathered the necessary context, you can ask Copilot to synthesize this information: “Create a new note called ‘jwt-implementation-summary.md’ that combines our authentication standards with the new JWT approach.” Copilot will create this documentation directly in your vault, helping maintain your team’s knowledge base.

Setup note: This integration requires the community “Obsidian Local REST API” plugin and an API key.

With your research complete and documented, you can proceed to test your application.

Learn more about accessing Obsidian through MCP >

3. Test your code with Playwright

Integrating MCP with Playwright transforms test creation from a manual, error-prone process into a simple, guided experience.

Modern web applications often involve complex user journeys, asynchronous operations, and dynamic content. Authentication flows are particularly challenging to test comprehensively.

Continuing with our JWT authentication system, you need to test the complete authentication flow including login, token refresh, and secure route access. To do this, you’ll start by giving Copilot a prompt like this: “Test the JWT authentication flow including login, automatic token refresh, and access to protected routes.”

From there, Copilot will analyze your authentication implementation and generate comprehensive test coverage. But it doesn’t stop there. Copilot then runs the tests with Playwright and provides immediate feedback on failures, suggesting fixes for common issues, like timing problems or selector changes.

Learn more about the Playwright MCP server >

4. File pull requests faster

Pull requests are the cornerstone of collaborative development. GitHub’s remote MCP server, now in public beta for VS Code or Visual Studio, helps transform the process into an intelligent, automated workflow.

Turning back to our JWT authentication example, you can prompt Copilot: “Create a pull request for my authentication feature changes”

Copilot will then analyze:

Copilot returns Markdown with an overview, changes made, a testing strategy, and even related issues.

It will then suggest appropriate reviewers for each aspect of the change based on code ownership, expertise mapping, and current workload.

Once your application is deployed, you can move on to monitoring it.

Get started with GitHub’s MCP server >

5. Monitor application performance

With the core authentication logic handled, now it’s time to ensure that our application performs well by monitoring how it behaves in production. Using MCP to connect to Grafana through the open-source Grafana MCP server makes this easier—though setup requires a few configuration steps.

Let’s say you need to analyze the JWT authentication system’s latency metrics and error rates. You tell Copilot: “Show me auth latency and error-rate panels for the auth-service dashboard for the last 6 hours.”

After configuring the Grafana MCP server with your API key and host URL, Copilot can then query your Grafana instance to:

Copilot returns panel data as base64-encoded images and can extract raw time-series data when needed. If you need a longer time range, you can specify: “Show me the same metrics for the last 24 hours” and Copilot will adjust the query parameters accordingly.

For more advanced monitoring workflows, you can enable write operations by launching the server with the --enable-write flag and an Editor-role API key. This allows Copilot to create new alert rules or modify dashboard configurations based on your authentication metrics analysis.

Learn more about the Grafana MCP server >

What’s next?

Before diving into these powerful integrations, you’ll need to configure your development environment. Here’s how:

    Install MCP extensions: Enable MCP support in your IDE through official extensionsConfigure API access: Set up authentication for each service (GitHub, Obsidian, Figma, etc.)Define context boundaries: Establish what information should be accessible to AISecurity considerations: Implement proper access controls and data privacy measures

A few best practices:

The five integration patterns we’ve explored represent just the beginning of what’s possible. As MCP’s ecosystem grows, new tools and integrations will continue to expand what’s possible.

Get started with our remote MCP server >

The post 5 ways to transform your workflow using GitHub Copilot and MCP appeared first on The GitHub Blog.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

MCP协议 AI助手 软件开发 GitHub Copilot
相关文章