Skip to main content
Glama

Emacs MCP Server

Model Context Protocol (MCP) server for Emacs. Enables generating and running elisp code in a running Emacs process.

Tools

The server exposes two tools:

  • generate_emacs_lisp_code: generates elisp for a given task

  • execute_emacs_lisp_code: passes elisp to a running Emacs (via emacsclient) to eval and execute it.

Related MCP server: iTerm MCP

Invocation

The project is managed with uv. First, run uv sync to install all dependencies. Then source .venv/bin/activate to activate the resulting venv.

To run the MCP server in the inspector:

mcp dev emacs_mcp_server.py

To install the MCP server so that Claude Desktop can use it:

mcp install emacs_mcp_server.py

But you will have to edit the resulting JSON config in claude_desktop_config.json to include API keys and the full path to emacsclient. It should look something like this:

    "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.

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions sending code to the Emacs process and returning results, but lacks details on permissions, side effects, error handling, or execution environment. This is a significant gap for a code execution tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core functionality with zero waste. Every word earns its place, making it appropriately sized and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of code execution, lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't cover return values, error cases, or execution nuances, leaving the agent with insufficient context for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It implies the 'code' parameter is Emacs Lisp code to execute, adding basic meaning beyond the schema. However, it doesn't detail syntax, constraints, or examples, leaving gaps in parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Execute Emacs Lisp code') and the resource ('Emacs process'), specifying that it sends code and returns results. However, it doesn't explicitly differentiate from its sibling tool 'generate_emacs_lisp_code', which likely generates code rather than executing it.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives, such as its sibling 'generate_emacs_lisp_code'. The description implies usage for executing code but lacks explicit context, prerequisites, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_emacs_lisp_codeC

Generate Emacs Lisp code for the given purpose.

ParametersJSON Schema
NameRequiredDescriptionDefault
purposeYes

TDQS

C2.6/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. However, it only states what the tool does without any details on behavioral traits such as whether it's a read-only or destructive operation, authentication needs, rate limits, or what the output looks like. This makes it inadequate for informing the agent about how the tool behaves beyond its basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise and front-loaded, consisting of a single sentence that directly states the tool's purpose. There is no wasted language or unnecessary elaboration, making it efficient and easy to parse. This is an example of optimal conciseness for a simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (code generation), lack of annotations, no output schema, and low parameter documentation, the description is incomplete. It doesn't provide enough context for the agent to understand how to use the tool effectively, such as what the generated code looks like, any limitations, or how it differs from executing code. This gap makes it insufficient for a tool with these characteristics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage, meaning the schema provides no details about the 'purpose' parameter. The description adds minimal semantics by implying the parameter is for specifying the purpose of the code generation, but it doesn't explain what format or content is expected, examples, or constraints. This leaves the parameter poorly documented, failing to compensate for the low schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Generate Emacs Lisp code for the given purpose.' It specifies the verb ('Generate'), resource ('Emacs Lisp code'), and input ('given purpose'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from its sibling tool 'execute_emacs_lisp_code', which is why it doesn't score a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its sibling 'execute_emacs_lisp_code'. It doesn't mention any prerequisites, alternatives, or exclusions, leaving the agent to infer usage based on the tool name alone. This lack of explicit guidance reduces its effectiveness in helping the agent select the correct tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

C2.9/5.0
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
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    F
    maintenance
    A Model Context Protocol server that enables AI assistants to interact with the Godot game engine, allowing them to launch the editor, run projects, capture debug output, and control project execution.
    14
    248
    5,459
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server that gives AI models access to your iTerm terminal session, allowing them to read output, write commands, and send control characters.
    3
    110
    MIT
  • A
    license
    A
    quality
    C
    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
    33
    14
    ISC

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vivekhaldar/emacs-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server