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.mzph.cn/news/897901.shtml

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

相关文章

Spring Boot 约定大于配置:实现自定义配置

文章目录 Spring Boot 约定大于配置&#xff1a;实现自定义配置引言1. Spring Boot 的约定大于配置2. 自定义配置的需求3. 实现自定义配置的步骤4. 示例&#xff1a;自定义 Spring MVC 配置4.1 创建自定义配置类4.2 创建自定义拦截器4.3 测试自定义配置 5. 其他自定义配置场景5…

交易系统优化方案

证券交易系统优化方案 一、选股策略体系 (一)择时策略矩阵 尾盘集中筛选法(14:30后)聚焦量价异动个股,捕捉次日溢价机会早盘转债套利法(9:25-10:00)通过可转债与正股联动性捕捉日内机会龙头战法(全时段)行业板块强度排序,锁定前三大市值龙头容量资金战法(中盘股适用…

在线Doc/Docx转换为PDF格式 超快速转换的一款办公软件 文档快速转换 在线转换免费转换办公软件

小白工具https://www.xiaobaitool.net/files/word-pdf/提供了一项非常实用的在线服务——将Doc或Docx格式的文档快速转换为PDF格式。这项服务不仅操作简单&#xff0c;而且转换效率高&#xff0c;非常适合需要频繁处理文档转换的用户。 服务特点&#xff1a; 批量转换&#x…

java学习总结(四)MyBatis多表

一、多表结构 学生表、班级表、课程表、班级课程表 二、一对一 一个学生只属于一个班级。 查询&#xff1a;id name age gender banjiName SELECT s.id,s.name,s.age,s.gender,b.id AS banjiId,b.name AS banjiName FROM student AS s INNER JOIN banji AS b ON s.banji_id…

大语言模型学习及复习笔记(1)语言模型的发展历程

1.大模型进入人们视野 ChatGPT 于2022年11月底上线 模型名称 发布时间 核心突破 GPT-3 2020年6月 首款千亿参数模型&#xff0c;少样本学习 GPT-3.5-Turbo 2022年11月 对话能力优化&#xff0c;用户级应用落地 GPT-4 2023年3月 多模态、强逻辑推理 GPT-4o / GPT-4…

【NLP】 3. Distributional Similarity in NLP(分布式相似性)

Distributional Similarity in NLP&#xff08;分布式相似性&#xff09; 分布式相似性&#xff08;Distributional Similarity&#xff09; 是自然语言处理&#xff08;NLP&#xff09;中的核心概念&#xff0c;基于“相似的单词出现在相似的上下文中”这一假设。它用于衡量单…

【C#学习】协程等待

来源GPT&#xff0c;仅记录学习 yield return WaitForEndOfFrame() 适用于 渲染结束后再执行代码&#xff0c;但 WebGL 可能不适合这个操作&#xff0c;会拖慢帧率。(渲染得太慢&#xff09; yield return null; 让代码在下一帧的 Update() 里继续运行&#xff0c;更加流畅。 …

【项目】负载均衡式在线OJ

负载均衡式在线OJ 目录 负载均衡式在线OJ 1.项目介绍&#xff1a; 2.comm 2.1 log.hpp 日志等级 开放式日志 时间戳工具 2.2 util.hpp TimeUtil类 PathUtil类 FileUtil类 StringUtil类 3.Compile_server 3.1compile_run.hpp RemoveTempFile CodeToDesc Start 3.…

实现“XXX一张图“进行环境设施设备可视化管理

实现“电网一张图”、“铁路一张图”、“水库一张图”、“森林一张图”等概念,本质上是将某一领域的空间数据、设施设备、运行状态等信息整合到一个统一的数字化平台上,实现全域可视化、智能化管理和协同运营。这种“一张图”模式依赖于地理信息系统(GIS)、物联网(IoT)、…

《基於Python的网络爬虫抓包技术研究与应用》

## 摘要 本文探讨了基于Python的网络爬虫抓包技术及其应用。随着互联网数据的快速增长&#xff0c;网络爬虫技术在数据采集和分析中扮演着越来越重要的角色。本研究首先介绍了网络爬虫的基本概念和Python在爬虫开发中的优势&#xff0c;然后深入分析了抓包技术的原理和常用工具…

【蓝桥杯速成】| 1.暴力解题

1高频考点与暴力解题_哔哩哔哩_bilibili 感谢up主分享&#xff0c;以下内容是学习笔记&#xff0c;以c为主&#xff0c;部分python 题目一&#xff1a;维纳的年龄 题目内容 美国数学家维纳(N.Wiener)智力早熟&#xff0c; 11岁就上了大学。他曾在1935~1936年应邀来中国清华大…

[C++Qt] 槽函数收不到信号问题(信号的注册)

&#x1f4e2;博客主页&#xff1a;https://loewen.blog.csdn.net&#x1f4e2;欢迎点赞 &#x1f44d; 收藏 ⭐留言 &#x1f4dd; 如有错误敬请指正&#xff01;&#x1f4e2;本文由 丶布布原创&#xff0c;首发于 CSDN&#xff0c;转载注明出处&#x1f649;&#x1f4e2;现…

从零开始用AI开发游戏(一)

1. 核心玩法设计 核心目标&#xff1a;玩家需在随机生成的3D迷宫中寻找出口&#xff0c;躲避陷阱、收集道具、解开谜题。核心机制&#xff1a; 随机生成迷宫&#xff1a;每次游戏生成不同结构的迷宫&#xff08;递归分割算法或深度优先搜索&#xff09;。第一人称视角&#xf…

基于ssm的宠物医院信息管理系统(全套)

一、系统架构 前端&#xff1a;html | layui | vue | element-ui 后端&#xff1a;spring | springmvc | mybatis 环境&#xff1a;jdk1.8 | mysql | maven | tomcat | idea | nodejs 二、代码及数据库 三、功能介绍 01. web端-首页1 02. web端-首页…

【CXX】6.7 SharedPtr<T> — std::shared_ptr<T>

std::shared_ptr 的 Rust 绑定称为 SharedPtr。 限制&#xff1a; SharedPtr 不支持 T 为不透明的 Rust 类型。对于在语言边界上传递不透明 Rust 类型的所有权&#xff0c;应改用 Box&#xff08;C 中的 rust::Box&#xff09;。 示例 // src/main.rsuse std::ops::Deref; …

利用python生成excel中模板范围对应的shape文件

利用python生成excel中模板范围对应的shape文件 # -*- coding: utf-8 -*- import os.pathimport pandas as pd from shapely.geometry import Polygon from shapely.wkt import dumps import argparse# 创建解析器 parser argparse.ArgumentParser(description"这是一个…

cursor使用

引入私有文档 设置-> Features->下滑找到Docs url后边多加一个 / 可以拉取url下所有的页面(子页面&#xff0c;子目录)&#xff0c;不加只拉取url当前页面 使用 选择 Docs 回车 选择 文档 直接解析链接 链接 回车 搜索引擎 web 对比git版本差异 git 选择其中一个 g…

达梦数据库中插入导出图片的方法与应用

达梦数据库中插入导出图片的方法与应用 在数据库的实际应用场景中&#xff0c;图片存储是一项常见且重要的需求。以电商平台为例&#xff0c;商品展示图片是吸引消费者的关键元素&#xff1b;而在社交软件里&#xff0c;用户头像更是个人形象的直观体现。针对达梦数据库&#…

【云原生】动态资源分配(DRA)深度洞察报告

1. DRA 的发展与设计灵感 Kubernetes 早期通过 Device Plugin&#xff08;设备插件&#xff09;机制支持 GPU、NIC 等特殊硬件&#xff0c;将节点上可用设备数量上报给 kubelet 和调度器。但设备插件模式存在局限&#xff1a;调度器只能根据节点标签等属性粗粒度筛选&#xff…

嵌入式八股ARM篇

前言 ARM篇主要介绍一下寄存器和中断机制,至于汇编这一块…还请大家感兴趣自行学习 1.寄存器 R0 - R3 R4 - R11 寄存器 R0 - R3一般用作函数传参 R4 - R11用来保存程序运算的中间结果或函数的局部变量 在函数调用过程中 注意在发生异常的时候 cortex-M0架构会自动将R0-R3压入…