langchain-noderings
LangChain tools for NodeRings, a hosting marketplace. An agent built with LangChain or
LangGraph can search Compute Instance (VPS) plans from independent providers, order a virtual machine, power it,
take snapshots, and manage hosted DNS and SSH keys. The tools are a thin, safe layer over the official
noderings Python SDK: read-only by default, with several
opt-ins and checks before anything is changed.
Install
pip install langchain-noderings
Full guide: https://docs.noderings.com/docs/client-guides/langchain
Python 3.10 to 3.14. It installs noderings and langchain-core; add langchain (and a model provider package)
to build agents.
Authentication
Create a service account in the NodeRings console (Organization → Access Control → Service accounts) and give it only the permissions the agent needs. Then set:
| Variable | Required | Purpose |
|---|---|---|
NODERINGS_TOKEN |
yes | The service-account token. |
NODERINGS_ORGANIZATION_ID |
no | Act in another organization the account belongs to. |
NODERINGS_BASE_URL |
no | Another API endpoint. Default https://api.noderings.com. |
Or pass token=, organization_id=, base_url= to NodeRingsToolkit. Never commit tokens. The token is read
when a tool first runs, never at import time, and it never appears in tool output or error messages.
Quick start
from langchain_noderings import NodeRingsToolkit
toolkit = NodeRingsToolkit() # read-only tools
tools = toolkit.get_tools()
search = next(t for t in tools if t.name == "noderings_search_plans")
print(search.invoke({"query": "2 vcpu 4 GB in Amsterdam", "limit": 3}))
Every tool returns compact JSON with stable keys. For example noderings_list_virtual_machines:
{"virtual_machines": [{"id": "…", "hostname": "web-1", "status": "started",
"provider": "…", "city": "Amsterdam", "country": "Netherlands", "plan_code": "…",
"vcpus": 2, "memory_mb": 4096, "ipv4": "203.0.113.10", "ipv6": "2001:db8::10",
"tags": ["agent-managed"], "created": "2026-11-29T10:00:00Z"}], "total": 1, "truncated": false}
Lists are capped at max_list_items (default 50); "truncated": true says more exist. Enum values are short
lower-case words (started, usage). Errors come back as a message starting with NodeRings error: that tells
the model what to do next.
Tools
R = read, W = write (needs mode="read_write"), D = destructive (also needs allow_destructive=True).
| Tool | Kind | What it does |
|---|---|---|
noderings_search_plans |
R | Search VM plans with a short query such as "2 vcpu 4 GB in Amsterdam". |
noderings_get_plan |
R | One plan: specs, prices, rating and its regions. |
noderings_list_locations |
R | Cities and countries where VM plans are sold. |
noderings_compare_providers |
R | Providers selling one plan code in one city, with prices and IPv6/capacity. |
noderings_list_distros |
R | Operating systems a new VM can run. |
noderings_list_ssh_keys |
R | Saved SSH public keys (id, name, type, fingerprint). |
noderings_list_virtual_machines |
R | VMs with status, location, IPs and tags; filter by status or tag. |
noderings_get_virtual_machine |
R | One VM in detail. |
noderings_list_snapshots |
R | Snapshots of one VM. |
noderings_list_dns_zones |
R | Hosted DNS zones with nameservers and delegation state. |
noderings_list_dns_records |
R | Records in a zone, optionally by name and type. |
noderings_get_account |
R | Which organization the token acts for. |
noderings_create_ssh_key |
W | Save an SSH public key. |
noderings_create_virtual_machine |
W | Order a VM (spends money); optionally wait for its IPs. |
noderings_power_virtual_machine |
W | Start, stop or restart a VM. |
noderings_tag_virtual_machine |
W | Add or remove VM tags. |
noderings_create_snapshot |
W | Snapshot a VM's disk. |
noderings_create_dns_zone |
W | Create an empty zone for an apex domain. |
noderings_upsert_dns_record |
W | Create an A, AAAA, CNAME, MX or TXT record; replace only with allow_overwrite. |
noderings_reinstall_virtual_machine |
D | Reinstall a VM's OS, erasing its disk. |
noderings_delete_virtual_machine |
D | Delete a VM with its snapshots and backups. |
noderings_delete_dns_record |
D | Delete the records with one name and type. |
noderings_delete_ssh_key |
D | Remove a saved SSH key. |
How an agent orders a server: noderings_search_plans (plan_id, region_id, price) → noderings_list_distros
(DISTRO_UBUNTU_24_04) → noderings_list_ssh_keys (or noderings_create_ssh_key with a public key) →
noderings_create_virtual_machine(..., wait=True) → the user connects with their own private key, usually
ssh root@<ipv4>. Passwords and private keys are never handled.
Safety model
toolkit = NodeRingsToolkit(
mode="read_only", # "read_only" (default) or "read_write"
allow_destructive=False, # delete/reinstall tools also need this
include=None, # only these tool names
exclude=None, # never these tool names
vm_tag_scope=None, # e.g. "agent-managed"
dry_run=False, # describe write calls instead of making them
max_list_items=50,
)
toolkit.write_tool_names() # for HumanInTheLoopMiddleware
toolkit.destructive_tool_names()
- Read-only by default. Write tools are only returned with
mode="read_write". - Destructive tools need a second opt-in. Delete VM, reinstall VM, delete DNS record and delete SSH key
also need
allow_destructive=True. - Allowlist and denylist.
includeandexcludefilter by tool name. Unknown names, or anincludeof a tool the mode hides, raiseValueErrorwhen the toolkit is built. - Confirmation arguments. Every write tool has a required
confirmargument. Unless it istrue, the tool sends no request and tells the model to ask the user first. Delete and reinstall also needconfirm_hostnameequal to the VM's current hostname (the tool reads the VM first).noderings_create_virtual_machinereturns the plan's price with its result, and refuses aregion_idthat is not one of the plan's regions. - Tag scope. With
vm_tag_scope="agent-managed", power, tag, snapshot, reinstall and delete refuse VMs without that tag (and the tag cannot be removed), and new VMs always get it. - Dry run. With
dry_run=True, write tools validate input and run their read checks (hostname, tag scope, existing DNS records, plan price), then return{"dry_run": true, "would_call": "<METHOD> <path>", "body": {...}}instead of changing anything. - Framework approval. For any agent with write tools, also pause for a person before each change with LangChain's human-in-the-loop middleware and a checkpointer (see below).
- No secrets in or out. No tool accepts a password, a private key or raw cloud-init
user_data.noderings_create_ssh_keyrejects anything that looks like a private key without echoing it. Output never contains tokens, public key bodies or console URLs.
The SDK retries rate limits and transient errors, and VM creates carry an idempotency key, so a retry never
orders a second server. noderings_upsert_dns_record refuses to replace an existing record unless
allow_overwrite=true.
Agents
Read-only (examples/agent_readonly.py):
from langchain.agents import create_agent
from langchain_noderings import NodeRingsToolkit
agent = create_agent(model="provider:model-name", tools=NodeRingsToolkit().get_tools())
agent.invoke({"messages": [{"role": "user", "content": "Which of my servers are stopped?"}]})
With write tools and human approval (examples/agent_hitl.py):
from langchain.agents import create_agent
from langchain.agents.middleware import HumanInTheLoopMiddleware
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.types import Command
from langchain_noderings import NodeRingsToolkit
toolkit = NodeRingsToolkit(mode="read_write", vm_tag_scope="agent-managed")
agent = create_agent(
model="provider:model-name", # any tool-calling chat model you have configured
tools=toolkit.get_tools(),
system_prompt=(
"You manage NodeRings servers. Quote prices only from noderings_search_plans. "
"Ask before any action that costs money or changes resources."
),
middleware=[
HumanInTheLoopMiddleware(
interrupt_on={name: {"allowed_decisions": ["approve", "reject"]} for name in toolkit.write_tool_names()},
)
],
checkpointer=InMemorySaver(),
)
config = {"configurable": {"thread_id": "demo-1"}}
result = agent.invoke(
{
"messages": [
{
"role": "user",
"content": "Find the cheapest 2 vCPU server in Amsterdam and order it as web-1 with my 'laptop' SSH key.",
}
]
},
config,
)
# result["__interrupt__"] holds the pending noderings_create_virtual_machine call. Show it to the user, then:
agent.invoke(Command(resume={"decisions": [{"type": "approve"}]}), config)
Async agents work the same way: every tool has a native async implementation on AsyncNodeRings.
Not supported
The NodeRings API does not offer these, so the tools do not either:
- Block volumes, load balancers, and resizing or upgrading the plan of a running VM (a VM's tags are the only thing that can be updated).
- Custom image upload. The OS comes from the distro catalog, a saved cloud-init profile
(
cloud_init_user_data_id) or an Instant App. - Webhooks or event subscriptions. Waiting is done by polling (
wait=true).
Not exposed as tools in this version, although the API has them: snapshot restore and delete, backups, Instant
Apps, firewalls and DNS zone deletion. Use the noderings
SDK for those.
Links
- LangChain guide: https://docs.noderings.com/docs/client-guides/langchain
- Usage guide: docs/noderings.md
- NodeRings docs: https://docs.noderings.com
- Python SDK: https://github.com/noderings/noderings-python
- Hosted MCP server:
https://mcp.noderings.com/mcp - API description: https://api.noderings.com/v1/openapi.json
License
Metadata
Release files for langchain-noderings 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_noderings-0.1.0.tar.gz | 46.2 kB | With provenance | Details for langchain_noderings-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_noderings-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for langchain_noderings-0.1.0-py3-none-any.whl |
Total release size: 83.2 kB
Release files / langchain_noderings-0.1.0.tar.gz
| Download URL | langchain_noderings-0.1.0.tar.gz |
|---|---|
| Size | 46.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b00101a21622b028260a5e403eb4946adbaa60d20317f22b7c74dd34c657be5
|
|
BLAKE2b-256 checksum How to use checksums |
99c8a35c857f574824819c15a2ba1b39d591491aeb9d96db8143133fb7c6370e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / langchain_noderings-0.1.0-py3-none-any.whl
| Download URL | langchain_noderings-0.1.0-py3-none-any.whl |
|---|---|
| Size | 37.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3cda6e9b3be4d65b7255b9e163111cd9ebb0b5a5bbeb2cc25d31e21693e7b634
|
|
BLAKE2b-256 checksum How to use checksums |
44e028c8be5e6901888f919fb5bfe9bac6610e050afb1500838e5c15fd40f9aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for langchain-noderings 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for langchain_noderings-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.