
Emacs 内部的 Mcp 客户端
概览
[https://melpa.org/#/mcp] https://www.gnu.org/licenses/gpl-3.0] 这是一个用于与支持MCP服务器连接的[https://modelcontextprotocol.io/introduction],接口的Emacs客户端。 * 功能 - 与 MCP 服务器的结构化通信 - 支持文件系统和通用 MCP 服务器 - 可扩展的工具和提示系统 - 异步和同步操作 - 资源管理能力 - 直观的服务器生命周期管理界面(启动/停止/重启) - 与流行的 Emacs 软件包(如 gptel、LLM )集成 * 安装需要Emacs 30或更高版本(use-package mcp :ensure t :after gptel :custom (mcp-hub-servers '((“filesystem” .(:command “npx” :args (“-y” “@modelcontextprotocol/server-filesystem”):roots (“/home/lizqwer/MyProject/”))(“fetch”。(:command “uvx” :args (“mcp-server-fetch”))(“qdrant” 。(:URL “http://localhost:8000/sse"))(”graphlit“ .
概述(AI 翻译)
#+标题:MCP.el - Emacs 模型上下文协议
[[https://melpa.org/#/mcp][file:https://melpa.org/packages/mcp-badge.svg]] [[https://www.gnu.org/licenses/gpl-3.0][https://img.shields.io/badge/License-GPLv3-blue.svg]]
这是一个用于与支持MCP服务器连接的https://modelcontextprotocol.io/introduction][MCP]],接口的Emacs客户端。
- 功能特征
- 与MCP服务器的结构化通信
- 支持文件系统和通用MCP服务器
- 可扩展的工具和提示系统
- 异步与同步操作
- 资源管理能力
- 管理服务器生命周期(启动/停止/重启)的直观界面
- 与流行的Emacs软件包(如gptel、llm)集成
- 安装 需要Emacs 30或更高版本 #+begin_src elisp (使用包MCP :确保 :格普特尔之后 :custom (mcp-hub-servers '((“文件系统”(:命令“npx” :args (“-y” “@modelcontextprotocol/server-filesystem”) :roots(“/home/lizqwer/MyProject/”)) (“取”。(:命令“uvx” :args(“MCP-服务器-取”))) (“qdrant”。(:url “http://localhost:8000/sse")) (“Graphlit”。( :command “NPX” :args (“-y” “graphlit-mcp-server”) :env (
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
#+TITLE: MCP.el - Model Context Protocol for Emacs
[[https://melpa.org/#/mcp][file:https://melpa.org/packages/mcp-badge.svg]] [[https://www.gnu.org/licenses/gpl-3.0][https://img.shields.io/badge/License-GPLv3-blue.svg]]
This is an Emacs client for interfacing with [[https://modelcontextprotocol.io/introduction][MCP]], supporting connections to MCP servers.
- Features
- Structured communication with MCP servers
- Support for filesystem and generic MCP servers
- Extensible tool and prompt system
- Asynchronous and synchronous operations
- Resource management capabilities
- Intuitive interface for managing server lifecycle (start/stop/restart)
- Integration with popular Emacs packages (e.g., gptel, llm)
- Installation Need Emacs 30 or higher version #+begin_src elisp (use-package mcp :ensure t :after gptel :custom (mcp-hub-servers `((“filesystem” . (:command “npx” :args (“-y” “@modelcontextprotocol/server-filesystem”) :roots (“/home/lizqwer/MyProject/”))) (“fetch” . (:command “uvx” :args (“mcp-server-fetch”))) (“qdrant” . (:url “http://localhost:8000/sse”)) (“graphlit” . ( :command “npx” :args (“-y” “graphlit-mcp-server”) :env ( :GRAPHLIT_ORGANIZATION_ID “your-organization-id” :GRAPHLIT_ENVIRONMENT_ID “your-environment-id” :GRAPHLIT_JWT_SECRET “your-jwt-secret”))))) :config (require 'mcp-hub) :hook (after-init . mcp-hub-start-all-server)) #+end_src
- Usage ** Mcp hub *** Configuring MCP Servers #+begin_src elisp (setq mcp-hub-servers '((“filesystem” . (:command “npx” :args (“-y” “@modelcontextprotocol/server-filesystem”) :roots (“/home/lizqwer/MyProject/”))) (“fetch” . (:command “uvx” :args (“mcp-server-fetch”))) (“qdrant” . (:url “http://localhost:8000/sse”)) (“graphlit” . ( :command “npx” :args (“-y” “graphlit-mcp-server”) :env ( :GRAPHLIT_ORGANIZATION_ID “your-organization-id” :GRAPHLIT_ENVIRONMENT_ID “your-environment-id” :GRAPHLIT_JWT_SECRET “your-jwt-secret”))))) #+end_src You can use =mcp-hub-start-all-server= to start all MCP servers, such as launching all MCP servers after starting Emacs. #+begin_src elisp (add-hook 'after-init-hook #'mcp-hub-start-all-server) #+end_src *** Managing MCP Servers Use =mcp-hub= to launch the server management interface, which will automatically start all configured MCP servers.
#+html:
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →