Emacs MCP Server
Enables OpenAI models to interact with Emacs through the MCP server, as indicated by the OPENAI_API_KEY requirement in the configuration.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Emacs MCP Serveropen my todo.org file and show the first 5 items"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 taskexecute_emacs_lisp_code: passes elisp to a running Emacs (viaemacsclient) 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.pyTo install the MCP server so that Claude Desktop can use it:
mcp install emacs_mcp_server.pyBut 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 toolsexecute_emacs_lisp_codeC
Execute Emacs Lisp code by sending it to the Emacs process and return the result.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
TDQS
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| purpose | Yes |
TDQS
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.
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.
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.
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.
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.
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
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.
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.
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.
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
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
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…
A Model Context Protocol server for Wix AI tools
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Related MCP Servers
- AlicenseBqualityFmaintenanceA 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.142485,459MIT
- AlicenseBqualityDmaintenanceA 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.3110MIT
- FlicenseNot gradedqualityDmaintenanceA demonstration implementation of the Model Context Protocol server that facilitates communication between AI models and external tools while maintaining context awareness.
- AlicenseAqualityCmaintenanceA 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.53314ISC
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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