> ## Documentation Index
> Fetch the complete documentation index at: https://docs.toolshed.philo.ventures/llms.txt
> Use this file to discover all available pages before exploring further.

# @toolshed/mcp-host

> MCP server creation and hosting.

The mcp-host package provides a single function that creates an MCP server with Toolshed's four tools.

## createMcpServer(deps)

```typescript theme={null}
import { createMcpServer } from "@toolshed/mcp-host";

const server = createMcpServer({
  runtime,
  allTools,
  searchTools,
  elicitation,    // optional
  resumeRemote,   // optional
});
```

### McpServerDeps

| Field          | Type                                                 | Required | Description                         |
| -------------- | ---------------------------------------------------- | -------- | ----------------------------------- |
| `runtime`      | `Runtime`                                            | Yes      | Execution runtime (local or Vercel) |
| `allTools`     | `ToolDefinition[]`                                   | Yes      | Full tool catalog                   |
| `searchTools`  | `(query, limit) => ToolDefinition[]`                 | Yes      | Search function                     |
| `elicitation`  | `ElicitationEngine`                                  | No       | Local elicitation engine            |
| `resumeRemote` | `(executionId, approved, data?) => Promise<unknown>` | No       | Remote resume callback              |

### Created tools

The returned `McpServer` exposes four tools:

| Tool           | Description                   | See                                |
| -------------- | ----------------------------- | ---------------------------------- |
| `run`          | Execute TypeScript in sandbox | [run](/mcp/run)                    |
| `search_tools` | Fuzzy search tool catalog     | [search\_tools](/mcp/search-tools) |
| `read_tool`    | Get tool definition by path   | [read\_tool](/mcp/read-tool)       |
| `resume`       | Resolve pending elicitation   | [resume](/mcp/resume)              |

### Usage with stdio transport

```typescript theme={null}
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

const transport = new StdioServerTransport();
await server.connect(transport);
```

Uses the `McpServer` class from `@modelcontextprotocol/sdk`.
