Logo di 40ants MCP

40ants MCP

Organizzazione
40ants

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

Autore40ants
Repositorymcp
LinguaCommon Lisp
Fork
9
Stelle
56
Strumenti disponibili
0
Tipo di trasportostdio
Categorie
Link
  • Collega gli strumenti ai flussi di lavoro IA

    40ants MCP mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    56 stelle e 9 fork nel repository collegato.

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]

Usa MCP 40ants MCP con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso 40ants MCP, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi 40ants MCP come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di 40ants MCP.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "40ants-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di 40ants MCP, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di 40ants MCP.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare 40ants MCP per aiutarmi con questa attività?
40ants MCP
Certo. Ho letto.
Ecco cosa ho trovato con 40ants MCP.

Domande frequenti

A cosa serve il server MCP 40ants MCP?

40ants MCP è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare 40ants MCP MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare 40ants MCP con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP 40ants MCP con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando 40ants MCP, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego 40ants MCP MCP a TypingMind?

40ants MCP funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre 40ants MCP MCP in TypingMind?

40ants MCP mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare 40ants MCP MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se 40ants MCP richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇