sigil-mcp
Library for building Model Context Protocol clients and servers in Sigil. Provides the server loop, JSON-RPC 2.0 framing, and channel-based message routing primitives so any Sigil project can expose tools and resources to MCP clients.
sigil-cli ships a built-in dev-tools server on top of this library, invoked via sigil mcp serve, which exposes documentation, lint, format, test execution, and nREPL-backed evaluation so AI agents can work idiomatically against a live Sigil project.
Modules
| Module | Purpose |
|---|---|
(sigil mcp) | Top-level re-exports plus package-tool discovery |
(sigil mcp server) | Server loop, message routing, handler registration |
(sigil mcp client) | Client lifecycle, correlation, cancellation, events |
(sigil mcp protocol) | JSON-RPC 2.0 framing and MCP message shapes |
(sigil mcp channel) | Helpers for channel-based server transports |
Building your own MCP server
(import (sigil mcp))
(define server
(mcp-server name: "my-server" version: "1.0"))
(mcp-server-register-tool! server
name: "echo"
description: "Echoes its input back."
handler: (lambda (args) ...))
(mcp-server-run server)For a complete example, see sigil-cli's (sigil cli mcp) module or projects like bureau, courier, folio, and minder.
Build and test
sigil deps install sigil build sigil test --report
The sigil executable bundles the released MCP modules. When testing local changes to a module that is also built in, add -L src before the command so the checkout takes precedence:
sigil -L src test test/test-protocol.sgl test/test-client.sgl --report
Run unchanged server integration suites through the normal package test path; the current toolchain's source-path override does not expose every private server binding used by those tests:
sigil test test/test-server.sgl test/test-nrepl-tools.sgl test/test-channel.sgl --report
Local development against an unreleased sigil monorepo:
sigil deps install --redirects ./dev-redirects.sgl sigil build --redirects ./dev-redirects.sgl
License
BSD-3-Clause. See LICENSE in the sigil monorepo for the canonical copy.