40ants MCP logo

40ants MCP

Organization
40ants

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

Publisher40ants
Repositorymcp
LanguageCommon Lisp
Forks
9
Stars
56
Available tools
0
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    40ants MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    56 stars and 9 forks from the linked repository.

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]

Use 40ants MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once 40ants MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add 40ants MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the 40ants MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "40ants-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the 40ants MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the 40ants MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use 40ants MCP to help me with this task?
40ants MCP
Sure. I read it.
Here is what I found using 40ants MCP.

Frequently asked questions

What is the 40ants MCP MCP server used for?

40ants MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use 40ants MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use 40ants MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use 40ants MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With 40ants MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect 40ants MCP MCP to TypingMind?

40ants MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does 40ants MCP MCP provide in TypingMind?

40ants MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use 40ants MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If 40ants MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇