Zum Hauptinhalt springen
Sichere ProgrammierungElixir Enchiridium — Tomo V: O Ecossistema parte 3(03.10.2026 um 03:47 Uhr)
•
Sichere ProgrammierungElixir Enchiridium — Tomo VI: A Batalha(03.10.2026 um 03:49 Uhr)
•
Sichere ProgrammierungLarasearch: text search in Laravel for Eloquent(03.10.2026 um 03:49 Uhr)
•
Sichere ProgrammierungTuning a Churn-Prediction Random Forest with GASearchCV(03.10.2026 um 03:49 Uhr)
•
Sichere ProgrammierungTypingMind vs. 9xchat: Which AI Workspace Fits the Way You Work?(03.10.2026 um 03:49 Uhr)
•
Sichere ProgrammierungAiWatchDog, monitor your agents, increase productivity(03.10.2026 um 03:50 Uhr)
•
Sichere ProgrammierungElixir Enchiridium — Tomo VI: A Batalha parte 2(03.10.2026 um 03:50 Uhr)
••
Sichere ProgrammierungElixir Enchiridium — Tomo VI: A Batalha parte 3(03.10.2026 um 03:51 Uhr)
••
Sichere ProgrammierungElixir Enchiridium — Tomo V: O Ecossistema parte 3(03.10.2026 um 03:47 Uhr)
•
Sichere ProgrammierungElixir Enchiridium — Tomo VI: A Batalha(03.10.2026 um 03:49 Uhr)
•
Sichere ProgrammierungLarasearch: text search in Laravel for Eloquent(03.10.2026 um 03:49 Uhr)
•
Sichere ProgrammierungTuning a Churn-Prediction Random Forest with GASearchCV(03.10.2026 um 03:49 Uhr)
•
Sichere ProgrammierungTypingMind vs. 9xchat: Which AI Workspace Fits the Way You Work?(03.10.2026 um 03:49 Uhr)
•
Sichere ProgrammierungAiWatchDog, monitor your agents, increase productivity(03.10.2026 um 03:50 Uhr)
•
Sichere ProgrammierungElixir Enchiridium — Tomo VI: A Batalha parte 2(03.10.2026 um 03:50 Uhr)
••
Sichere ProgrammierungElixir Enchiridium — Tomo VI: A Batalha parte 3(03.10.2026 um 03:51 Uhr)
••
Intelligence View
⚡ tsecurity.de Intelligence

Building an MCP Server with Common Lisp

I recently wanted to learn about MCP (Model Context Protocol). As someone whose default programming language is Common Lisp, I naturally decided to build an…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

I recently wanted to learn about MCP (Model Context Protocol). As someone whose default programming language is Common Lisp, I naturally decided to build an MCP server using Lisp.



Thanks to the creators of 40ants-mcp, the library provides a nice pattern and code structure that I really like. However, I struggled significantly with installation and getting started. What should have taken minutes ended up taking days.



I'm sharing my experience here so that others who want to build MCP servers in Common Lisp can get started in minutes, not days like I did.






Prerequisites



Before you begin, make sure you have the following installed:





  • SBCL - A high-performance Common Lisp compiler


  • Roswell - A Common Lisp implementation manager and script runner


  • Quicklisp - The de facto package manager for Common Lisp


  • Ultralisp - A community-driven distribution of Common Lisp libraries






Installing Ultralisp



In SBCL with Quicklisp, you can enable Ultralisp by:




(ql-dist:install-dist "http://dist.ultralisp.org/" :prompt nil)






(How to install SBCL and Quicklisp is in the appendix.)






The Gotcha: Loading 40ants-mcp



Here's the issue that cost me days: when you try to load 40ants-mcp with:




(ql:quickload :40ants-mcp)






You might encounter errors. The solution is simple but not obvious—load jsonrpc first:




(ql:quickload :jsonrpc)
(ql:quickload :40ants-mcp)






This dependency isn't automatically resolved, which was the source of my frustration.






Creating Your MCP Server



Here's a minimal example from my mcp-exper package:




(in-package :mcp-exper)

(openrpc-server:define-api (mi-tools :title "mi-tools"))

(40ants-mcp/tools:define-tool (mi-tools add) (a b)
(:summary "just add")
(:param a integer "a")
(:param b integer "b")
(:result text-content)
(make-instance 'text-content :text (format nil "~a" (+ a b))))

(defun start-server ()
(40ants-mcp/server/definition:start-server mi-tools))






Key points:




  1. Use openrpc-server:define-api to define your API

  2. Use 40ants-mcp/tools:define-tool to define tools

  3. Return text-content instances for text results (MCP requires specific content types)






Running the Server



Create a Roswell script (mi-mcp-server.ros):




#!/bin/sh
#|-*- mode:lisp -*-|#
exec ros -Q -- $0 "$@"
|#
(progn
(ros:ensure-asdf)
#+quicklisp(ql:quickload '(:mcp-exper) :silent t))

(defun main (&rest argv)
(declare (ignorable argv))
(mcp-exper:start-server))









Quick Test



Run directly with Roswell:




ros mi-mcp-server.ros









Production Installation



Build and install as an executable:




ros build mi-mcp-server.ros
install -m 0755 mi-mcp-server $HOME/.local/bin/






Make sure $HOME/.local/bin is in your PATH.






Integrating with Opencode



To enable your MCP server in opencode, add this to ~/.config/opencode/opencode.json:




{
"mcp": {
"mi-tools": {
"type": "local",
"command": ["mi-mcp-server"],
"enabled": true
}
}
}









Conclusion



Building MCP servers with Common Lisp is straightforward once you know the tricks. The 40ants-mcp library is well-designed, and the OpenRPC integration works smoothly.



I hope this guide saves you the days of frustration I experienced. Happy hacking!






The full source code for this example is available at mcp-exper.






Appendix: Installing SBCL






macOS






brew install sbcl









Debian/Ubuntu






apt install sbcl









Arch Linux






pacman -S sbcl









Appendix: Installing Quicklisp



Download and install Quicklisp:




wget https://beta.quicklisp.org/quicklisp.lisp
sbcl --load quicklisp.lisp \
--eval '(quicklisp-quickstart:install)' \
--eval '(ql-util:without-prompting (ql:add-to-init-file))' \
--quit


🔍 CTI & Forensik

Cyber Threat Intelligence & Forensik

ATT&CK-Navigator · IoC-Radar · Exploit-Belege
CTI Threat Relationship Graph
Akteure · Techniken · Beziehungen
2 Knoten · 1 Relationen
CVE / Incident Threat Actor Software MITRE ATT&CK CWE Weakness IoC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Building an MCP Server with Common Lisp

Thematisch verwandte Begriffe: Building, Server, with, Common · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag