LB

laurynas-biveinis/mcp-server-lib.el

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

51 stars 12 forks 品質 49 トレンド 27GPL-3.0

モデルコンテキストプロトコルの Emacs Lisp 実装

概要

[[https://github.com/laurynas-biveinis/mcp-server-lib.el/actions/workflows/elisp-test.yml]]] [[[https://melpa.org/#/mcp-server-lib]]]] [[[[https://stable.melpa.org/#/mcp-server-lib]]]]]]] =mcp-server-lib.el= は、Emacs Lisp の [[https://modelcontextprotocol.io/] (MCP) サーバをビルドするためのライブラリです。 Emacsパッケージのインフラストラクチャを提供し、大規模なランゲージモデルにツールやリソースとして機能を公開します。 - ツール(Elisp関数)とリソースを登録するためのシンプルなAPI - マルチサーバーサポート - URIパターンマッチング(RFC 6570サブセット)を備えたリソーステンプレート - MCPプロトコル通信とJSON-RPCメッセージを処理する - emacsclientラッパースクリプトを介してStdioトランスポート - 組み込みのメトリックとデバッグサポート - Emacs 27.1以降 - Emacsデーモンを実行(stdioトランスポート用) - [[[https://github.com/laurynas-biveinis/elisp-dev-mcp]]] - 開発支援ツールの排除 - [[[[[https://github.]]

概要(AI 翻訳)

#+TITLE:mcp-server-lib.el - Emacs Lisp用のモデルコンテキストプロトコルサーバーライブラリ

[[[https://github.com/laurynas-biveinis/mcp-server-lib.el/actions/workflows/elisp-test.yml][https://github.com/laurynas-biveinis/mcp-server-lib.el/actions/workflows/elisp-test.yml/badge.svg]]]]] [[[https://github.com/laurynas-biveinis/mcp-server-lib.el/actions/workflows/linter.yml][https://github.com/laurynas-biveinis/mcp-server-lib.el/actions/workflows/linter.yml/badge.svg]]]] [[[https://melpa.org/#/mcp-server-lib][https://melpa.org/packages/mcp-server-lib-badge.svg]]]] [[[https://stable.melpa.org/#/mcp-server-lib][file:https://stable.melpa.org/packages/mcp-server-lib-badge.svg]]]]]

  • 概要

=mcp-server-lib.el= は、Emacs Lisp の [[[[https://modelcontextprotocol.io/][Model コンテキストプロトコル] (MCP) サーバをビルドするためのライブラリです。 Emacsパッケージのインフラストラクチャを提供し、大規模なランゲージモデルにツールやリソースとして機能を公開します。

*特徴

  • ツール(Elisp関数)とリソースを登録するためのシンプルなAPI
  • マルチサーバのサポート
  • URIパターンマッチングによるリソーステンプレート(RFC 6570サブセット)
  • MCP プロトコル通信と JSON-RPC メッセージの処理

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

#+TITLE: mcp-server-lib.el - Model Context Protocol Server Library for Emacs Lisp

[[https://github.com/laurynas-biveinis/mcp-server-lib.el/actions/workflows/elisp-test.yml][https://github.com/laurynas-biveinis/mcp-server-lib.el/actions/workflows/elisp-test.yml/badge.svg]] [[https://github.com/laurynas-biveinis/mcp-server-lib.el/actions/workflows/linter.yml][https://github.com/laurynas-biveinis/mcp-server-lib.el/actions/workflows/linter.yml/badge.svg]] [[https://melpa.org/#/mcp-server-lib][https://melpa.org/packages/mcp-server-lib-badge.svg]] [[https://stable.melpa.org/#/mcp-server-lib][file:https://stable.melpa.org/packages/mcp-server-lib-badge.svg]]

  • Overview

=mcp-server-lib.el= is a library for building [[https://modelcontextprotocol.io/][Model Context Protocol]] (MCP) servers in Emacs Lisp. It provides the infrastructure for Emacs packages to expose their functionality as tools and resources to Large Language Models.

  • Features
  • Simple API for registering tools (Elisp functions) and resources
  • Multi-server support
  • Resource templates with URI pattern matching (RFC 6570 subset)
  • Handles MCP protocol communication and JSON-RPC messages
  • Stdio transport via emacsclient wrapper script
  • Built-in usage metrics and debugging support
  • Requirements
  • Emacs 27.1 or later
  • Running Emacs daemon (for stdio transport)
  • MCP servers built on this library
  • Installation

From [[https://melpa.org/#/mcp-server-lib][MELPA]] or [[https://stable.melpa.org/#/mcp-server-lib][MELPA Stable]]:

=M-x package-install RET mcp-server-lib RET=

  • For Users

If you’re using an MCP server built with this library:

  1. Run =M-x mcp-server-lib-install= to install the stdio script
  2. The script will be at =~/.emacs.d/emacs-mcp-stdio.sh=
  3. Follow your MCP server’s documentation for client registration

Available commands:

  • =M-x mcp-server-lib-start= - Start the MCP server
  • =M-x mcp-server-lib-stop= - Stop the MCP server
  • =M-x mcp-server-lib-describe-setup= - View registered tools and resources with usage statistics
  • =M-x mcp-server-lib-show-metrics= - View usage metrics
  • =M-x mcp-server-lib-uninstall= - Remove the stdio script
  • For Developers

To build your own MCP server, see [[https://github.com/laurynas-biveinis/elisp-dev-mcp][elisp-dev-mcp]] for a complete example.

** Client Registration

Register your MCP server with a client using the stdio script:

#+BEGIN_EXAMPLE claude mcp add -s user -t stdio your-server – ~/.emacs.d/emacs-mcp-stdio.sh
–init-function=your-init-func --stop-function=your-stop-func #+END_EXAMPLE

Script options:

  • =–init-function=NAME= - Emacs function to call on startup
  • =–stop-function=NAME= - Emacs function to call on shutdown
  • =–socket=PATH= - Custom Emacs server socket (optional)
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →