40ants MCPのロゴ

40ants MCP

組織
40ants

40ANTS-MCP is a framework for building Model Context Protocol servers in Common Lisp

公開者40ants
リポジトリmcp
言語Common Lisp
フォーク
9
スター
56
利用可能なツール
0
通信方式stdio
カテゴリ
リンク
  • ツールをAIワークフローに接続

    40ants MCPは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには56件のスターと9件のフォークがあります。

40ants-mcp - The framework for building MCP servers and clients in Common Lisp.

40ANTS-MCP ASDF System Details

About

A comprehensive framework for building Model Context Protocol (MCP) servers in Common Lisp. This library provides a complete implementation of the MCP specification with an easy-to-use API for creating servers that can interact with AI assistants like Claude Desktop.

Active development is ongoing and the interface is likely to change.

Features

  • ✅ STDIO Transport: Native support for STDIO-based communication
  • ✅ StreamableHTTP Transport: Allowing to create remotely hosted MCP servers
  • ✅ Tools System: Register and execute custom tools with JSON Schema validation
  • ✅ Built on OpenRPC: Leverages the robust 40ants OpenRPC library
  • ✅ CLOS-based: Object-oriented design with proper encapsulation
  • ✅ Easy Integration: Simple API for adding functionality
  • ✅ Error Handling: Comprehensive error management with proper JSON-RPC error codes
  • ✅ Interactive Editing: MCP tools can be edited and updated on the fly, using REPL driven approach

Roadmap

  • 🔄 Full MCP Specification Support: Complete implementation of MCP protocol version 2025-06-18
  • 🔄 Resources System: Serve dynamic and static resources via URI
  • 🔄 Prompts System: Provide prompt templates with argument interpolation
  • 🔄 MCP Client Protocol: Implement client-side protocol for connecting to MCP servers

Installation

You can install this library from Quicklisp, but you want to receive updates quickly, then install it from Ultralisp.org:

(ql-dist:install-dist "http://dist.ultralisp.org/"
                      :prompt nil)
(ql:quickload :40ants-mcp)

Usage

Here's a quick example of how to create an MCP server with custom tools:

lisp
(defpackage #:my-mcp-server
  (:use #:cl)
  (:import-from #:40ants-mcp/content/text
                #:text-content)
  (:import-from #:openrpc-server))

(in-package #:my-mcp-server)

;; Define your API
(openrpc-server:define-api (my-tools :title "My Custom Tools"))

;; Define a tool that adds two numbers
(40ants-mcp/tools:define-tool (my-tools add) (a b)
  (:summary "Adds two numbers and returns the result.")
  (:param a integer "First number to add.")
  (:param b integer "Second number to add.")
  (:result (soft-list-of text-content))
  (list (make-instance 'text-content
                      :text (format nil "The sum of ~A and ~A is: ~A"
                                  a b (+ a b)))))

;; Start the server
(40ants-mcp/server/definition:start-server my-tools)

Running as a Script

For production use, you can create a Roswell script. Create a file my-mcp.ros:

lisp
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 \"$@\"
|#

(ql:quickload '(:40ants-mcp :alexandria) :silent t)

;; Your package and tool definitions here...

(defun main (&rest argv)
  (declare (ignore argv))
  (40ants-mcp/server/definition:start-server my-tools))

Build and run the script:

bash
# Build the script
ros build my-mcp.ros

# Run the server
./my-mcp

# With remote debugging support
SLYNK_PORT=4005 ./my-mcp

Each tool you define should return a list of content items. The most common content type is text-content, but you can also return other types defined in the MCP specification.

For more examples, check the examples/ directory in the source code.

API

40ANTS-MCP/CONTENT/BASE

package 40ants-mcp/content/base

Classes

CONTENT

class 40ants-mcp/content/base:content ()

Readers

reader 40ants-mcp/content/base:content-type (content) (:TYPE = "unknown")

40ANTS-MCP/CONTENT/TEXT

package 40ants-mcp/content/text

Classes

TEXT-CONTENT

class 40ants-mcp/content/text:text-content (content)

Readers

reader 40ants-mcp/content/text:content-text (text-content) (:text)

40ANTS-MCP/HTTP-TRANSPORT

package 40ants-mcp/http-transport

Classes

HTTP-TRANSPORT

class 40ants-mcp/http-transport:http-transport ()

HTTP transport implementation for MCP (Model Context Protocol) communication. This class handles JSON-RPC message exchange via HTTP POST requests.

Readers

reader 40ants-mcp/http-transport:transport-lack-app (http-transport) ()

Lack application instance

reader 40ants-mcp/http-transport:transport-message-handler (http-transport) ()

Function to handle incoming messages

reader 40ants-mcp/http-transport:transport-port (http-transport) (:port = 8080)

Port number to listen on.

reader 40ants-mcp/http-transport:transport-running-p (http-transport) (= t)

Flag indicating if transport is active

reader 40ants-mcp/http-transport:transport-server (http-transport) ()

Clack server instance

Accessors

accessor 40ants-mcp/http-transport:transport-lack-app (http-transport) ()

Lack application instance

accessor 40ants-mcp/http-transport:transport-message-handler (http-transport) ()

Function to handle incoming messages

accessor 40ants-mcp/http-transport:transport-running-p (http-transport) (= t)

Flag indicating if transport is active

accessor 40ants-mcp/http-transport:transport-server (http-transport) ()

Clack server instance

40ANTS-MCP/SERVER/DEFINITION

package 40ants-mcp/server/definition

Classes

MCP-SERVER

class 40ants-mcp/server/definition:mcp-server (api)

Readers

reader 40ants-mcp/server/definition:server-tools-collections (mcp-server) (collections = nil)

Functions

function 40ants-mcp/server/definition:start-server tools-collections &key (transport :stdio) (port 8080)

Start the MCP server with specified transport. TRANSPORT can be :stdio or :http. PORT is only used when transport is :http.

40ANTS-MCP/SERVER/ERRORS

package 40ants-mcp/server/errors

Classes

TOOL-ERROR

condition 40ants-mcp/server/errors:tool-error ()

You should signal this error in case if the tool can't accomplish it's job.

Readers

reader 40ants-mcp/server/errors:tool-error-content (tool-error) (:content)

40ANTS-MCP/STDIO-TRANSPORT

package 40ants-mcp/stdio-transport

Classes

STDIO-TRANSPORT

class 40ants-mcp/stdio-transport:stdio-transport ()

STDIO transport implementation for MCP (Model Context Protocol) communication. This class handles JSON-RPC message exchange via standard input/output streams. It is designed to work with the MCP protocol specification for AI model communication.

Readers

reader 40ants-mcp/stdio-transport:transport-input (stdio-transport) (:input-stream = *standard-input*)

Input stream for reading JSON-RPC messages. Defaults to standard-input.

reader 40ants-mcp/stdio-transport:transport-output (stdio-transport) (:output-stream = *standard-output*)

Output stream for writing JSON-RPC responses. Defaults to standard-output.

reader 40ants-mcp/stdio-transport:transport-running-p (stdio-transport) (= t)

Flag indicating if transport is active and processing messages.

Accessors

accessor 40ants-mcp/stdio-transport:transport-input (stdio-transport) (:input-stream = *standard-input*)

Input stream for reading JSON-RPC messages. Defaults to standard-input.

accessor 40ants-mcp/stdio-transport:transport-output (stdio-transport) (:output-stream = *standard-output*)

Output stream for writing JSON-RPC responses. Defaults to standard-output.

accessor 40ants-mcp/stdio-transport:transport-running-p (stdio-transport) (= t)

Flag indicating if transport is active and processing messages.

Generics

generic-function 40ants-mcp/transport/base:receive-message transport

Receive a JSON-RPC message, returns a message or NIL.

generic-function 40ants-mcp/transport/base:send-message transport message

Send a JSON-RPC message, returns no values.

40ANTS-MCP/TOOLS

package 40ants-mcp/tools

Macros

macro 40ants-mcp/tools:define-tool name args &body body

40ANTS-MCP/TRANSPORT/BASE

package 40ants-mcp/transport/base

Generics

generic-function 40ants-mcp/transport/base:receive-message transport

Receive a JSON-RPC message, returns a message or NIL.

generic-function 40ants-mcp/transport/base:send-message transport message

Send a JSON-RPC message, returns no values.

generic-function 40ants-mcp/transport/base:start-loop transport message-handler

Starts message processing using given transport.

generic-function 40ants-mcp/transport/base:stop-loop transport

Stops message processing using given transport.


[generated by 40ANTS-DOC]

40ants MCPのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度40ants MCPに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

40ants MCPをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. 40ants MCPのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "40ants-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いて40ants MCPのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. 40ants MCPのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
40ants MCPを使ってこのタスクを手伝ってもらえますか?
40ants MCP
はい、読みました。
40ants MCPで調べた結果をお伝えします。

よくある質問

40ants MCP MCPサーバーは何に使いますか?

40ants MCPは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindで40ants MCP MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルで40ants MCPを利用できます。

TypingMindで40ants MCP MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。40ants MCPを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

40ants MCP MCPをTypingMindに接続するにはどうすればよいですか?

40ants MCPはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindで40ants MCP MCPのどのようなツールを利用できますか?

40ants MCPはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

40ants MCP MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。40ants MCPで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇