AtlatestRepositorysigil-mcp
1
# sigil-mcp3
Library for building Model Context Protocol servers in4
[Sigil](https://codeberg.org/sigil/sigil). Provides the server loop,5
JSON-RPC 2.0 framing, and channel-based message routing primitives so6
any Sigil project can expose tools and resources to MCP clients.8
sigil-cli ships a built-in dev-tools server on top of this library,9
invoked via `sigil mcp serve`, which exposes documentation, lint,10
format, test execution, and nREPL-backed evaluation so AI agents can11
work idiomatically against a live Sigil project.13
## Modules15
| Module | Purpose |16
|------------------------|--------------------------------------------------------|17
| `(sigil mcp)` | Top-level re-exports plus package-tool discovery |18
| `(sigil mcp server)` | Server loop, message routing, handler registration |19
| `(sigil mcp protocol)` | JSON-RPC 2.0 framing and MCP message shapes |20
| `(sigil mcp channel)` | Helpers for channel-based server transports |22
## Building your own MCP server24
```scheme25
(import (sigil mcp))27
(define server28
(mcp-server name: "my-server" version: "1.0"))30
(mcp-server-register-tool! server31
name: "echo"32
description: "Echoes its input back."33
handler: (lambda (args) ...))35
(mcp-server-run server)36
```38
For a complete example, see sigil-cli's `(sigil cli mcp)` module or39
projects like bureau, courier, folio, and minder.41
## Build and test43
```44
sigil deps install45
sigil build46
sigil test --report47
```49
Local development against an unreleased sigil monorepo:51
```52
sigil deps install --redirects ./dev-redirects.sgl53
sigil build --redirects ./dev-redirects.sgl54
```56
## License58
BSD-3-Clause. See `LICENSE` in the sigil monorepo for the canonical copy.