# @salmonui/mcp API reference

> 44 exported symbols of @salmonui/mcp: 7 functions, 4 classes, 22 interfaces, 3 types and 8 constants.

Canonical: https://salmonui.dev/docs/reference/mcp

```ts
import { … } from '@salmonui/mcp';
```

## Functions

### checkImports

Kind: function

Page: https://salmonui.dev/docs/reference/mcp/checkImports

```ts
function checkImports(source: string, map: ExportsMap, options?: {
    stylesheets?: boolean;
}): ImportReport;
```

Checks every `@salmonui/*` import of a module: the specifier is a public
entry, each named import is exported by it, no private `/internal/*` or
removed package is used, and the stylesheets of the used families (and
`@salmonui/core/styles.css`) are imported.

### defaultIndexPath

Kind: function

Page: https://salmonui.dev/docs/reference/mcp/defaultIndexPath

```ts
function defaultIndexPath(env?: Readonly<Record<string, string | undefined>>): string;
```

The bundled index file, or the file named by `SALMONUI_MCP_INDEX`.

### loadIndex

Kind: function

Page: https://salmonui.dev/docs/reference/mcp/loadIndex

```ts
function loadIndex(path?: string): McpIndex;
```

Reads and checks an index file. Throws with an actionable message when it is missing or of another format.

### migrateSpecifier

Kind: function

Page: https://salmonui.dev/docs/reference/mcp/migrateSpecifier

```ts
function migrateSpecifier(specifier: string, map: ExportsMap): string | null;
```

The replacement of a specifier of a removed package, or null when there is
no single one (`@salmonui/react` root: each name has its own entry).

### parseImports

Kind: function

Page: https://salmonui.dev/docs/reference/mcp/parseImports

```ts
function parseImports(source: string): ParsedImport[];
```

Every static, side-effect, re-export and dynamic import of a module source, in source order.

### serveStdio

Kind: function

Page: https://salmonui.dev/docs/reference/mcp/serveStdio

```ts
function serveStdio(server: McpServer, { input, output }: StdioStreams): Promise<void>;
```

Serves `server` on the streams until the input ends; resolves after the last response is flushed.

### tokenize

Kind: function

Page: https://salmonui.dev/docs/reference/mcp/tokenize

```ts
function tokenize(text: string): string[];
```

Lower-case word stems of a text. Identifiers also yield their camelCase and
kebab-case parts (`onValueChange` -> `onvaluechange`, `on`, `value`, `change`).

## Classes

### Bm25

Kind: class

Page: https://salmonui.dev/docs/reference/mcp/Bm25

```ts
class Bm25 {
    #private;
    constructor(documents: readonly (readonly SearchField[])[]);
    get size(): number;
    search(query: string): SearchHit[];
}
```

A BM25 index over documents made of weighted fields.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `__#3@#private` | `#private;` |  |  |
| `size` | `get size(): number;` |  |  |
| `search` | `search(query: string): SearchHit[];` |  | Documents matching any query term, best first. |

### ExportsMap

Kind: class

Page: https://salmonui.dev/docs/reference/mcp/ExportsMap

```ts
class ExportsMap {
    readonly entries: Map<string, IndexEntry>;
    readonly packages: Map<string, IndexPackage>;
    readonly families: Map<string, {
        pkg: IndexPackage;
        family: IndexFamily;
    }>;
    readonly familyOf: Map<string, {
        pkg: IndexPackage;
        family: IndexFamily;
    }>;
    readonly whereExported: Map<string, string[]>;
    constructor(index: McpIndex);
    static packageName(specifier: string): string;
    exportersOf(name: string): string[];
    closest(specifier: string, max?: number): string[];
}
```

Lookups over the index used by the checker and the tools.

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `entries` | `readonly entries: Map<string, IndexEntry>;` |  |  |
| `packages` | `readonly packages: Map<string, IndexPackage>;` |  |  |
| `families` | `readonly families: Map<string, {     pkg: IndexPackage;     family: IndexFamily; }>;` |  |  |
| `familyOf` | `readonly familyOf: Map<string, {     pkg: IndexPackage;     family: IndexFamily; }>;` |  | Family of every family entry and subpath. |
| `whereExported` | `readonly whereExported: Map<string, string[]>;` |  |  |
| `exportersOf` | `exportersOf(name: string): string[];` |  | Entries exporting `name`, home entries (shortest specifier) first. |
| `closest` | `closest(specifier: string, max?: number): string[];` |  | Closest existing specifiers by edit distance (at most `max`). |

### McpServer

Kind: class

Page: https://salmonui.dev/docs/reference/mcp/McpServer

```ts
class McpServer {
    #private;
    readonly name: string;
    readonly version: string;
    legacyVersion: string | undefined;
    constructor(options: ServerOptions);
    get tools(): SalmonTools;
    get serverInfo(): Record<string, string>;
    handleLine(line: string): string | undefined;
    handle(message: unknown): JsonRpcResponse | JsonRpcResponse[] | undefined;
    handleOne(message: unknown): JsonRpcResponse | undefined;
    dispatch(method: string, params: Record<string, unknown>): Record<string, unknown>;
    initialize(params: Record<string, unknown>): Record<string, unknown>;
    legacy(method: string, params: Record<string, unknown>): Record<string, unknown>;
    modern(method: string, params: Record<string, unknown>, meta: Record<string, unknown>): Record<string, unknown>;
    callTool(params: Record<string, unknown>): ToolResult;
}
```

A Salmon UI MCP server bound to one index.

Members (14):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `__#2@#private` | `#private;` |  |  |
| `name` | `readonly name: string;` |  |  |
| `version` | `readonly version: string;` |  |  |
| `legacyVersion` | `legacyVersion: string \| undefined;` |  | Version negotiated by a legacy `initialize` on this process. |
| `tools` | `get tools(): SalmonTools;` |  |  |
| `serverInfo` | `get serverInfo(): Record<string, string>;` |  |  |
| `handleLine` | `handleLine(line: string): string \| undefined;` |  | Handles one line of the stdio transport; returns the line to write (no trailing newline), if any. |
| `handle` | `handle(message: unknown): JsonRpcResponse \| JsonRpcResponse[] \| undefined;` |  | Handles a parsed message or batch. Returns undefined when nothing must be sent (notifications, client responses). |
| `handleOne` | `handleOne(message: unknown): JsonRpcResponse \| undefined;` |  |  |
| `dispatch` | `dispatch(method: string, params: Record<string, unknown>): Record<string, unknown>;` |  |  |
| `initialize` | `initialize(params: Record<string, unknown>): Record<string, unknown>;` |  |  |
| `legacy` | `legacy(method: string, params: Record<string, unknown>): Record<string, unknown>;` |  |  |
| `modern` | `modern(method: string, params: Record<string, unknown>, meta: Record<string, unknown>): Record<string, unknown>;` |  |  |
| `callTool` | `callTool(params: Record<string, unknown>): ToolResult;` |  |  |

### SalmonTools

Kind: class

Page: https://salmonui.dev/docs/reference/mcp/SalmonTools

```ts
class SalmonTools {
    #private;
    readonly index: McpIndex;
    readonly map: ExportsMap;
    constructor(index: McpIndex);
    call(name: string, args: Readonly<Record<string, unknown>>): ToolResult;
    url(path: string): string;
    get symbolsByName(): Map<string, IndexSymbol[]>;
    listComponents(filter?: string): ToolResult;
    get docsSearch(): {
        bm25: Bm25;
        refs: {
            doc: IndexDoc;
            section: number;
        }[];
    };
    rankDocs(query: string): {
        doc: IndexDoc;
        score: number;
        sections: {
            index: number;
            score: number;
        }[];
    }[];
    searchDocs(query: string, limit: number): ToolResult;
    docsMentioning(name: string, max?: number): IndexDoc[];
    referenceUrl(specifier: string): string;
    stylesheetLines(specifier: string): string[];
    getComponent(rawName: string): ToolResult;
    suggestNames(name: string, max?: number): string[];
    describeFamily(pkg: IndexPackage, family: IndexFamily): string;
    describeSymbol(symbol: IndexSymbol, { header }?: {
        header?: string;
    }): string;
    propsOf(symbol: IndexSymbol): {
        members: IndexMember[];
        from: string;
        alias?: string;
    } | undefined;
    get demoSearch(): Bm25;
    getExample(id?: string, query?: string): ToolResult;
    checkImports(source: string, stylesheets?: boolean): ToolResult;
}
```

The tools bound to one index; lookup structures are built lazily, once.

Members (21):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `__#1@#private` | `#private;` |  |  |
| `index` | `readonly index: McpIndex;` |  |  |
| `map` | `readonly map: ExportsMap;` |  |  |
| `call` | `call(name: string, args: Readonly<Record<string, unknown>>): ToolResult;` |  |  |
| `url` | `url(path: string): string;` |  |  |
| `symbolsByName` | `get symbolsByName(): Map<string, IndexSymbol[]>;` |  |  |
| `listComponents` | `listComponents(filter?: string): ToolResult;` |  |  |
| `docsSearch` | `get docsSearch(): {     bm25: Bm25;     refs: {         doc: IndexDoc;         section: number;     }[]; };` |  |  |
| `rankDocs` | `rankDocs(query: string): {     doc: IndexDoc;     score: number;     sections: {         index: number;         score: number;     }[]; }[];` |  | Pages for a query: per page, the best section scores, best first. |
| `searchDocs` | `searchDocs(query: string, limit: number): ToolResult;` |  |  |
| `docsMentioning` | `docsMentioning(name: string, max?: number): IndexDoc[];` |  | Docs pages that name a symbol in code, most mentions first. |
| `referenceUrl` | `referenceUrl(specifier: string): string;` |  |  |
| `stylesheetLines` | `stylesheetLines(specifier: string): string[];` |  |  |
| `getComponent` | `getComponent(rawName: string): ToolResult;` |  |  |
| `suggestNames` | `suggestNames(name: string, max?: number): string[];` |  |  |
| `describeFamily` | `describeFamily(pkg: IndexPackage, family: IndexFamily): string;` |  |  |
| `describeSymbol` | `describeSymbol(symbol: IndexSymbol, { header }?: {     header?: string; }): string;` |  |  |
| `propsOf` | `propsOf(symbol: IndexSymbol): {     members: IndexMember[];     from: string;     alias?: string; } \| undefined;` |  | The props of a component (its `props` parameter type, else `<Name>Props`), or the members of a type alias. An alias without members of its own (`type ButtonProps = ButtonBaseProps & (...)`, a union of variants) gets the members of the object types it names, merged by name. |
| `demoSearch` | `get demoSearch(): Bm25;` |  |  |
| `getExample` | `getExample(id?: string, query?: string): ToolResult;` |  |  |
| `checkImports` | `checkImports(source: string, stylesheets?: boolean): ToolResult;` |  |  |

## Interfaces

### ImportProblem

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/ImportProblem

```ts
interface ImportProblem {
    readonly severity: 'error' | 'warning';
    readonly line: number | null;
    readonly specifier: string | null;
    readonly message: string;
    readonly fix?: string;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `severity` | `readonly severity: 'error' \| 'warning';` |  |  |
| `line` | `readonly line: number \| null;` |  |  |
| `specifier` | `readonly specifier: string \| null;` |  |  |
| `message` | `readonly message: string;` |  |  |
| `fix` | `readonly fix?: string;` | optional | Suggested replacement code or specifier. |

### ImportReport

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/ImportReport

```ts
interface ImportReport {
    readonly imports: readonly ParsedImport[];
    readonly checked: number;
    readonly problems: readonly ImportProblem[];
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `imports` | `readonly imports: readonly ParsedImport[];` |  |  |
| `checked` | `readonly checked: number;` |  | `@salmonui/*` imports checked. |
| `problems` | `readonly problems: readonly ImportProblem[];` |  |  |

### ImportedName

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/ImportedName

```ts
interface ImportedName {
    readonly imported: string;
    readonly local: string;
    readonly typeOnly: boolean;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `imported` | `readonly imported: string;` |  | Exported name (`default` for a default import). |
| `local` | `readonly local: string;` |  |  |
| `typeOnly` | `readonly typeOnly: boolean;` |  |  |

### IndexDemo

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/IndexDemo

```ts
interface IndexDemo {
    readonly id: string;
    readonly title: string;
    readonly description: string;
    readonly category: string;
    readonly path: string;
    readonly notes: string;
    readonly imports: readonly string[];
    readonly source: string;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  |  |
| `title` | `readonly title: string;` |  |  |
| `description` | `readonly description: string;` |  |  |
| `category` | `readonly category: string;` |  |  |
| `path` | `readonly path: string;` |  | Site path (`/demos/buttons/button-basics`). |
| `notes` | `readonly notes: string;` |  |  |
| `imports` | `readonly imports: readonly string[];` |  | `@salmonui/*` specifiers the demo imports. |
| `source` | `readonly source: string;` |  |  |

### IndexDoc

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/IndexDoc

```ts
interface IndexDoc {
    readonly title: string;
    readonly description: string;
    readonly path: string;
    readonly section: string;
    readonly sections: readonly IndexSection[];
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `title` | `readonly title: string;` |  |  |
| `description` | `readonly description: string;` |  |  |
| `path` | `readonly path: string;` |  | Site path (`/docs/buttons/button`). |
| `section` | `readonly section: string;` |  |  |
| `sections` | `readonly sections: readonly IndexSection[];` |  |  |

### IndexEntry

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/IndexEntry

```ts
interface IndexEntry {
    readonly specifier: string;
    readonly package: string;
    readonly kind: 'js' | 'css';
    readonly family?: string;
    readonly names?: readonly string[];
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `specifier` | `readonly specifier: string;` |  |  |
| `package` | `readonly package: string;` |  |  |
| `kind` | `readonly kind: 'js' \| 'css';` |  |  |
| `family` | `readonly family?: string;` | optional | Family slug the entry belongs to. |
| `names` | `readonly names?: readonly string[];` | optional | Exported names (JS entries). |

### IndexFamily

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/IndexFamily

```ts
interface IndexFamily {
    readonly name: string;
    readonly specifier: string;
    readonly subpaths: readonly string[];
    readonly stylesheet: string | null;
    readonly summary: string;
    readonly components: readonly string[];
    readonly hooks: readonly string[];
    readonly docs: readonly string[];
    readonly alsoImport?: readonly {
        readonly stylesheet: string;
        readonly when: string | null;
    }[];
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `readonly name: string;` |  | Family slug (`button`, `date-picker`). |
| `specifier` | `readonly specifier: string;` |  | Public import specifier (`@salmonui/buttons/button`). |
| `subpaths` | `readonly subpaths: readonly string[];` |  | Further public entries of the family (`@salmonui/charts/chart/features`). |
| `stylesheet` | `readonly stylesheet: string \| null;` |  | The family stylesheet specifier, or null when the family has no own CSS. |
| `summary` | `readonly summary: string;` |  | One sentence. |
| `components` | `readonly components: readonly string[];` |  | Component names exported by the family entry. |
| `hooks` | `readonly hooks: readonly string[];` |  | Hook names (`use*`) exported by the family entry. |
| `docs` | `readonly docs: readonly string[];` |  | Docs page paths that import the family. |
| `alsoImport` | `readonly alsoImport?: readonly {     readonly stylesheet: string;     readonly when: string \| null; }[];` | optional | Stylesheets of other families to import with this one because its stylesheet does not carry them; `when` is null when always needed. Every other family it renders is carried by its own stylesheet. |

### IndexMember

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/IndexMember

```ts
interface IndexMember {
    readonly name: string;
    readonly type: string;
    readonly optional: boolean;
    readonly summary: string;
    readonly default?: string;
    readonly deprecated?: string;
    readonly inherited?: boolean;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `readonly name: string;` |  |  |
| `type` | `readonly type: string;` |  |  |
| `optional` | `readonly optional: boolean;` |  |  |
| `summary` | `readonly summary: string;` |  |  |
| `default` | `readonly default?: string;` | optional |  |
| `deprecated` | `readonly deprecated?: string;` | optional |  |
| `inherited` | `readonly inherited?: boolean;` | optional |  |

### IndexPackage

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/IndexPackage

```ts
interface IndexPackage {
    readonly name: string;
    readonly description: string;
    readonly react: 'required' | 'optional' | 'none';
    readonly deps: readonly string[];
    readonly optionalPeers: readonly string[];
    readonly stylesheet: string | null;
    readonly families: readonly IndexFamily[];
    readonly entries: readonly string[];
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `readonly name: string;` |  |  |
| `description` | `readonly description: string;` |  |  |
| `react` | `readonly react: 'required' \| 'optional' \| 'none';` |  |  |
| `deps` | `readonly deps: readonly string[];` |  |  |
| `optionalPeers` | `readonly optionalPeers: readonly string[];` |  |  |
| `stylesheet` | `readonly stylesheet: string \| null;` |  | Package-wide stylesheet aggregate (`@salmonui/buttons/styles.css`), when there is one. |
| `families` | `readonly families: readonly IndexFamily[];` |  |  |
| `entries` | `readonly entries: readonly string[];` |  | Public JS entries that are not a family (`@salmonui/core/theme`, `@salmonui/data-grid/engine/sort`). |

### IndexParam

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/IndexParam

```ts
interface IndexParam {
    readonly name: string;
    readonly text: string;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `readonly name: string;` |  |  |
| `text` | `readonly text: string;` |  |  |

### IndexSection

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/IndexSection

```ts
interface IndexSection {
    readonly heading: string;
    readonly anchor: string;
    readonly text: string;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `heading` | `readonly heading: string;` |  |  |
| `anchor` | `readonly anchor: string;` |  | Heading anchor on the page (empty for the intro). |
| `text` | `readonly text: string;` |  |  |

### IndexSymbol

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/IndexSymbol

```ts
interface IndexSymbol {
    readonly name: string;
    readonly kind: SymbolKind;
    readonly specifiers: readonly string[];
    readonly summary: string;
    readonly docs?: string;
    readonly signature: string;
    readonly deprecated?: string;
    readonly params?: readonly IndexParam[];
    readonly returns?: string;
    readonly members?: readonly IndexMember[];
}
```

Members (10):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `readonly name: string;` |  |  |
| `kind` | `readonly kind: SymbolKind;` |  |  |
| `specifiers` | `readonly specifiers: readonly string[];` |  | Entries exporting the symbol; the first is its home. |
| `summary` | `readonly summary: string;` |  |  |
| `docs` | `readonly docs?: string;` | optional |  |
| `signature` | `readonly signature: string;` |  |  |
| `deprecated` | `readonly deprecated?: string;` | optional |  |
| `params` | `readonly params?: readonly IndexParam[];` | optional |  |
| `returns` | `readonly returns?: string;` | optional |  |
| `members` | `readonly members?: readonly IndexMember[];` | optional |  |

### JsonRpcError

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/JsonRpcError

```ts
interface JsonRpcError {
    readonly jsonrpc: '2.0';
    readonly id: JsonRpcId | null;
    readonly error: {
        readonly code: number;
        readonly message: string;
        readonly data?: unknown;
    };
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `jsonrpc` | `readonly jsonrpc: '2.0';` |  |  |
| `id` | `readonly id: JsonRpcId \| null;` |  |  |
| `error` | `readonly error: {     readonly code: number;     readonly message: string;     readonly data?: unknown; };` |  |  |

### JsonRpcResult

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/JsonRpcResult

```ts
interface JsonRpcResult {
    readonly jsonrpc: '2.0';
    readonly id: JsonRpcId;
    readonly result: Readonly<Record<string, unknown>>;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `jsonrpc` | `readonly jsonrpc: '2.0';` |  |  |
| `id` | `readonly id: JsonRpcId;` |  |  |
| `result` | `readonly result: Readonly<Record<string, unknown>>;` |  |  |

### McpIndex

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/McpIndex

```ts
interface McpIndex {
    readonly format: typeof INDEX_FORMAT;
    readonly version: string;
    readonly generatedFrom: string;
    readonly siteUrl: string;
    readonly packages: readonly IndexPackage[];
    readonly entries: readonly IndexEntry[];
    readonly symbols: readonly IndexSymbol[];
    readonly docs: readonly IndexDoc[];
    readonly demos: readonly IndexDemo[];
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `format` | `readonly format: typeof INDEX_FORMAT;` |  |  |
| `version` | `readonly version: string;` |  | Version of the Salmon UI packages the index was built from. |
| `generatedFrom` | `readonly generatedFrom: string;` |  | Git SHA of the build, or `unknown`. |
| `siteUrl` | `readonly siteUrl: string;` |  | Public docs site, no trailing slash. |
| `packages` | `readonly packages: readonly IndexPackage[];` |  |  |
| `entries` | `readonly entries: readonly IndexEntry[];` |  |  |
| `symbols` | `readonly symbols: readonly IndexSymbol[];` |  |  |
| `docs` | `readonly docs: readonly IndexDoc[];` |  |  |
| `demos` | `readonly demos: readonly IndexDemo[];` |  |  |

### ParsedImport

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/ParsedImport

```ts
interface ParsedImport {
    readonly specifier: string;
    readonly line: number;
    readonly form: 'import' | 'side-effect' | 'export-from' | 'dynamic';
    readonly typeOnly: boolean;
    readonly names: readonly ImportedName[];
    readonly namespace: boolean;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `specifier` | `readonly specifier: string;` |  |  |
| `line` | `readonly line: number;` |  |  |
| `form` | `readonly form: 'import' \| 'side-effect' \| 'export-from' \| 'dynamic';` |  |  |
| `typeOnly` | `readonly typeOnly: boolean;` |  | The whole statement is `import type` / `export type`. |
| `names` | `readonly names: readonly ImportedName[];` |  |  |
| `namespace` | `readonly namespace: boolean;` |  | `import * as ns` / `export * from`. |

### ServerOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/ServerOptions

```ts
interface ServerOptions {
    readonly index: McpIndex | (() => McpIndex);
    readonly name?: string;
    readonly version?: string;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `index` | `readonly index: McpIndex \| (() => McpIndex);` |  | The index, or a function that loads it on first use. |
| `name` | `readonly name?: string;` | optional |  |
| `version` | `readonly version?: string;` | optional |  |

### StdioInput

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/StdioInput

```ts
interface StdioInput {
    setEncoding(encoding: 'utf8'): unknown;
    on(event: 'data', listener: (chunk: string) => void): unknown;
    on(event: 'end', listener: () => void): unknown;
    on(event: 'error', listener: (error: unknown) => void): unknown;
}
```

The parts of a Node readable stream the transport uses (`process.stdin`).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `setEncoding` | `setEncoding(encoding: 'utf8'): unknown;` |  |  |
| `on` | `on(event: 'data', listener: (chunk: string) => void): unknown; on(event: 'end', listener: () => void): unknown; on(event: 'error', listener: (error: unknown) => void): unknown;` |  |  |

### StdioOutput

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/StdioOutput

```ts
interface StdioOutput {
    write(chunk: string, callback?: () => void): unknown;
}
```

The parts of a Node writable stream the transport uses (`process.stdout`).

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `write` | `write(chunk: string, callback?: () => void): unknown;` |  |  |

### StdioStreams

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/StdioStreams

```ts
interface StdioStreams {
    readonly input: StdioInput;
    readonly output: StdioOutput;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `input` | `readonly input: StdioInput;` |  |  |
| `output` | `readonly output: StdioOutput;` |  |  |

### ToolDefinition

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/ToolDefinition

```ts
interface ToolDefinition {
    readonly name: string;
    readonly title: string;
    readonly description: string;
    readonly inputSchema: Readonly<Record<string, unknown>>;
    readonly annotations: Readonly<Record<string, unknown>>;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `readonly name: string;` |  |  |
| `title` | `readonly title: string;` |  |  |
| `description` | `readonly description: string;` |  |  |
| `inputSchema` | `readonly inputSchema: Readonly<Record<string, unknown>>;` |  |  |
| `annotations` | `readonly annotations: Readonly<Record<string, unknown>>;` |  |  |

### ToolResult

Kind: interface

Page: https://salmonui.dev/docs/reference/mcp/ToolResult

```ts
interface ToolResult {
    readonly content: readonly {
        readonly type: 'text';
        readonly text: string;
    }[];
    readonly isError?: boolean;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `content` | `readonly content: readonly {     readonly type: 'text';     readonly text: string; }[];` |  |  |
| `isError` | `readonly isError?: boolean;` | optional |  |

## Types

### JsonRpcId

Kind: type

Page: https://salmonui.dev/docs/reference/mcp/JsonRpcId

```ts
type JsonRpcId = string | number;
```

### JsonRpcResponse

Kind: type

Page: https://salmonui.dev/docs/reference/mcp/JsonRpcResponse

```ts
type JsonRpcResponse = JsonRpcError | JsonRpcResult;
```

### SymbolKind

Kind: type

Page: https://salmonui.dev/docs/reference/mcp/SymbolKind

```ts
type SymbolKind = 'component' | 'function' | 'class' | 'interface' | 'type' | 'const' | 'enum' | 'namespace';
```

## Constants

### ErrorCode

Kind: const

Page: https://salmonui.dev/docs/reference/mcp/ErrorCode

```ts
const ErrorCode: Readonly<{
    ParseError: -32700;
    InvalidRequest: -32600;
    MethodNotFound: -32601;
    InvalidParams: -32602;
    InternalError: -32603;
    UnsupportedProtocolVersion: -32022;
}>;
```

JSON-RPC 2.0 and MCP error codes.

### INDEX_FORMAT

Kind: const

Page: https://salmonui.dev/docs/reference/mcp/INDEX_FORMAT

```ts
const INDEX_FORMAT = 1;
```

### INSTRUCTIONS

Kind: const

Page: https://salmonui.dev/docs/reference/mcp/INSTRUCTIONS

```ts
const INSTRUCTIONS: string;
```

### LEGACY_VERSIONS

Kind: const

Page: https://salmonui.dev/docs/reference/mcp/LEGACY_VERSIONS

```ts
const LEGACY_VERSIONS: readonly string[];
```

Handshake-era versions, newest first.

### MODERN_VERSIONS

Kind: const

Page: https://salmonui.dev/docs/reference/mcp/MODERN_VERSIONS

```ts
const MODERN_VERSIONS: readonly string[];
```

### REMOVED_PACKAGES

Kind: const

Page: https://salmonui.dev/docs/reference/mcp/REMOVED_PACKAGES

```ts
const REMOVED_PACKAGES: Readonly<Record<string, string>>;
```

Packages that existed before the per-category split, with what replaced them.

### SUPPORTED_VERSIONS

Kind: const

Page: https://salmonui.dev/docs/reference/mcp/SUPPORTED_VERSIONS

```ts
const SUPPORTED_VERSIONS: readonly string[];
```

### TOOLS

Kind: const

Page: https://salmonui.dev/docs/reference/mcp/TOOLS

```ts
const TOOLS: readonly ToolDefinition[];
```
