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

server/2025/3/16 16:58:29/

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.ppmy.cn/server/175481.html

相关文章

数据库原理9

1.1970年美国IBM公司的研究员E.F.Codd连续发表论文&#xff0c;主要论述的是关系数据库 2.层次模型不能直接表示m:n联系 3.数据库只有一个模式&#xff0c;也只有一个内模式&#xff0c;所以模式/内模式映像是唯一的&#xff0c;它定义数据库全局逻辑结构与存储结构之间的对应…

ChatGPT、DeepSeek、Grok 三者对比:AI 语言模型的博弈与未来

&#x1f4dd;个人主页&#x1f339;&#xff1a;一ge科研小菜鸡-CSDN博客 &#x1f339;&#x1f339;期待您的关注 &#x1f339;&#x1f339; 1. 引言 随着人工智能技术的飞速发展&#xff0c;AI 语言模型已经成为人机交互、内容创作、代码生成、智能问答等领域的重要工具…

各省水资源平台 水资源遥测终端机都用什么协议

各个省水资源平台 水资源遥测终端机 的建设大部分从2012年开始启动&#xff0c;经过多年建设&#xff0c;基本都已经形成了稳定的通讯要求&#xff1b;河北瑾航科技 遥测终端机&#xff0c;兼容了大部分省市的通讯协议&#xff0c;如果需要&#xff0c;可以咨询和互相学习&…

SWPU 2021 新生赛

babyunser phar反序列化 利用文件查看器直接读到三个文件 read.php <?php include(class.php); $anew aa(); ?> error_reporting(0); $filename$_POST[file]; if(!isset($filename)){die(); } $filenew zz($filename); $contents$file->getFile(); ?> <b…

基于群智能算法的三维无线传感网络覆盖优化数学模型-可以使用群智能算法直接调用进行优化,完整MATLAB代码

1.1 三维覆盖模型 由于节点随机抛洒&#xff0c;而传感器节点的分布情况会影响网络覆盖率&#xff0c;以 R cov R_{\text{cov}} Rcov​ 作为覆盖率评价标准。在三维覆盖区域中&#xff0c;传感器节点的覆盖区域是某一半径确定的球。在三维监测区域中随机抛洒 N N N 个传感器…

如何用Python IP归属地查询API追踪网络活动?

在当今这个信息爆炸的时代&#xff0c;网络安全变得尤为重要。随着网络攻击和数据泄露事件的频发&#xff0c;了解网络活动的来源显得格外重要。使用Python结合IP归属地查询API&#xff0c;可以帮助我们追踪和分析网络活动。今天就来聊聊这个话题&#xff0c;看看怎么通过简单的…

Web3.0 从入门到实战:一站式开发指南

在科技浪潮持续翻涌的当下&#xff0c;Web3.0 作为互联网发展的全新篇章&#xff0c;正以前所未有的姿态重塑数字世界格局。从去中心化应用&#xff08;DApps&#xff09;蓬勃兴起&#xff0c;到区块链技术成为底层支撑架构&#xff0c;Web3.0 开启了一个用户真正掌控数据、价值…

PostgreSQL 时间/日期函数和操作符

PostgreSQL 提供了丰富的时间 / 日期函数和操作符&#xff0c;可用于时间和日期的处理、计算、格式化等操作&#xff0c;下面为你详细介绍&#xff1a; 常用数据类型 在介绍函数和操作符之前&#xff0c;先了解 PostgreSQL 中常用的时间 / 日期数据类型&#xff1a; DATE&am…