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 asORDER_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 field | Value |
|---|---|
| Server name | orders_demo |
| Connection | Local command (stdio) |
| Startup command | python3. If the service cannot find it, use the full path to the Python 3 executable on the host. |
| Command arguments | Enter the full script path on one line. Replace /home/agent/mcp-orders-demo.py with the location where you saved it. |
| Allowed tools | lookup_orderfind_order_by_tracking |
Trust the server and enable the allowed tools
- Review the command or address and select I trust this server if you manage it or trust its operator.
- 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.
- Turn on Enable this server and Enable MCP tools. Select Save MCP settings, restart the agent service, then select Refresh status.
Check the connection, allowed tools, and order result
- When the server shows Ready, select Test protocol and confirm that the console shows Connection healthy.
- Check the tool count and names. The demo exposes two order lookup tools.
- 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.
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.
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
7898047967and 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.
Combine order lookup with a cited returns policy Import a returns handbook into a RAG knowledge base