---
title: "mcp"
description: "The mcp namespace — the engine's Luau API reference for mcp."
section: "API Reference"
slug: "api-mcp"
canonical: "https://origozero.ai/docs/api-mcp"
updated: "2026-08-22T18:22:38.134116019+00:00"
tags: ["api", "reference"]
---

# mcp

The `mcp` namespace — 3 functions.

## mcp/call {#mcp-call}

```lua
mcp.call(toolName, args?)
```

Call an MCP tool asynchronously. Returns a request ID to poll for the result. Use with task.await or manual polling via mcp.poll().

**Parameters**

- `toolName` `string` — Name of the MCP tool to call
- `args` `table | string` _(optional)_ — Arguments for the tool. Table is converted to JSON, string is passed as-is

**Returns** `string` — Request ID for polling with mcp.poll()

## mcp/listTools {#mcp-listtools}

```lua
mcp.listTools()
```

List all available MCP tool names.

**Returns** `{string}` — Array of tool name strings

## mcp/poll {#mcp-poll}

```lua
mcp.poll(requestId)
```

Poll for a completed MCP tool call result. Returns nil if not yet complete.

**Parameters**

- `requestId` `string` — Request ID from mcp.call()

**Returns** `{ id: string, is_error: boolean, content: string } | nil` — Result table with tool output, or nil if still pending
