Iteration Layer

OpenCode

OpenCode supports local and remote MCP servers in its configuration. Add Iteration Layer as a remote MCP server to give OpenCode agents document, image, sheet, and generation tools from the same endpoint.

Requirements

  • OpenCode with MCP support
  • An Iteration Layer account
  • Browser access for OAuth authorization

MCP Server Endpoint

https://api.iterationlayer.com/mcp

Add Iteration Layer To OpenCode

Add a remote MCP server under mcp in your OpenCode config:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "iterationlayer": {
      "type": "remote",
      "url": "https://api.iterationlayer.com/mcp",
      "enabled": true,
      "timeout": 180000
    }
  }
}

For OAuth-enabled MCP servers, OpenCode can start OAuth from the remote server configuration. Iteration Layer MCP uses OAuth 2.1, not API keys.

Verify The Connection

List MCP servers and tools:

opencode mcp list

Then ask OpenCode:

Which Iteration Layer MCP tools can you use?

You should see tools such as extract_document, convert_document_to_markdown, transform_image, generate_document, and generate_sheet.

Per-Agent Tool Access

OpenCode can enable or disable tools globally or per agent. Use this when one agent should process documents and another should not have external tool access.

For example, expose Iteration Layer tools only to a specific agent in your OpenCode config:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "iterationlayer": {
      "type": "remote",
      "url": "https://api.iterationlayer.com/mcp",
      "enabled": true,
      "timeout": 180000
    }
  },
  "tools": {
    "iterationlayer*": false
  },
  "agent": {
    "document-workflow": {
      "tools": {
        "iterationlayer*": true
      }
    }
  }
}

First Workflow

Try this in an OpenCode session:

Use Iteration Layer to convert this PDF to markdown, extract the key fields for the workflow, and generate a Markdown implementation plan for moving this into production code.

OpenCode can use MCP for file-processing exploration while keeping production logic in your codebase through REST or an SDK.

Troubleshooting

Server appears disabled

Confirm enabled is true and that no global tools rule disables the server for the active agent.

OAuth does not start

Use a remote MCP config with type: "remote" and the exact URL https://api.iterationlayer.com/mcp. Do not set oauth to false for Iteration Layer.

Tool discovery times out

Increase timeout. Document and generation tools may need more than the default timeout during discovery or first use.