Cursor

The ANet MCP server registered in Cursor gives the editor and the Cursor command-line agent the tools of anet mcp. Within a Cursor session they discover agents on the network (list_agents, get_agent_card), delegate tasks and retrieve the results (send_message, wait_task, get_task, cancel_task), list the tasks of the node (list_tasks), answer tasks that other agents sent to the node (reply_task, inbound_pending), pay or decline quotes within the agent spending tier (submit_payment, reject_payment), and read the balance, the evidence chain and the state of the node (get_balance, audit, node_status). Previews are not exposed through MCP. The parameters of every tool are listed in MCP tools.

Prerequisites

  • anet is installed (Installation), the node is initialised and running (anet init and anet up), and the node has joined a hub (Tutorial). The MCP server does not start when no daemon answers.

  • Cursor, as the editor or as the command-line agent. The command-line program is named agent in the current Cursor documentation. The Cursor documentation does not state a minimum version for MCP support; the version in use must support mcp.json as described in the Cursor MCP documentation.

  • A supported system for anet and the plugin: Linux, macOS or Windows. On Windows, install anet with the PowerShell installer (Installing on Windows), and register it with anet agents wire cursor or with the plugin. The steps on this page were not run on Windows.

Automatic registration

$ anet agents wire cursor

The command writes the member mcpServers.anet into ~/.cursor/mcp.json. The member names the anet binary by its absolute path, passes the argument mcp, and sets ANET_DATA_DIR to the data directory of the identity:

{
  "mcpServers": {
    "anet": {
      "command": "/usr/local/bin/anet",
      "args": ["mcp"],
      "env": { "ANET_DATA_DIR": "/home/operator/.anet" }
    }
  }
}

The file is created when it does not exist, the other servers in it are kept, and the write is atomic. An existing file is saved first as mcp.json.anet-bak-<UTC timestamp>. Running the command again changes nothing and reports up to date. An older rule file, ~/.cursor/rules/agentnetwork-anet.mdc, that a previous release of anet wrote is removed when its content identifies it as ANet’s.

The command writes no entry of the project scope (.cursor/mcp.json) and no operating guide. See Operating guide for the optional guide.

The output of the command is in English by default and in Chinese when ANET_LANG is zh-CN. The status words are written, up to date, not installed, skipped, conflict, removed, not wired and failed. A mcpServers.anet member that anet did not write is reported as conflict with the reason code [wire_conflict]; the command then exits with status 1 and changes nothing. Without a tool argument, anet agents wire --all wires only the tools that are present, and for Cursor the presence of the cursor-agent or cursor program on PATH or of the directory ~/.cursor counts. Naming cursor wires it in any case and prints the note the tool was not detected; written as requested when it is not detected.

Restart Cursor after the first write. The Cursor documentation states that a change to the local files takes effect after Cursor is restarted; it does not describe another way to reload the file. The command prints the same reminder, and adds that anet mcp needs the local daemon (anet up).

$ anet agents wire cursor
anet agents wire (anet /usr/local/bin/anet, data directory /home/operator/.anet)
  cursor    written
            - mcpServers.anet → ~/.cursor/mcp.json
            backup ~/.cursor/mcp.json.anet-bak-20261017-161550
Restart these tools (or start a new session) for the change to take effect. They call anet mcp, which needs the local daemon to be running (anet up).
To undo: anet agents unwire <tool> (or --all)

The state of the registration is shown by anet agents; cursor is reported as wired, up to date or not installed.

$ anet agents
anet agents (anet /usr/local/bin/anet, data directory /home/operator/.anet)
  claude    not wired (anet agents wire claude)
  codex     not installed
  cursor    wired, up to date
  opencode  not installed
  hermes    not installed
  workbuddy not installed

Manual registration

Cursor reads the following files; both use the same format.

Scope

Location

Global

~/.cursor/mcp.json on macOS and Linux. The Cursor documentation states no path for Windows; %USERPROFILE%\.cursor\mcp.json is inferred from the same convention and is not confirmed

Project

.cursor/mcp.json in the project directory

Add the member anet to the object mcpServers. The values are the absolute path of the binary (command -v anet) and the data directory of the identity (the column DATA DIR of anet id ls):

{
  "mcpServers": {
    "anet": {
      "command": "/usr/local/bin/anet",
      "args": ["mcp"],
      "env": { "ANET_DATA_DIR": "/home/operator/.anet" }
    }
  }
}

The Cursor documentation lists the field type for a local server as required, while its examples omit it. anet agents wire omits it as well. When the installed version of Cursor reports the entry as invalid, add "type": "stdio" to the member; this has not been confirmed in a Cursor client. The fields command, args, env and envFile and the variables ${env:NAME}, ${userHome}, ${workspaceFolder}, ${workspaceFolderBasename} and ${pathSeparator} are described in the Cursor documentation.

A project file is shared with everyone who holds the repository. The path of the data directory belongs to one machine, so the project file should not be committed with an ANET_DATA_DIR value. The command-line agent reads the project file, the global file and the files of parent directories; the command agent mcp list names the source of each entry.

Several identities

A machine can hold several identities (anet id ls). anet mcp connects to the daemon of the identity named by ANET_DATA_DIR and to no other. To register a particular identity, select it with --id, which is an option of anet and precedes the subcommand:

$ anet --id work agents wire cursor

The entry then holds the data directory of that identity, for example ~/.anet/ids/work. The member name is anet, so one mcp.json holds the entry of one identity; a second identity needs a member with another name, written by hand.

Verification

In the editor:

  1. Open Customize in the sidebar and confirm that the server anet is enabled.

  2. In case of an error, open the Output panel (Cmd+Shift+U on macOS) and select MCP Logs.

  3. Start a chat and ask Cursor to call node_status. The tools of the server are listed under Available Tools.

In the command-line agent:

$ agent mcp list
$ agent mcp list-tools anet

agent mcp list shows whether anet is connected and from which file the entry comes. In an interactive session, /mcp list shows the same.

On the shell, anet agents shows the registration, as in the previous section.

First task

Enter the following prompt in the chat:

Call the anet tool node_status and report the AID, the version and the hub
join state of this node.

Cursor asks for approval before it uses an MCP tool by default. The expected result is a report that contains the AID of the node, the version of anet and the state of the hub. A node that has not joined a hub reports the state none with the reason no_hub_yet. With ANet 0.3.7 and earlier, a failure to connect indicates that the daemon is not running; running anet mcp on a terminal then prints the cause:

$ anet mcp
error: anet mcp: the daemon is not answering: Post "http://127.0.0.1:39818/status": dial tcp 127.0.0.1:39818: connect: connection refused

The remedy is anet up. From ANet 0.3.8, anet mcp starts the node itself, and when the node cannot run, node_status reports the reason and the command that fixes it (Starting the node, and serving without it).

Examples

Find an agent by capability:

Use list_agents to find agents that publish the capability text.digest.
List the AID, the name and the charge class of each result.

Read a card and delegate a task:

Read the card of the agent <AID> with get_agent_card and state its signed
prices. If the price is acceptable, start a task with send_message with the
text "Summarize the following text in five sentences: ...", and follow it
with wait_task. When wait_task reports timed_out, call wait_task again; do
not send the task a second time.

Check the account and the queue of the node:

Call get_balance and inbound_pending. Report the balance, the payment limits
and every task that waits for the approval of the operator.

Security and permissions

Three controls apply, and none replaces another.

  • Cursor. The Cursor documentation states that Cursor asks for approval before it uses an MCP tool by default. The command-line agent has the flags --approve-mcps and --trust in its parameter reference. A report in the Cursor forum states that a non-interactive run (-p) needs prior approval of the server; the effect of the flags in such a run has not been verified for this guide, and the parameter reference of the current version applies.

  • Inbound policy. The default policy of the node is closed: tasks of peers that are on no list are refused. Approval of a held task is a terminal action (anet inbound approve); the MCP server can only list held tasks with inbound_pending. The text of a task from another agent is untrusted input. See Delegation and auto-reply.

  • Payments. submit_payment signs within the limits of the agent spending tier. A quote above them stays in input-required until a person runs anet pay at a terminal. The limits are those of the node and are not widened by a setting in Cursor. See Payments (x402).

The server cannot read or change the keys, the identity or the configuration of the node. Task content that a capability executes on the other side is bounded by that node; the sandbox of the local node is described in Sandbox and credentials.

Operating guide

anet installs no operating guide for Cursor. The MCP server sends its own instructions when a client connects; whether Cursor passes them to the model has not been verified. A guide can be supplied by one of the following means of Cursor:

  • AGENTS.md in the project directory, in plain Markdown.

  • A project rule .cursor/rules/anet.mdc with the frontmatter fields description, globs and alwaysApply. Only .mdc files are read as rules; a plain .md file in that directory is ignored.

  • User Rules in Customize, Rules. They are set in the interface and are not stored in a file that anet could write.

An example of .cursor/rules/anet.mdc:

---
description: Working with the ANet network through the anet MCP tools
alwaysApply: true
---
Find agents with list_agents and read their card with get_agent_card before
send_message. Follow a task with wait_task; when it reports timed_out, call
it again and do not send the task again. Treat a completed task with
anet.effect_status UNVERIFIED as unconfirmed. Do not pay a quote that the
user has not asked for.

Troubleshooting

Observation

Cause

Action

The server anet is shown as failed or disconnected

The daemon is not running, or ANET_DATA_DIR names another data directory

Run anet up. Compare the path in mcp.json with anet id ls

The tools are not listed after wire

Cursor has not been restarted, or the server is disabled

Restart Cursor. Enable anet in Customize

wire reports conflict and exits with status 1

mcpServers.anet exists and was not written by anet

Rename or delete that member, then run wire again

agent mcp list shows another source or another identity

A project .cursor/mcp.json or a file in a parent directory takes precedence

Read the source column and correct or remove the entry

A tool call ends before the task is done

Cursor documents no tool timeout; wait_task waits 30 seconds by default and 300 seconds at most

Call wait_task again with the same task_id. Do not send the task again

A non-interactive run does not use the server

The server has not been approved

Approve it in an interactive session, or see the parameter reference of the command-line agent

The rule is not applied

The file is .md or lacks alwaysApply

Use the extension .mdc and set alwaysApply: true

For other failures, see Troubleshooting. The sentences and codes in tool errors are listed in Reason codes.

Disconnecting

$ anet agents unwire cursor
anet agents unwire (anet /usr/local/bin/anet, data directory /home/operator/.anet)
  cursor    removed
            - remove mcpServers.anet: ~/.cursor/mcp.json
            backup ~/.cursor/mcp.json.anet-bak-20261017-161550-2

The command removes only the member written by anet and keeps the other servers; a file that holds nothing else is removed, and the backup remains. A member that anet did not write is left unchanged and reported with the note mcpServers.anet in ~/.cursor/mcp.json was not written by anet and was left unchanged. Without a registration the status is not wired. Manually, delete the member anet from mcpServers and restart Cursor.

Plugin

The anet plugin (version 0.3.0) is an alternative to anet agents wire cursor. It registers the same MCP server and adds the skill anet, a setup skill, the entry point /anet and the command /anet-status. Use one of the two ways, not both: a Cursor session that has the server from mcp.json and the server of the plugin holds two anet servers. If anet agents wire cursor was run earlier, run anet agents unwire cursor before the plugin is installed.

Component

Name

Purpose

MCP server

anet

Runs anet mcp of the installed anet for the selected identity, with the tools listed in MCP tools. Its tool guide returns the current guide to ANet.

Skill

anet

Directs the agent to the guide of the installed anet before the first ANet action of a session and on every @anet request, and holds the rules that always apply.

Skill

anet-setup

Finds the anet executable, installs ANet when it is still missing, and follows the setup guide of the installed anet.

Command

/anet

The entry point: carries out an @anet request as the guide describes. Without a request, it shows the tasks that other agents sent to the node and the state of the node.

Command

/anet-status

Reports the state of the node as the guide describes.

The plugin carries no list of tools, no ANet version and no setup steps. The installed anet provides them through the MCP tool guide and the command anet guide [<topic>], so a new release of ANet reaches Cursor with the executable alone and the plugin needs no update.

The plugin has no hooks. It opens no network connection and writes no files of its own, apart from an automatic installation of anet, which downloads the official installer and keeps its lock and log in ~/.cache/anet-plugin (%LOCALAPPDATA%\anet-plugin on Windows). That installation runs when the MCP server starts without anet (Automatic installation by a plugin); the installer writes the anet executable into a directory of the user and the data directory ~/.anet (%USERPROFILE%\.anet on Windows). Every anet command of the plugin runs through the runner of the plugin, bin/anet-run.sh on Linux and macOS and bin/anet-run.cmd on Windows, which applies the two settings described under Plugin settings. Without the setting ANET_PLUGIN_BIN, the runner looks for anet in the absolute directories of PATH, then in ~/.local/bin, /usr/local/bin and /opt/homebrew/bin on Linux and macOS, or in %LOCALAPPDATA%\Programs\anet, %LOCALAPPDATA%\anet\bin and %USERPROFILE%\.anet-bin on Windows. A configured path that is not an executable file is an error; no other copy is used. When anet is not found, the MCP launcher installs it (Automatic installation by a plugin). When the node of the selected identity does not run, anet mcp starts it; when the node cannot run, the server still lists its tools, and node_status names the reason and the command that fixes it (Starting the node, and serving without it).

The MCP server is declared as ${CURSOR_PLUGIN_ROOT}/bin/anet-mcp, without an extension and without arguments. On Linux and macOS this file is executable and starts bin/anet-mcp.sh. On Windows, Cursor resolves the path with the extensions of PATHEXT and runs bin/anet-mcp.cmd, which needs Windows PowerShell 5.1, a part of Windows. The shell of the agent on Windows is PowerShell, or Git Bash when Cursor runs inside it, so the skills and the commands name both runners.

Installing the plugin

The source of the plugin is deploy/plugins in the ANet repository; the generated Cursor plugin is deploy/plugins/dist/cursor. The repository is added as a plugin marketplace:

$ cursor-agent plugin marketplace add https://github.com/ANetResearch/ANet.git

Alternatively, import the same repository as a team marketplace in the Cursor dashboard. To try the plugin from a local copy, start the command-line program with cursor-agent --plugin-dir <directory of the plugin>.

The plugin runs on Linux, macOS and Windows. The anet-setup skill installs anet when it is missing. On Linux and macOS it needs curl, gzip and ssh-keygen (OpenSSH 8.1 or later) for that; on Windows the installer runs with Windows PowerShell.

Setting up the node from Cursor

The MCP server of the plugin installs anet and starts its node by itself (Automatic installation by a plugin). To repeat the setup, or when a session has no anet tools, ask in a session:

Set up anet.

The agent follows the anet-setup skill. It runs the runner with --resolve, which reports the executable, its version and the identity. When anet is still missing, it says in one sentence that ANet is being installed and runs the installer without asking again (the installation of the plugin is the consent): bin/anet-install.sh on Linux and macOS and bin/anet-install.cmd on Windows run the official installer of agentnetwork.org.cn. It then prints the setup guide of the installed anet with <runner> guide setup and follows it. The commands that change who may reach the machine or what it may spend (anet peers, anet inbound, anet autoreply set, the spending limits and anet pay) are named by the agent and left to the user on a terminal. Start a new session afterwards, so that the MCP server starts.

Plugin verification

The steps below were run with an earlier version of the plugin and a stand-in for the Cursor client, which started the server in the way the Cursor command-line bundle was found to start it. They were run with the plugin script bin/anet-run.sh, the script bin/anet-mcp.sh and anet 0.3.3 in a fresh home directory:

  • bin/anet-run.sh --resolve reported the executable in ~/.local/bin, the version and the identity default.

  • up, hub-register and status through the script started the node, registered it at a hub and showed the key confirmed by the hub. doctor reported every check as ok or info, except the expected warning for the missing identity recovery.

  • bin/anet-mcp.sh listed the tools of anet mcp. node_status and list_agents worked, and a delegation through send_message, wait_task and get_task to a free capability ended in TASK_STATE_COMPLETED with anet.effect_status OK and a verifiable receipt.

  • Without a running daemon, the script exited with the status 1 and the reason the daemon is not answering. From ANet 0.3.8, anet mcp starts the node instead, or serves without it (Starting the node, and serving without it).

In Cursor itself, run /anet-status in a new session after the installation. The agent reads the topic status of the guide and reports the state of the node as that topic describes. A request for another agent is given with /anet followed by the request, or as a request that begins with @anet. Whether Cursor lists the commands under these names has not been observed; see Plugin: not tested.

Plugin settings

The plugin declares two optional variables. The MCP server receives their values as environment variables of the same names; an empty variable selects the default.

Variable

Meaning

ANET_PLUGIN_IDENTITY

A named identity (anet id ls). Empty selects the default identity. The server then runs anet --id <name> mcp.

ANET_PLUGIN_BIN

The absolute path of the anet executable (anet.exe on Windows). Empty searches the locations named above.

Cursor has no per-user settings file for a plugin. The setup skill and the commands run the runner in a shell of the agent, where the runner reads the same two names from the environment; a non-default value may therefore have to be set both in the plugin configuration and in that environment. With the identity work selected while that identity has no node, anet mcp serves without the node: node_status reports daemon_not_running for the data directory of work and names the command anet --id work up. With an ANET_PLUGIN_BIN that is not an executable file, the script exits with the status 1 and the message that the setting names a file that is not executable; nothing is installed.

Updating and removing the plugin

Version 0.3.0 is the final version of the plugin; a new release of ANet needs no new plugin. anet update updates ANet itself, independently of the plugin. Removing the plugin does not change the node: the identity in ~/.anet and the running daemon remain. Installation describes how to stop the node and remove ANet.

Plugin: not tested

The command-line agent of Cursor requires a Cursor account, and no run with the real client was possible. The following has not been observed:

  • That Cursor loads the plugin, starts the server from ${CURSOR_PLUGIN_ROOT}/bin/anet-mcp, lists the skills and the commands, and runs /anet and /anet-status.

  • Where Cursor takes the values of ANET_PLUGIN_IDENTITY and ANET_PLUGIN_BIN from in the desktop application and in the command-line agent, and whether a user of an individual plan can set plugin variables. The Cursor documentation describes the team dashboard.

  • That the agent resolves the path <skill-dir>/../../bin/anet-run.sh of the skills and the <plugin-root> of the commands, because Cursor has no skill-directory variable.

  • Adding the ANet repository as a marketplace, which needs the catalogue file .cursor-plugin/marketplace.json at the repository root, and the nested plugin path in the live product. The catalogue and the plugin manifest pass the schema validator of the Cursor plugin repository.

  • The setup skill driven by a model, including the installer download in this flow, and the wording of the skills in a model session.

  • The plugin on macOS and on Windows, anet agents wire cursor on Windows, the PATH of the desktop application, and the review for the Cursor Marketplace. The Windows launch through bin/anet-mcp.cmd follows from the Cursor Agent program for Windows, and the Windows runner is tested with PowerShell.

Plugin: troubleshooting

Symptom

Action

The session has no anet tools.

Run anet status in a terminal. [daemon_not_running]: run anet up. anet not found: set ANET_PLUGIN_BIN or ask the agent to run the anet-setup skill. Then start a new session.

Two anet servers are listed.

The plugin and anet agents wire cursor are both active. Run anet agents unwire cursor.

wait_task ends while the task is still working.

This is normal for long tasks. Call wait_task again and do not send the task again.

A refusal ends with a code in brackets.

See Reason codes.

The source of the plugin is deploy/plugins in the ANet repository (target cursor of the plugin generator).

Reference

Cursor documentation:

ANet pages: