MCP server

Let an AI assistant such as Claude Code, Cursor or VS Code read and manage one network through the Peerlify MCP server, within what its API token allows.

Updated · ·By Ivan Vyshniak

Nothing on this page changes with your selection.

The Peerlify MCP server lets an AI assistant work with a network: list devices and members, approve a new device, change tags, read and edit the access policy. It speaks the Model Context Protocol, so any client that supports remote MCP servers with a custom header can use it.

Endpoint: https://mcp.peerlify.com/mcp

The server is a door onto the REST API and nothing more. Every tool is one API call made with your token, so the assistant can do exactly what the token allows, in the one network the token belongs to.

Before you start

Create an API token for the network the assistant should work with. The token's scopes are the assistant's permissions, so choose them with care:

  • For questions about the network ("which devices are offline?"), give Read on the resources it needs and nothing else.
  • Add Write on a resource only when you want the assistant to change it.
  • Set an expiry.

The assistant acts with the token's full rights

An assistant can be misled by text it reads. Device names, tags, descriptions and member names are set by the people and devices in your network, and they appear in tool results. A read-only token cannot be talked into changing anything; a full-access token can remove devices and replace the access policy. Keep your client's confirmation prompts on for tools that change things.

Connect a client

The server takes the token as a bearer token in the Authorization header. Replace papi_... with your token.

Claude Code

shell
claude mcp add --transport http peerlify https://mcp.peerlify.com/mcp --header "Authorization: Bearer papi_..."

Cursor

In .cursor/mcp.json (one project) or ~/.cursor/mcp.json (every project):

json
{
  "mcpServers": {
    "peerlify": {
      "url": "https://mcp.peerlify.com/mcp",
      "headers": { "Authorization": "Bearer papi_..." }
    }
  }
}

VS Code

In .vscode/mcp.json:

json
{
  "servers": {
    "peerlify": {
      "type": "http",
      "url": "https://mcp.peerlify.com/mcp",
      "headers": { "Authorization": "Bearer papi_..." }
    }
  }
}

A configuration file that holds a token is a secret. Keep it out of version control.

Clients that sign in with OAuth

The server accepts API tokens only. Clients that can connect to a remote MCP server only through an OAuth sign-in, with no way to set a header, cannot use it yet.

Tools

Each tool needs the scope shown. :write includes :read, and a token with no scopes has full access.

Read

ToolWhat it returnsScope
list_devices, get_deviceDevices: name, addresses, tags, approval status, online state.devices:read
get_networkNetwork settings: name, description, subnet, approval settings.network:read
get_access_policyThe access policy document.policy:read
list_tagsThe tags defined in the network.policy:read
list_users, get_userMembers, with role and approval status.users:read
list_auth_keys, get_auth_keyAuth key details. Never the key itself.keys:read
list_webhooks, get_webhookWebhook endpoints. Never the signing secret.webhooks:read

List tools take page and pageSize (1–200, default 50), as the API does.

Change

ToolWhat it doesScope
approve_deviceApproves a device that is waiting for approval.devices:write
rename_deviceSets the device's name in the network.devices:write
set_device_tagsReplaces the device's whole tag list.devices:write
remove_deviceRemoves the device from the network.devices:write
update_networkChanges the settings you name and leaves the rest.network:write
replace_access_policyReplaces the whole access policy document.policy:write
create_tag, delete_tagCreates or deletes a tag.policy:write
set_user_roleChanges a member's role.users:write
approve_userApproves a member who is waiting for approval.users:write
remove_userRemoves a member from the network.users:write
revoke_auth_keyRevokes an auth key.keys:write

Three of these deserve a second look before you allow them:

  • replace_access_policy replaces the entire document. Anything left out is removed, which can cut devices off from each other. The API validates the document and runs its tests before saving, and you can roll back to an earlier version.
  • update_network with a new subnet gives every device a new address.
  • remove_device and remove_user cannot be undone. The device has to be enrolled again; the member has to be invited again.

What the server does not do

  • Nothing that returns a secret. Creating an auth key, creating a webhook and rotating a webhook's secret are not tools, because a tool result is read by the assistant and kept in its transcript. Use the console or the REST API for those.
  • Nothing the REST API cannot do: logs, invites, exit-point policies, billing and deleting the network.

Errors and limits

  • 401 when connecting: the token is missing, invalid, expired or revoked, or its network is suspended or its plan has lapsed. Revoking a token stops every tool call at once; a connected client is turned away within 30 seconds.
  • A tool reports a missing scope: the token lacks the scope named in the message. Use a token that has it.
  • 429: one token may have 4 requests in progress, with 16 more waiting. Requests beyond that are refused until the earlier ones finish.
  • "The Peerlify API could not be reached" or "did not answer in time": the change may or may not have been applied. Have the assistant read the current state before it tries again.

Changes made through the MCP server appear in the audit log the way API changes do, with Peerlify as the actor.

Next steps

Was this page helpful?