40ants MCP

by 40ants

Not rated
GitHub

About

A framework for building Model Context Protocol (MCP) servers in Common Lisp.

Details

Author
40ants
Categories
Developer Tools, AI, Other

Setup

Install 40ants MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/40ants/mcp

Follow the installation instructions in the repository README, then restart your MCP client.

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

- Description: The framework for buildingMCPservers and clients in Common Lisp.
- Licence: Unlicense
- Author: Alexander Artemenkosvetlyak.40wt@gmail.com
- Homepage:
https://40ants.com/mcp/
- Bug tracker:
https://github.com/40ants/mcp/issues
- Source control:
GIT
- Depends on:
alexandria,bordeaux-threads,cl-ppcre,clack,clack-sse,jsonrpc,lack,lack-request,lack-response,local-time,log4cl,log4cl-extras,openrpc-client,openrpc-server,sento,serapeum,sse-server,trivial-gray-streams,uuid,yason

A comprehensive framework for buildingModel Context Protocol (MCP)servers in Common Lisp. This library provides a complete implementation of theMCPspecification with an easy-to-useAPIfor creating servers that can interact withAIassistants like Claude Desktop.

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

- ✅STDIOTransport: Native support forSTDIO-based communication
- ✅StreamableHTTPTransport: Allowing to create remotely hostedMCPservers
- ✅Tools System: Register and execute custom tools withJSONSchema validation
- ✅Built on OpenRPC: Leverages the robust
40ants OpenRPC library
- ✅CLOS-based: Object-oriented design with proper encapsulation
- ✅Easy Integration: SimpleAPIfor adding functionality
- ✅Error Handling: Comprehensive error management with properJSON-RPCerror codes
- ✅Interactive Editing:MCPtools can be edited and updated on the fly, usingREPLdriven approach

- 🔄FullMCPSpecification Support: Complete implementation ofMCPprotocol version 2025-06-18
- 🔄Resources System: Serve dynamic and static resources viaURI
- 🔄Prompts System: Provide prompt templates with argument interpolation
- 🔄MCPClient Protocol: Implement client-side protocol for connecting toMCPservers

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)

Here's a quick example of how to create anMCPserver with custom tools:

(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)

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

#!/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 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 istext-content, but you can also return other types defined in theMCPspecification.

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

HTTPtransport implementation forMCP(Model Context Protocol) communication. This class handlesJSON-RPCmessage exchange viaHTTPPOSTrequests.

Start theMCPserver with specified transport.TRANSPORTcan be :stdio or :http.PORTis only used when transport is :http.

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

STDIOtransport implementation forMCP(Model Context Protocol) communication. This class handlesJSON-RPCmessage exchange via standard input/output streams. It is designed to work with theMCPprotocol specification forAImodel communication.

Input stream for readingJSON-RPCmessages. Defaults tostandard-input.

Output stream for writingJSON-RPCresponses. Defaults tostandard-output.

Flag indicating if transport is active and processing messages.

Input stream for readingJSON-RPCmessages. Defaults tostandard-input.

Output stream for writingJSON-RPCresponses. Defaults tostandard-output.

Flag indicating if transport is active and processing messages.

Receive aJSON-RPCmessage, returns a message orNIL.

Send aJSON-RPCmessage, returns no values.

Receive aJSON-RPCmessage, returns a message orNIL.

Send aJSON-RPCmessage, returns no values.

Starts message processing using given transport.

Stops message processing using given transport.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Bring agent evaluations, observability, and synthetic test set generation directly into your IDE for free with Galileo's new MCP server

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

MCP server for AI Diagram Maker — generate beautiful software engineering diagrams directly inside Cursor, Claude Desktop, Claude Code, or any MCP-compatible AI agent

Official MCP server for Buildable AI-powered development platform. Enables AI assistants to manage tasks, track progress, get project context, and collaborate with humans on software projects.

What Shopify did for ecommerce, Chipp does for AI agents. Build, deploy, and monetize AI agents for your business — no engineering team required.

CodeVF MCP lets AI hand off problems to real engineers instantly, so your workflows don’t stall when models hit their limits.

Make your AI agent speak every language on the planet, using Lingo.dev Localization Engine.

Client implementation for Mastra, providing seamless integration with MCP-compatible AI models and tools.

Instead of direct calling MCP tools, mcpcode server transforms MCP tool calls into TypeScript programs, enabling smarter, lower-latency orchestration by LLMs.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.