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
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):
{
"mcpServers": {
"peerlify": {
"url": "https://mcp.peerlify.com/mcp",
"headers": { "Authorization": "Bearer papi_..." }
}
}
}VS Code
In .vscode/mcp.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
| Tool | What it returns | Scope |
|---|---|---|
list_devices, get_device | Devices: name, addresses, tags, approval status, online state. | devices:read |
get_network | Network settings: name, description, subnet, approval settings. | network:read |
get_access_policy | The access policy document. | policy:read |
list_tags | The tags defined in the network. | policy:read |
list_users, get_user | Members, with role and approval status. | users:read |
list_auth_keys, get_auth_key | Auth key details. Never the key itself. | keys:read |
list_webhooks, get_webhook | Webhook endpoints. Never the signing secret. | webhooks:read |
List tools take page and pageSize (1–200, default 50), as the API does.
Change
| Tool | What it does | Scope |
|---|---|---|
approve_device | Approves a device that is waiting for approval. | devices:write |
rename_device | Sets the device's name in the network. | devices:write |
set_device_tags | Replaces the device's whole tag list. | devices:write |
remove_device | Removes the device from the network. | devices:write |
update_network | Changes the settings you name and leaves the rest. | network:write |
replace_access_policy | Replaces the whole access policy document. | policy:write |
create_tag, delete_tag | Creates or deletes a tag. | policy:write |
set_user_role | Changes a member's role. | users:write |
approve_user | Approves a member who is waiting for approval. | users:write |
remove_user | Removes a member from the network. | users:write |
revoke_auth_key | Revokes an auth key. | keys:write |
Three of these deserve a second look before you allow them:
replace_access_policyreplaces 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_networkwith a new subnet gives every device a new address.remove_deviceandremove_usercannot 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
401when 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.