Skip to main content
Glama

Emacs MCP 服务器

Emacs 的模型上下文协议 (MCP) 服务器。支持在正在运行的 Emacs 进程中生成和运行 elisp 代码。

工具

该服务器公开了两个工具:

  • generate_emacs_lisp_code :为给定任务生成 elisp

  • execute_emacs_lisp_code :将 elisp 传递给正在运行的 Emacs(通过emacsclient )进行 eval 并执行它。

Related MCP server: iTerm MCP Server

调用

该项目使用uv进行管理。首先,运行uv sync安装所有依赖项。然后source .venv/bin/activate激活生成的 venv。

要在检查器中运行 MCP 服务器:

mcp dev emacs_mcp_server.py

安装 MCP 服务器以便 Claude Desktop 可以使用它:

mcp install emacs_mcp_server.py

但是你必须编辑claude_desktop_config.json中生成的 JSON 配置,以包含 API 密钥和emacsclient的完整路径。它应该看起来像这样:

    "Emacs-MCP-Server": {
      "command": "/Users/haldar/.local/bin/uv",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "--with",
        "smartfunc",
        "mcp",
        "run",
        "/Users/haldar/repos/gh/emacs-mcp-server/emacs_mcp_server.py"
      ],
      "env": {
          "OPENAI_API_KEY": "sk-xxxx",
          "EMACSCLIENT": "/your/path/to/emacsclient"
      }
    }

Available Tools

2 tools
execute_emacs_lisp_codeC

Execute Emacs Lisp code by sending it to the Emacs process and return the result.

Inputs: code (required).

generate_emacs_lisp_codeC

Generate Emacs Lisp code for the given purpose.

Inputs: purpose (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: one executes Emacs Lisp code, while the other generates it. There is no overlap or ambiguity between these functions, making it easy for an agent to select the appropriate tool based on the task.

    Naming Consistency5/5

    Both tools follow a consistent verb_noun pattern with 'execute_emacs_lisp_code' and 'generate_emacs_lisp_code'. The naming is uniform, using snake_case and clear verbs that accurately describe each tool's action.

    Tool Count2/5

    With only two tools, the server feels thin for an Emacs integration, as it lacks operations like editing files, managing buffers, or handling common Emacs commands. This minimal set may limit agents in performing typical Emacs-related tasks.

    Completeness2/5

    The tool surface is severely incomplete for an Emacs server, covering only code execution and generation. It misses essential CRUD/lifecycle operations such as opening files, saving changes, or interacting with Emacs modes, which are core to the domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      Not graded
      maintenance
      A Model Context Protocol server that enables AI assistants to interact with iTerm2 terminals, allowing creation and management of terminal sessions, command execution, and reading terminal output.
      5
      32 npm
      14
      ISC
    • F
      license
      A
      quality
      Not graded
      maintenance
      A Model Context Protocol server that allows LLMs to interact with Python environments, enabling code execution, file operations, package management, and development workflows.
      9
      -
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that enables AI assistants to manage Godot projects, scenes, and editor operations through natural language commands.
      16
      90
      MIT