Set up an MCP server and test order lookup in RustClaw

The Model Context Protocol (MCP) lets the agent use tools from other systems. Connect a local stdio command or a remote Streamable HTTP server. The downloadable example below lets you look up an order and find it again by its tracking number.

Add a local or remote MCP server

Sign in as an administrator and open Models → External tool servers → Add server. You can add multiple servers. Give each one a unique name and configure its connection, enabled state, and allowed tools separately.

Local command (stdio)
Enter the startup command and its arguments in separate fields, one argument per line. The command runs on the agent host, so the executable and any paths must be accessible there.
Remote server (Streamable HTTP)
Choose HTTP under Connection and enter the full MCP endpoint from your provider, such as https://tools.example.com/mcp. Follow the provider’s authentication instructions for a Bearer Token or OAuth client credentials. Enter the variable name in the console, such as ORDER_MCP_TOKEN, and set its value in the agent service’s environment.

Connect a local Python server for order lookup

This read-only example uses the Python 3 standard library and fixed sample orders. Save the downloaded file on the device running the agent and enter the following server settings.

Console fieldValue
Server nameorders_demo
ConnectionLocal command (stdio)
Startup commandpython3. If the service cannot find it, use the full path to the Python 3 executable on the host.
Command argumentsEnter the full script path on one line. Replace /home/agent/mcp-orders-demo.py with the location where you saved it.
Allowed toolslookup_order
find_order_by_tracking

Trust the server and enable the allowed tools

  1. Review the command or address and select I trust this server if you manage it or trust its operator.
  2. Enter each exact tool name on its own line under Allowed tools. The two lookup tools in the table are enough for the order demo.
  3. Turn on Enable this server and Enable MCP tools. Select Save MCP settings, restart the agent service, then select Refresh status.

Read how tool requests and permissions are checked

Check the connection, allowed tools, and order result

  1. When the server shows Ready, select Test protocol and confirm that the console shows Connection healthy.
  2. Check the tool count and names. The demo exposes two order lookup tools.
  3. Use a natural-language request in Agent chat. The agent can choose from the available tools. If asked to approve a call, review the tool and its lookup arguments before confirming.
The External tool servers panel shows two allowed order tools and a successful connection test.
Sample order server settings and connection test in the console.

Two requests to try

“Where is order 3? What is the tracking number?”

Order 3 is in transit at the Hangzhou sorting center. Its tracking number is 7898047967.

“Which order has tracking number 7898047967?”

The tracking number should match order 3. The location and delivery date are fixed demo data.

Agent chat showing the status, location, and tracking number of a sample order.
Agent chat shows the logistics result for sample order 3.

When the connection or order lookup fails

The External tool servers section is missing
Sign in as an administrator and scroll to the MCP section on the Models page.
Test protocol is disabled
Save changes if the server shows Pending save. If it shows Pending restart, restart the service and refresh its status. Run the test once the server is Ready.
The server is Ready with zero tools
An empty allowlist exposes zero tools. Enter the exact tool names from the provider, one per line. Save, restart, and refresh the status.
The connection is healthy, but the lookup fails
Check that the relevant lookup tool appears in the list. Try sample order 3 or tracking number 7898047967 and check both numbers in the reply.
The server shows Needs attention
For a local command, verify that the service can find the executable and read the script. For a remote server, check that the service host can reach the MCP endpoint and has the required credential variables.