Skip to content
AI

Operating 3forge Enterprise over MCP

This is the page an AI agent reads before driving a running 3forge Enterprise instance over MCP. It establishes which MCP surface exposes which tools, and states once the transport rules that the charting, Historical Database, and REST pages each rely on: how a read behaves, how a callback argument must be shaped, how a multi-statement write behaves, how far a syntax check can be trusted, and which tools a caller is granted.

The surfaces

Three distinct things are all sometimes called "MCP" in this documentation set. They are not interchangeable, and only one of them exposes the web_* / center_* / relay_* tool names used in the charting and Historical Database pages.

Surface What it is Exposes
MCP server (MCP Server) A REST plugin (MCP) built into AmiCore, served at /3forge_rest/mcp on the Web component's port by default The full console tool catalog: center_execute, web_console, web_create_chart, web_add_chart_layer, web_execute, web_debug, web_verify, web_danger, relay_addFeedhandler, and cross-component tools such as log_search and aidoc_get_documentation. This is the surface every tool name in the charting and Historical Database pages refers to.
/3forge_rest/mcp (REST API) The same endpoint, described from the REST server's side as one row in its endpoint table Nothing beyond what the MCP server row above already describes; rest_api.md documents the REST server's other endpoints (/3forge_rest/query, /version, /whoami, /stats, /admin), which are a separate, synchronous transport, not MCP tools
MCP plugin for coding tools (3forge MCP Plugin) A client-side plugin (3forge-mcp) installed into Claude Code, Codex, or Copilot Nothing of its own. It bundles skills, agents, and commands, and connects to the MCP server above as its 3forge-runtime MCP connection. It is a packaged client, not a fourth surface.

That leaves two runtime surfaces: the MCP server (tool calls, used by the charting and Historical Database pages) and the REST query endpoint (/3forge_rest/query). The MCP plugin is a way of reaching the first from a coding tool, not a separate surface.

Shared transport rules

These rules hold for every tool call against the MCP server (/3forge_rest/mcp). Each feature page states the one sentence relevant to it and links here for the rest.

A tool must be granted to the caller

Applies to: the MCP server. An authenticated caller lists and calls only the tools its MCP_TOOLS grant names, and the shipped default grants none. A tool missing from tools/list has not been granted to the caller, which is different from the tool not existing, and a call to it returns an error that starts with Not permitted:. See Granting Tools to Callers.

A read returns rows

Applies to: the MCP server. A SELECT, an aggregate, a join, or count(*) sent as Center SQL returns its rows, historical tables included. Two tools run Center SQL:

Tool Runs Rows returned
center_console(op="sql") Read-only statements (SELECT, SHOW, DESCRIBE, DIAGNOSE); rejects a statement that changes state Up to ami.mcp.query.rows.max (default 10000); a LIMIT in the statement overrides it
center_execute Any statements, reads and writes All rows, with no cap

Both wait up to ami.mcp.query.timeout.ms (default 60000, one minute) for the result. Prefer center_console(op="sql") for reads, so a mistyped statement cannot change data.

The REST query endpoint is disabled by default

The shipped ami.rest.plugin.classes is *,!QUERY,!ADMIN, which excludes /3forge_rest/query while leaving the MCP plugin enabled (MCP is matched by * and not excluded). An agent does not need the REST query endpoint to read rows over MCP. Add QUERY to ami.rest.plugin.classes only for clients that call REST directly. See Configuration.

A callback argument must be a single string

Applies to: the MCP server, wherever a tool takes an amiscript callback body (for example importing a datamodel with web_execute(op="importDatamodel"), or a chart's onProcess). The value must be one string with embedded \n, not an array of lines. An array is comma-joined by the transport and fails validation:

Callback 'onProcess': Error ... Unexpected char: ,

See Building Charts over MCP for the sequence a chart follows.

Several statements can go in one call

Applies to: the MCP server, for Center SQL sent through center_execute. Statements separated by semicolons run in order, and every write in the batch is applied: three INSERT statements sent in one call commit all three rows, on a realtime table and on a historical table alike. A single INSERT with multiple value tuples is one statement:

INSERT INTO Trades VALUES (20260101,'IBM',100,183.4),(20260101,'AAPL',250,201.1);

What the syntax pre-check covers

Applies to: the MCP server, specifically center_verify(op="amisql"). It parses a statement and then compiles it without running it, and returns the first syntax or compile error with its line, so a statement such as SELECT FROM WHERE, which has no table list, is reported before it runs. Its OK answer names what it does not check: table and column existence and their types, permissions, and whether the engine supports every construct used. Run the statement to confirm those, and handle the execution error.

If the check cannot get the Center's lock within 10 seconds, it answers OK - parses. NOT compiled instead. Treat that answer as a parse check only.

The session-id parameter name differs across tools

Applies to: the MCP server. Some tools take __SESSIONID (web_console, web_script, web_create_chart); others require __SESSIONID_or_HEADLESSNAME (web_execute(op="executeDatamodel"), web_console(op="datamodelTables")). Pass both to be safe. See Building Charts over MCP.

Rows read over the REST query endpoint are a separate contract

Applies to: /3forge_rest/query, not the MCP server. Where a client reads rows through the REST query endpoint instead of the MCP server, that endpoint has its own contract: display=jsonMaps returns tables as an object keyed by table name with alphabetized row keys, while json/jsonRows return tables as an array preserving SELECT order; errors come back in two shapes (a 200 with status:"error" for a statement error the Center reached, or a 400 with a non-JSON body for a request rejected before running); and a result is capped at limit (default 10000) with no indication that rows were withheld. The MCP tools return rows as described in A read returns rows. See REST API for the full contract.

Feature guides