MCP / Agent Integration

This article introduces how to integrate FIRERPA with large models (based on MCP or commands). FIRERPA has implemented the MCP server protocol and OpenAI's native tool call functionality at the underlying level, allowing you to write your own MCP plugins and serve them via the standard port 65000, or inherit the Agent class to achieve fully automated tool calls. We also provide a built-in automated MCP service.

Built-in Agent Command

With the built-in agent command, you can quickly complete fully colloquial tasks through large models, supporting any service provider compatible with OpenAI API + tool call or self-built services. Combined with the built-in crontab, you can schedule colloquial tasks to run periodically.

Hint

The agent command must be used within the built-in terminal, and you need to provide a valid API and key. The performance of different large models may vary, please choose the one that suits you best. We recommend Gemini, OpenAI, DeepSeek, GLM, etc.

Parameter NameTypeRequiredDefault ValueDescription
--apistring (str)Yes-API endpoint
--modelstring (str)Yes-Model name
--temperaturefloat (float)No0.2Model sampling temperature
--keystring (str)Yes-API key for authentication
--visionboolean (bool)NoFalseWhether to enable vision mode
--imsizeinteger (int)No1000Image size in vision mode
--promptstring (str)Yes-Instruction executed by the agent
--max-tokensinteger (int)No16384Maximum number of tokens to generate
--step-delayfloat (float)No0.0Delay between steps

Attention

Note that the --api parameter's address is the full address, not the base_url. Usually you need to append /chat/completions after the base_url to form the complete API address.

After preparing the required information, you can enter the following command in the remote desktop terminal to let the AI automatically operate your device.

agent --api https://generativelanguage.googleapis.com/v1beta/openai/chat/completions --key YOUR_API_KEY --model gemini-2.5-flash --prompt "Open the Settings app, package name com.android.settings, find network settings, and turn on airplane mode"

If your task prompt is too long, you can also provide the model prompt via a file.

agent --api https://generativelanguage.googleapis.com/v1beta/openai/chat/completions --key YOUR_API_KEY --model gemini-2.5-flash --prompt /path/to/prompt.txt

Claude & Cursor Integration (MCP)

This section introduces how to integrate FIRERPA's MCP functionality into large model clients. We take Claude and Cursor as examples for illustration; you can also use it in any other place that supports the MCP protocol.

Note

FIRERPA's built-in MCP service supports tool calls, resource reads, prompts, progress notifications, and logging.

Using the Official Extension

For Claude, you need to first locate the Claude settings page and follow the diagram. Then, according to the prompts, edit Claude's claude_desktop_config.json configuration file and write the following MCP JSON service configuration.

{"mcpServers": {"firerpa": {"command": "npx", "args": ["-y", "supergateway", "--streamableHttp", "http://192.168.0.2:65000/mcp/"]}}}

example

For Cursor, you need to open Cursor Settings, follow the diagram, and enter the following configuration.

{"mcpServers": {"firerpa": {"url": "http://192.168.0.2:65000/mcp/"}}}

example

Attention

Please replace the address in the configuration with your own device's IP address.

Writing MCP Extensions

We provide an example MCP plugin, which you can download from extensions/firerpa.py. You can refer to its implementation to write your own or extend its functionality. After downloading the extension script, upload it to the device's ~/modules/extension directory via remote desktop or manual push, and restart the FIRERPA service. FIRERPA's MCP extensions are deployed as Python scripts in the device's ~/modules/extension directory and are automatically loaded after the service restarts.