AtlatestRepositorysigil-mcp
1# sigil-mcp
2
3Library for building Model Context Protocol servers in
4[Sigil](https://codeberg.org/sigil/sigil). Provides the server loop,
5JSON-RPC 2.0 framing, and channel-based message routing primitives so
6any Sigil project can expose tools and resources to MCP clients.
7
8sigil-cli ships a built-in dev-tools server on top of this library,
9invoked via `sigil mcp serve`, which exposes documentation, lint,
10format, test execution, and nREPL-backed evaluation so AI agents can
11work idiomatically against a live Sigil project.
13## Modules
15| 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 server
24```scheme
25(import (sigil mcp))
27(define server
28 (mcp-server name: "my-server" version: "1.0"))
30(mcp-server-register-tool! server
31 name: "echo"
32 description: "Echoes its input back."
33 handler: (lambda (args) ...))
35(mcp-server-run server)
36```
38For a complete example, see sigil-cli's `(sigil cli mcp)` module or
39projects like bureau, courier, folio, and minder.
41## Build and test
43```
44sigil deps install
45sigil build
46sigil test --report
47```
49Local development against an unreleased sigil monorepo:
51```
52sigil deps install --redirects ./dev-redirects.sgl
53sigil build --redirects ./dev-redirects.sgl
54```
56## License
58BSD-3-Clause. See `LICENSE` in the sigil monorepo for the canonical copy.