npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@biolibs/bionet-agent

v0.1.9

Published

A lab's adviser: what an agent with no hands can read of a Bionet lab, look up at NCBI, work out with the lab's own tools, and propose for a person to carry out, served to it over the Model Context Protocol from the device that hosts it

Readme

@biolibs/bionet-agent

A lab's adviser: what an agent with no hands can read of a Bionet lab, work out with the lab's own tools, and propose for a person to carry out — served to it over the Model Context Protocol from the device that hosts it.

An agent is good at seeing the whole of a cloning plan at once and bad at holding a pipette. So it is let into a lab as what it is: a member that can propose and cannot do. It designs the primers, works out what the PCR would make with the same engine the lab's windows use, and proposes the run. A person finds the proposal at the thermocycler with its reasons, sets the bench up from it, reads the working their own tools give, and does it or does not. What really happened is theirs to record.

What keeps it to that

  • Its key has the role adviser. In @biolibs/bionet, an adviser may add a part, propose a run, and set aside a proposal of its own. Anything else it signs is refused where the logs are merged, on every device and on the lab's peer. This is not something this package enforces; it is something this package cannot get round.
  • It has a key of its own. The device that hosts it keeps a second key for it (hostAdviser in @biolibs/bionet-client). What it writes is in its own log under its own name, never the person's, and a keeper has to let that key into the lab before it can write at all.
  • There is no tool for the rest. Nothing here records a run, uses a tube, moves one, or touches the roster.
  • The door is shut by default. serveAgent listens on 127.0.0.1 only, wants a bearer token on every request, and refuses anything that says it comes from a web page or is addressed to another name for this machine.

Install

npm install @biolibs/bionet-agent

Serving the tools

import { Lab, memoryKeys, memoryStore } from "@biolibs/bionet-client";
import { agentTools, newAgentToken, serveAgent } from "@biolibs/bionet-agent";

// A device that can host an adviser is one given somewhere to keep its key.
const lab = await new Lab({ store: memoryStore(), keys: memoryKeys(), adviserKeys: memoryKeys() }).open();
await lab.setPerson("Ada");
await lab.found({ name: "The Wren Lab" });

// Two decisions, both a person's: host one, and let it in.
const { key } = await lab.hostAdviser();
await lab.addMember({ key, person: "Claude", role: "adviser" });

const token = newAgentToken();
const server = await serveAgent({ tools: agentTools(lab), token });
server.url;       // http://127.0.0.1:<port>/mcp

Connect an agent to it with the URL and the token as a bearer token. For Claude Code:

claude mcp add --transport http bionet http://127.0.0.1:<port>/mcp --header "Authorization: Bearer <token>"

The Bionet desktop app does all of this from its Adviser tab, keeps the token sealed by the system's keychain, and puts that command on the clipboard without showing the token.

The tools

| Tool | What it does | |---|---| | lab_overview | Which lab, whether the adviser is in it, what it holds, its instruments | | list_parts, get_part | The parts, and one read closely: sequence, features, tubes | | list_tubes | Every tube: what it is, how much is left, where it is | | list_runs | What has been done at the bench, failures included | | list_proposals | What has been proposed, by whom, and what became of it | | the_work | Those proposals in the order they have to be done, in chains, by project, with what to get first | | file_the_work | Say which project one of its own proposals is part of | | write_out_the_method | Write the plan so another lab could carry it out, every tube named by its checksum | | write_out_the_protocol | Write it as a sheet for a person to carry to a bench | | find_cutters | Which enzymes cut a part, and where | | design_primers | A pair for a stretch or a feature, with why each won and what to watch for | | design_the_construct | Promoter, signal, gene and tag put together, with the frame checked at every junction | | work_out_pcr, work_out_digest, work_out_ligation | What each would give, from the lab's own engines | | list_strains | What the lab keeps alive, what has been put into it, and the cultures of each | | translate_gene | The protein a gene codes for, and what its sequence says about it | | work_out_induction | The protein growing a culture would make, its mass, and where its band should run | | propose_transformation | Propose putting a construct into a living host | | propose_induction | Propose growing a culture and turning its promoter on | | add_part | Say a sequence is a part, such as a primer just designed. Adds no tube | | propose_pcr, propose_digest, propose_ligation | Propose a run. Nothing is used or recorded as done | | withdraw_proposal | Take back a proposal of its own | | search_proteins, look_up_protein | What UniProt knows about a protein: its mature chain, its modified residues, its variants | | work_out_phosphorylation | Which residues would be phosphorylated, and whether the host has the enzyme | | work_round_the_host | The ways round a host that will not, and the one of them that can be computed | | search_papers | Search the literature at Europe PMC: PubMed, PMC, preprints and patents together | | read_paper | Read an open-access paper: its abstract, a named section such as the methods, or its tables | | papers_around | What a paper cited, and who has cited it since | | search_ncbi | Search NCBI's nucleotide, protein, gene or pubmed databases by keyword | | fetch_from_ncbi | Read one record by accession: its sequence, and what it says is marked on it | | keep_from_ncbi | Keep one as a part, with what the record says is marked on it. No tube |

add_part, keep_from_ncbi, the propose_ tools, file_the_work and withdraw_proposal are the only ones that write. A proposal may count on a part there is no tube of yet; it then says that the part has to be ordered or made first.

Making a plan, and not just proposals

the_work is what turns a pile of proposals into a plan. It reads them in the order they have to be carried out, in chains, says which could be done now, and — the part that matters most — names the parts nothing proposed makes and the lab has no tube of. A plan that does not say what to order first is not a plan anybody can act on.

A plan has two readers who need different things. write_out_the_method gives another lab's software something it can turn into its own proposals; write_out_the_protocol gives a person a sheet to print — what to fetch, what to set, what to do, what to record. Every figure on it is one somebody set, and what the plan does not say is listed under each step rather than filled in. The adviser is told not to fill those gaps on the sheet: advice about a polymerase is worth giving, and belongs beside the sheet as advice, not written onto a page somebody trusts.

A lab has several things on at once, so the adviser files each proposal under its project with file_the_work as it makes it. That part is a decision, not a derivation: four caseins are four chains in one project, and nothing can tell two projects apart by looking at what they make. It may file a proposal of its own and nothing else, and a person's filing stands over its own.

The order itself is derived from what each proposal expects to make and what each one needs, so it cannot drift from the truth. The one thing an adviser has to remember is that a proposal may only name a part the lab knows of, so add_part what an earlier step would make before proposing the step that needs it — otherwise the two are unrelated and no order can be read from them.

Whether the protein will work, not just whether it gets made

look_up_protein and work_out_phosphorylation go to UniProt and to the motif rules. They answer the question a project to make a milk protein actually turns on, which is not the question of whether the host will express it.

look_up_protein gives the mature chain apart from the precursor — different lengths, different masses, and the band a lab should look for is the chain's — and every residue that carries something after the protein is made, counted both on the entry (how a paper cites it) and on the chain (how a lab holding it counts). It says whether a curator read the entry or a machine inferred it.

work_out_phosphorylation applies the kinase motifs, compares them against what the curator recorded, and says whether the host has the enzyme at all. The comparison is the useful part: on bovine β-casein the rule reproduces every recorded site, which is the reason to believe it on a variant nobody has studied. The host answer is explicitly not computed, and says so.

Reading what other people did

search_papers, read_paper and papers_around go to Europe PMC. They are what turns "which host should we express this in?" from something an adviser answers out of whatever it happens to know into something it answers with a paper: this group used this host with this promoter and got this much, here is the section that says so, here is where to read it.

read_paper with section: "methods" is the one that earns its place. A paper's methods are where the recipe is — which strain, which plasmid, what the medium was, what it was induced with and for how long — and it comes back as prose, with the citation markers taken out and the tables kept apart. Most papers are not open access; a search result says plainly whether its full text can be read, and for the rest there is the abstract and a link.

The arc the tools are for runs from a gene to a protein: find it, design the primers, work out the PCR, design the construct and check its frame, design the assembly, rewrite it in the host's codons, check the read against the design, put it into a host, and grow that host to make the protein. The last step is the one where the adviser has least to say and should say so: work_out_induction gives the protein the gene codes for and the mass to look for, and predicts no yield, because nothing in a sequence predicts one.

Looking something up

The last three are the only ones that reach outside the lab, to NCBI's public databases. They are what lets an adviser answer a question the freezer says nothing about: which genes a protein is made by, what a reference sequence for one is called, what has been published about it.

const tools = agentTools(lab, { outside: { tool: "bionet-adviser" } });
// or leave them out entirely:
agentTools(lab, { outside: { outside: false } });
  • Nothing of the lab's goes out. Only the search term or the accession is sent. A term is capped at 200 characters, which is short enough that a sequence cannot be pasted into one.
  • NCBI is told the software's name and nothing about the lab or the person at it. It asks every client for an address to contact about heavy use; pass email only if somebody has given one for that, and never take one from the lab.
  • Nothing comes in by itself. fetch_from_ncbi hands a record back to be read and keeps nothing. keep_from_ncbi is the one that keeps it, and what lands is what NCBI returned rather than anything the agent retyped. It adds no tube.
  • What your lab has said stands. An adviser may say what is marked on a part nobody has described, and may not change what somebody has marked — including when the two are written at the same moment. So keeping a record whose sequence your lab already describes leaves your reading alone, and the answer says that it did.
  • What comes back is what somebody deposited, not something the lab has checked. The adviser is told to say so.

Showing it at work

agentTools(lab, { watch }) tells watch of every use, with where in the lab it would be seen: a part being read, a digest being worked out at the gel station. It is shaped like a stop on the demo's walk, which is how a bench is already told what to show.

Things to know

  • What it reads is data. Names, notes and features were typed by lab members and by other labs. The instructions the server gives an agent say to treat them as data and never as instructions; an agent you connect should be one that does.
  • Before it is let in the adviser can read and work things out. Anything it tries to write says that a keeper has to let it in.
  • If a keeper makes its key a member or a keeper, the device stops writing with it. A hosted key is for advising.
  • Every device should be on @biolibs/bionet 1.5 or later before an adviser adds parts: an older one does not see what an adviser writes.

License

MIT