# @leumas/mcp-kit

Turn any Leumas adapter/tool into an MCP server — the contract helpers + adapter→server compiler.


Turn any Leumas adapter/tool into an **MCP server** any coding agent can call. The SDK half of MCP
generation — the runtime that loads + serves these lives in `shared/engines/mcp`.

**Absorbs (DRY-consolidated from):** `opensource/mcp-server-library/sdk/*`.

## Usage

```js
import { defineServer, defineTool, adapterToServer } from '@leumas/mcp-kit';

// hand-authored:
const math = defineServer({ name: 'math', tools: [
  defineTool({ name: 'add', inputs: [{ key: 'a', type: 'number' }, { key: 'b', type: 'number' }], run: ({ a, b }) => a + b }),
]});

// or compile an existing adapter system:
const physics = adapterToServer(physicsAdapter);   // every adapter fn becomes an MCP tool
```

`server.manifest()` is what the engine's `GET /mcp` returns; `server.call(tool, args)` runs one.


---
Source: shared/packages/mcp-kit/README.md
Canonical: https://docs.leumas.tech/p/packages/mcp-kit
