mcp
An optional MCP server exposing the same tools as the
slmn CLI, for any MCP-speaking client (Claude Code/Desktop, Cursor, Codex, …). Nothing here is required to use the tools – import them directly from slmn.nbtools/slmn.misc, or drive them via the slmn CLI. This is just one more door in.
Registering the tools
The import guard makes the MCP dependency (fastmcp) genuinely optional: without the mcp extra installed, importing this module raises a clear install hint rather than a bare ImportError, and the rest of slmn keeps working. Below, the same functions the CLI dispatches are registered on a FastMCP instance – their type hints and docstrings become each tool’s MCP schema, so there’s no separate schema to maintain.
Running the server
main() is the slmn-mcp console-script entry point. It runs over stdio – the transport an MCP client (Claude Code/Desktop, Cursor, …) spawns and speaks to locally.
main
def main():Entry point for the slmn-mcp console script – runs the server over stdio, the transport MCP clients spawn locally.