Mac下安装Zed以及Zed对MCP(模型上下文协议)的支持

Zed是当前新流行的一种编辑器,支持MCP(模型上下文协议)

Mac下安装Zed比较简单,直接有安装包,在这里:

brew install --cask zed

Mac Monterey下是可以安装上的,亲测有效。

配置

使用Ctrl+Shift+P调出AI,然后设置使用的模型

可以使用deepseek,但是没有找到使用自建服务器的设置方法,有些遗憾。

附加学习

关于Zed里面的MCP部分,手册:Model Context Protocol - Zed 

也就是有个Postgres数据库的MCP Server的扩展,代码在:https://github.com/zed-extensions/postgres-context-server

配置和使用,见后面

Zed Postgres Context Server

This extension provides a Model Context Server for Postgres, for use with the Zed AI assistant.

It adds a /pg-schema slash command to the Assistant Panel.

Configuration

To use the extension, you will need to point the context server at a Postgres database by setting the database_url in your Zed settings.json:

{"context_servers": {"postgres-context-server": {"settings": {"database_url": "postgresql://myuser:mypassword@localhost:5432/mydatabase"}}}
}

Usage

  • /pg-schema <table-name>: Retrieve the schema for the table with the given name.
  • /pg-schema all-tables: Retrieve the schemas for all tables in the database.

 

设置参考这里:Context Server Extensions - Zed 

 

Model Context Protocol

Zed uses the Model Context Protocol to interact with context servers:

The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you're building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.

Check out the Anthropic news post and the Zed blog post for an introduction to MCP.

Try it out

Want to try it for yourself?

The following context servers are available today as Zed extensions:

  • Postgres Context Server

Bring your own context server

If there's an existing context server you'd like to bring to Zed, check out the context server extension docs for how to make it available as an extension.

If you are interested in building your own context server, check out the Model Context Protocol docs to get started.

Context Servers

Extensions may provide context servers for use in the Assistant.

Example extension

To see a working example of an extension that provides context servers, check out the postgres-context-server extension.

This extension can be installed as a dev extension if you want to try it out for yourself.

Defining context servers

A given extension may provide one or more context servers. Each context server must be registered in the extension.toml:

 

[context_servers.my-context-server]

Then, in the Rust code for your extension, implement the context_server_command method on your extension:

 
 

impl zed::Extension for MyExtension { fn context_server_command( &mut self, context_server_id: &ContextServerId, project: &zed::Project, ) -> Result<zed::Command> { Ok(zed::Command { command: get_path_to_context_server_executable()?, args: get_args_for_context_server()?, env: get_env_for_context_server()?, }) } }

This method should return the command to start up a context server, along with any arguments or environment variables necessary for it to function.

If you need to download the context server from an external source—like GitHub Releases or npm—you can also do this here.

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/34117.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

代码随想录day17 二叉树part05

654.最大二叉树 给定一个不重复的整数数组 nums 。 最大二叉树 可以用下面的算法从 nums 递归地构建: 创建一个根节点&#xff0c;其值为 nums 中的最大值。 递归地在最大值 左边 的 子数组前缀上 构建左子树。 递归地在最大值 右边 的 子数组后缀上 构建右子树。 返回 nums …

【Python入门】一篇掌握Python中的字典(创建、访问、修改、字典方法)【详细版】

&#x1f308; 个人主页&#xff1a;十二月的猫-CSDN博客 &#x1f525; 系列专栏&#xff1a; &#x1f3c0;《Python/PyTorch极简课》_十二月的猫的博客-CSDN博客 &#x1f4aa;&#x1f3fb; 十二月的寒冬阻挡不了春天的脚步&#xff0c;十二点的黑夜遮蔽不住黎明的曙光 目…

LeetCode 环形链表II:为什么双指针第二次会在环的入口相遇?

快慢指针 为什么相遇后让快指针回到起点&#xff0c;再让快指针和慢指针都一步一步地走&#xff0c;它们就会在环的入口相遇&#xff1f; 复杂度 时间复杂度: O(n) 空间复杂度: O(1) public ListNode detectCycle(ListNode head) {ListNode slow head, fast head;ListNode …

HarmonyOS第24天:鸿蒙应用安全秘籍:如何为用户数据筑牢防线?

开篇引入 在数字化时代&#xff0c;我们的生活越来越依赖各种应用程序。从社交娱乐到移动支付&#xff0c;从健康管理到工作学习&#xff0c;应用已经渗透到生活的方方面面。然而&#xff0c;随着应用使用的日益频繁&#xff0c;用户隐私数据泄露的风险也在不断增加。 前几年&…

P2730 魔板 (写了巨久..有一些数字,字符,字符串之间的转换规则)

ac代码&#xff1a; #include<iostream> #include<map> #include<queue> using namespace std; map<string,int>mp1,mp2; map<string,string>mp3; queue<string>q; string str,res"12345678"; void pri(string str){if(resstr)…

Centos7使用docker搭建redis集群

前置准备&#xff1a; Centos7安装docker就不多说了… 本次目的是搭建3主3从&#xff08;当然你也可以按需扩展&#xff09;准备三台服务器&#xff0c;假定IP分别为&#xff1a;192.168.75.128、192.168.75.129、192.168.75.130安装 redis&#xff1a; #拉取redis docker p…

Java 用While语句判断密码是否输入正确

package com.MyJava; import java.util.Scanner;public class While {public static void main(String[] args) {Scanner Myscan new Scanner(System.in); int i 0,n 3; //n为有效密码次数System.out.print("请输入密码&#xff1a;");String Password Myscan.ne…

Browser Copilot 开源浏览器扩展,使用现有或定制的 AI 助手来完成日常 Web 应用程序任务。

一、软件介绍 文末提供源码和开源扩展程序下载 Browser Copilot 是一个开源浏览器扩展&#xff0c;允许您使用现有或定制的 AI 助手来帮助您完成日常 Web 应用程序任务。 目标是提供多功能的 UI 和简单的框架&#xff0c;以实现和使用越来越多的 copilots&#xff08;AI 助手&…

探索Maas平台与阿里 QWQ 技术:AI调参的魔法世界

摘要&#xff1a;本文介绍了蓝耘 Maas 平台在人工智能领域的表现及其核心优势&#xff0c;包括强大的模型支持、高效的资源调度和友好的操作界面。文章还探讨了蓝耘 Maas 平台与阿里 QWQ 技术的融合亮点及应用拓展实例&#xff0c;并提供了调参实战指南&#xff0c;最后对蓝耘 …

3.2 组件Props的TS高级类型校验模式

文章目录 1. 组件Props校验的核心价值2. 基础类型校验回顾2.1 基本类型声明2.2 类型系统限制3. 高级类型校验模式3.1 类型模板字面量3.2 条件类型约束3.3 递归类型结构4. 泛型组件模式4.1 基础泛型定义4.2 泛型约束扩展5. 高级联合类型应用5.1 动态表单校验5.2 状态机驱动类型6…

Vim软件使用技巧

目录 Demo Vim怎么看一个文件的行号&#xff0c;不用打开文件的前提下&#xff1f;进入文件后怎么跳转到某一行? 不打开文件查看行号&#xff08;查看文件的方法&#xff09; 方法1、使用命令行工具统计行数 方法2、通过vim的 - 参数查看文件信息 进入文件后跳转到指定行…

C 语 言 --- 二 维 数 组 的 应 用

C 语 言 --- 二 维 数 组 的 应 用 第 一 题 - - - 冒 泡 排 序冒 泡 排 序冒 泡 排 序 的 原 理 第 二 题 - - - 回 型 矩 阵特 点 第 三 题 - - - 蛇 形 矩 阵总结 &#x1f4bb;作者简介&#xff1a;曾 与 你 一 样 迷 茫&#xff0c;现 以 经 验 助 你 入 门 C 语 言 &…

微信小程序实现根据不同的用户角色显示不同的tabbar并且可以完整的切换tabbar

直接上图上代码吧 // login/login.js const app getApp() Page({/*** 页面的初始数据*/data: {},/*** 生命周期函数--监听页面加载*/onLoad(options) {},/*** 生命周期函数--监听页面初次渲染完成*/onReady() {},/*** 生命周期函数--监听页面显示*/onShow() {},/*** 生命周期函…

CTA重建:脑血管重建,CT三维重建,三维建模 技术,实现

CTA&#xff08;CT血管造影&#xff09;是一种基于CT扫描的医学成像技术&#xff0c;主要用于血管系统的三维重建和可视化。脑血管重建是CTA的重要应用之一&#xff0c;能够帮助医生诊断脑血管疾病&#xff08;如动脉瘤、狭窄、畸形等&#xff09;。以下是实现CTA脑血管重建、C…

告别XML模板的繁琐!Word文档导出,easy!

word模板导出 最近项目中有个功能&#xff0c;导出月报&#xff0c;发现同事使用了docx格式模板,感觉比之前转成xml的简单多了&#xff0c;这边记录下使用方法。 xml方式导出word,模板太复杂了 资料 poi-tl 一个基于Apache POI的Word模板引擎&#xff0c;也是一个免费开源的Jav…

Vue 过滤器深度解析与应用实践

文章目录 1. 过滤器概述1.1 核心概念1.2 过滤器生命周期 2. 过滤器基础2.1 过滤器定义2.2 过滤器使用 3. 过滤器高级用法3.1 链式调用3.2 参数传递3.3 动态过滤器 4. 过滤器应用场景4.1 文本格式化4.2 数字处理4.3 数据过滤 5. 性能优化与调试5.1 性能优化策略5.2 调试技巧 6. …

ST电机库电流采样 三电阻单ADC

一、概述 下图是三电阻采样的电路结构 其中流过三相系统的电流I1、I2、I3遵循以下关系: 因此,为了重建流过普通三相负载的电流,在我们可以用以上公式计算的情况下,只需要对三相中的两相进行采样即可。 STM32的ADC可以很灵活的配置成同步采集两路ADC数据,…

【测试篇】打破测试认知壁垒,从基础概念起步

前言 &#x1f31f;&#x1f31f;本期讲解关于测试的基本概念相关知识介绍~~~ &#x1f308;感兴趣的小伙伴看一看小编主页&#xff1a;GGBondlctrl-CSDN博客 &#x1f525; 你的点赞就是小编不断更新的最大动力 &#x1f386;那么废话…

SpringBoot MCP 入门使用

随着AI的火爆&#xff0c;最近发现MCP在未来确实大有可为&#xff0c;作为一名javaer怎么可以落后在历史洪流呢&#xff0c;根据官网和cursor也从零开始体验一下自定义mcp server。以后可以根据自己业务场景做出各种适合自身业务的工具。 至于什么是MCP 可以到https://modelcon…

@Autowired和@Resource的区别是?

前情回顾 正确使用Autowired Autowired 注解在构造器上的使用规则&#xff08;字段注入也挺好的&#xff09; 正确使用Resource 来源不同 Autowired的“爹”是Spring Resource的“爹”是Java&#xff08;JSR-250&#xff09; 这是一个规范&#xff0c;Spring对这个注解进行…