MCP server in Analytica

Revision as of 23:34, 2 January 2026 by Lchrisman (talk | contribs) (Created page with "''New in Analytica 7.0'' ::''The feature described here is '''''experimental''''' an for the time being intended for Lumina-internal use. As an experimental feature, it i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

New in Analytica 7.0

The feature described here is experimental an for the time being intended for Lumina-internal use. As an experimental feature, it is subject to change.

Implementing an MCP server

A Model Context Protocol (MCP) server exposes tools that can be used by an AI agent such as Claude Code and Gemini CLI. It is possible to implement an MCP server directly in an Analytica model using specially tagged UDFs to implement each tool. It is easy to do so, and can enable AI agents to use or control your Analytica model.

At present, this feature has been created and is being used (or use being explored) internally at Lumina in several ways, including:

  • For automation of Quality Assurance testing.
  • For end-to-end Assista evaluation (especially when Assista takes actions during its response).
  • To AI coding tools to more actively control Analytica when developing code, debugging, reproducing UI bugs, etc.
  • To interactively use desktop Analytica in coordination with Claude Code, especially on some cases where Claude has access to tools that Assista does not.

The current implementation has distinct limits, and is likely to change as we gain more internal experience with coordinating AI agents and desktop Analytica.

Creating an MCP server

To put desktop Analytica into an MCP-serving mode, you need to launch it with the command line parameter:

Analytica.exe /mcp:«port»

such as

Analytica.exe /mcp:6541

To implement a tool that an AI agent can use, create a User-Defined Function with a description that guides a language model as to when and how to use the tool, and then include the following text somewhere within the description: {@mcpTool}. We usually place this at the very beginning or very end of the description. This tag labels the UDF as an MCP tool.

When you declare parameters, you must declare the data type of each parameter as either Number or Text. The atom qualifier is also recommended but not required. Parameters can be optional and can include default values. At this time, no parameter can be declared as an array, index, object (or other non-evaluated eval mode), or repeated parameter. These may be relaxed later as the implementation becomes more complete.

If your UDF makes use of parameter qualifiers that are not yet supported, it will not be included in the tool/list result.

Configuring the client

To configure the client to use your server, your Analytica process must already be running with your UDFs existing.

Configure the client using a Transport type of "Streamable HTTP" and a URL of "http://localhost:6541/mcp", where the port number matches the port you used for the /mcp:6541 parameter when you launched Analytica.exe.

A convenient testing client is the MCP Inspector which can be run in an installation-free mode. You do have to already have Node.js installed, and then from a command line just run:

npx @modelcontextprotocol/inspector

The testing client UI opens in a browser. After you connect, you should see your exposed UDFs after pressing List tools.

Comments


You are not allowed to post comments.