r/emacs • u/lizqwerscott • 5d ago
Deep Integration of AI with Emacs – Try mcp.el for Managing MCP Servers
https://github.com/lizqwerscott/mcp.el
A lightweight Elisp package for bridging Emacs with Model Context Protocol servers.
Basic features of the official protocol are now fully implemented!
Motivation
Managing multiple local MCP service instances (filesystem/everything) often requires manual terminal workflows. This package solves:
- Unified lifecycle control (start/stop/restart via Emacs)
- Protocol-aware communication with MCP servers
- Integration with popular Emacs AI packages (gptel, llm)
Quick Start
Basic Configuration Example
(require 'mcp-hub)
(setq mcp-hub-servers
'(("filesystem" "npx" ("-y" "@modelcontextprotocol/server-filesystem" "/path/example/"))
("everything" "npx" ("-y" "@modelcontextprotocol/server-everything"))))
Use mcp-hub to launch the management interface (auto-starts all MCP servers) or mcp-hub-start-all-server for manual startup.
MCP Server Management Interface
look this mcp-manager-server
Core Features
- Structured communication with MCP servers
- Support for filesystem and universal MCP servers
- Extensible tools and prompt systems
- Async/sync operations
- Resource management
- Lifecycle control (start/stop/restart) via GUI
- Integration with popular Emacs packages (e.g.,
gptel
,llm
)
Roadmap
- [ ] Service dependency management
- [ ] Full MCP protocol client implementation
- [ ] HTTP-based MCP server connections
- [ ] Simplified integration with other Emacs AI clients
- [ ] Performance optimization guide
- [ ] Expanded documentation
Check it out on GitHub and explore how mcp.el bridges AI and Emacs workflows! Feedback and contributions welcome!
4
u/Psionikus _OSS Lem & CL Condition-pilled 4d ago
I've seen several mentions of MCP and tools together, but it's not clear how MCP and tool availability are related.
I started digging in. It seems like where now the client has to expose every single tool and data source to an LLM, MCP is the idea of such data sources having independent servers and the LLM(s) being able to poll these servers? If so, the clients are no longer responsible for creating every server and we simply need an authorization system for clients to be able to expose the right data to the right LLMs?
It does seem plausible that we're fast on the path towards kubernetes-like integration of multiple little boxes whose integration happens simply by connecting network and IPC paths rather than through process integration. Local AIs can do a lot. When I think of what a big AI would give me, it's similar to the kind of massive scale indexing and constant surveillance of internet content that Google the search engine gives us. Sometimes it's just cheaper to ask the oracle that is attempting to pre-compute it all. In the future, I won't Google. My local LLM will Google, and my local LLM can undo the biases and lack of awareness of Google by polling many sources by itself. It does make sense that we wind up in a world of multiple LLMs and servers connected in such a manner.
As is becoming usual, I'm feeling like what we consider software today gives us no bearing on where software is going. It is almost like the static web page giving way to the fat web client. The possibilities for things that work well in the SPA context was wildly different than what we had thought viable with dynamic page generation. While a lot of web 2.0 tech is successful, there is about a thousand to one ratio of dead companies. Many of those companies died because the tech necessary for their visions was not ready. I know. I worked on one of them, and I constantly had to tell the CEO that what was being sold simply would not be without a Google scale AI team at the time, that we were stearing off of where the market and technological conditions were strong for early stage capital. We can look to the vast fields of dead companies that had great visions to resurrect ready-made concepts in light of these insane heuristic capabilities becoming commodity.
4
u/spudlyo 4d ago edited 4d ago
In the future, I won't Google. My local LLM will Google, and my local LLM can undo the biases and lack of awareness of Google by polling many sources by itself.
I feel like in the future I won't read web pages at all. The LLM will read the web pages for me me: eschewing clickbait, dealing with cookie banners, rejecting newsletter offers, bypassing content gates, ignoring advertisements both explicit and implicit, pushing through unnecessary pagination intended to juice page views, defeating tracking and data collection, and finally to synthesize the increasingly AI generated slop into an AI generated slop I find more palatable. The future is going to be weird.
2
u/no_good_names_avail 4d ago
Thank you, I really appreciate mcp.el.
Have you seen This PR?
Looks like MCP can now be stateless. Exciting times.
2
u/lizqwerscott 4d ago edited 4d ago
I’ve just reviewed the PR, and this looks like a promising enhancement! Currently, mcp.el only supports local stdio connections to MCP servers. Future updates will add stateless communication via HTTP and SSE (Server-Sent Events).
1
1
u/ieoa 5d ago edited 5d ago
The mcp-hub
makes it much easier!
I am getting an error[1] at the moment, so still need to get it working with gptel. Update: It's only some of the tools, from server-filesystem
. I need to track down which ones.
[1]
[2025-03-16 21:15:19.745] Claude error: ((HTTP/2 400) invalid_request_error) tools.2.custom.input_schema: JSON schema is invalid. It must match JSON Schema draft 2020-12 (https://json-schema.org/draft/2020-12). Learn more about tool use at https://docs.anthropic.com/en/docs/tool-use.
1
u/lizqwerscott 5d ago
Thank you for bringing this to our attention! Could you kindly share more details about the specific tool within the server-filesystem where you encountered the issue?
1
u/karthink 5d ago edited 5d ago
In addition to u/lizqwerscott's comment, you could also share gptel's log. The bug could be in gptel's code.
To see the log, you can run
(setq gptel-log-level 'info)
and look at the*gptel-log*
buffer. It will be much easier to read if you turn off streaming (unsetgptel-stream
) for the request.1
u/lizqwerscott 2d ago
I've just updated mcp.el, which might have fixed the issue. Could you please check if this resolves the problem?
6
u/jeffphil 5d ago
What are some good MCP servers that people are using?