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

# From MCP

> Install an MCP server's tools as one CLI, with Python or TypeScript.

An MCP server's tools become one CLI: each tool is a subcommand that takes the
tool's arguments as one JSON object.

```yaml workspace.yaml theme={null}
mounts:
  /:
    vfs: ram
clis:
  issues:
    cli: mcp
    machine: in_process
    config:
      url: https://mcp.example.com/mcp
      auth:
        type: bearer
        token:
          from: env
          key: ISSUES_TOKEN
```

`mirage workspace create workspace.yaml` builds it on the server. In code,
read the server's tools and register them on an existing `ws`:

> [tab] Python
>
> ```python theme={null}
> import os
>
> from mirage import mcp_cli
>
> config = {
>     "url": "https://mcp.example.com/mcp",
>     "auth": {"type": "bearer", "token": os.environ["ISSUES_TOKEN"]},
> }
> ws.register_cli("issues", await mcp_cli(config), config)
> ```

> [tab] TypeScript
>
> ```typescript theme={null}
> import { mcpCli } from '@struktoai/mirage-node'
>
> const config = {
>   url: 'https://mcp.example.com/mcp',
>   auth: { type: 'bearer', token: process.env.ISSUES_TOKEN! },
> }
> ws.registerCli('issues', await mcpCli(config), config)
> ```

A tool named `search_issues` becomes the subcommand `search-issues`:

```bash theme={null}
issues --help
issues search-issues --help
issues search-issues '{"query": "login bug"}'
```

## SDK guides

> [card] [Python](https://docs.mirage.strukto.ai/python/cli/mcp.md)
>
> Server options and how tools become commands.

> [card] [TypeScript](https://docs.mirage.strukto.ai/typescript/cli/mcp.md)
>
> Server options and how tools become commands.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.