Skip to main content
Glama
musharna
by musharna

phylokit-mcp

ci PyPI python license Glama DOI

Phylogenetic inference over MCP, driving IQ-TREE 2 through piqtree.

A topology without support is not a result. infer_tree always runs a bootstrap and always returns per-clade support. There is no flag to skip it.

5 tools, 62 tests against real IQ-TREE (no mocked engine), 10 mutation checks, and a real-process JSON-RPC handshake test.

Why the rule

A maximum-likelihood tree looks identical whether or not the data support it. Measured here, on alignments simulated from a known 7-taxon tree so the right answer is not in doubt:

sites

informative sites

recovered the true tree?

lowest clade support

300

51

yes, exactly

1.00

60

11

no — RF 2

0.57

At 60 sites the tree contains a clade (C,D,G) that does not exist and omits one that does (E,F,G). Both runs return a fully resolved Newick string of the same shape; nothing about the topology itself distinguishes them. The support values do — and the false clade is the lowest-supported one in the tree.

That is the entire argument for this server. Returning a bare tree returns a result the caller cannot evaluate.

Related MCP server: STRING-db MCP Server

What it reports that a Newick string cannot

  • Conflicting clades — groupings the data support at ≥0.70 that are absent from the reported tree. A support-annotated Newick string has nowhere to attach these, so the standard format silently drops them.

  • fraction_resolved — the share of clades clearing 0.70. The headline number, before any individual grouping is repeated as fact.

  • Model runners-up with ΔAIC — not just a winner. On the 300-site alignment above, simulated under JC, the AIC winner is F81, with several models inside the conventional ±2 indistinguishability margin. A winner without its margin is a claim the numbers do not support.

  • Length versus evidencen_parsimony_informative alongside n_sites. A 10,000-site alignment of near-identical sequences supports nothing.

Tools

tool

what it does

infer_tree

ML tree plus bootstrap support, per clade. Never one without the other.

select_substitution_model

Ranks 100+ models with ΔAIC/AICc/BIC, and says when the criteria disagree.

compare_trees

Robinson–Foulds distance and the clades that differ. Compares splits, not strings.

simulate_alignment

Generates sequences along a tree you specify — the positive control.

capabilities

Engine version, 215 substitution models, enforced limits.

Install

pip install phylokit-mcp

piqtree ships prebuilt wheels, so there is no compiler, no R and no conda step — but it requires Python 3.12+, and so does this package.

Configure your MCP client

{
  "mcpServers": {
    "phylokit": {
      "command": "uvx",
      "args": ["phylokit-mcp"]
    }
  }
}

uvx fetches the released package on demand, so this needs no prior install — but it must resolve a Python 3.12+ interpreter, since that is piqtree's wheel floor. If uvx picks an older one, pin it with "args": ["--python", "3.12", "phylokit-mcp"].

If you installed it yourself instead, "command": "phylokit-mcp" works when the executable is on your PATH; give the absolute path to the entry point in the environment you installed into if it is not.

The same file ships as .mcp.json in this repo, which Claude Code picks up automatically when the repo is your working directory.

Reproducibility, stated precisely

Measured, not assumed:

  • Across fresh processes: exact. Three runs of an identical 30-replicate bootstrap returned byte-identical support.

  • Within one long-lived process: not bit-exact. Passing the same rand_seed does not fully reset IQ-TREE's internal state — building the same tree three times gave call 1 == call 2 but call 3 different.

The practical size: over six repeated 50-replicate calls, three of four clades were bit-identical and one moved 0.02 — a single replicate flipping, well inside the bootstrap's own sampling error (~0.07 at 50 replicates). The topology and every conclusion were unchanged. This is reported in every response rather than papered over, because an MCP server is long-lived by design and that is exactly the condition which exposes it.

Threads are pinned to 1 before piqtree is imported: likelihood sums accumulate in thread-completion order, floating-point addition is not associative, and near-tied topologies can flip on the last bits.

Limitations

  • Nucleotide and protein alignments. Pass sequence_type="protein" and a protein model (LG, WAG, …). Codon models are still not exposed. The molecule type is declared, never sniffed: an alignment of only A/C/G/T is a valid protein alignment too (Ala/Cys/Gly/Thr), so guessing would fit a nucleotide model to protein data and return a tree, a likelihood and support values that are all wrong and none of which complain.

  • Bootstrap only — no aLRT, no approximate Bayes, no UFBoot. Support is the nonparametric bootstrap (Felsenstein 1985), computed here rather than read back from IQ-TREE, because piqtree 0.8.3 runs bootstrap_replicates but does not expose the resulting values.

  • Cost is linear in replicates. ~130 ms per replicate at 7 taxa / 300 sites, and it grows with taxon count. Capped at 200 taxa and 1000 replicates.

  • It does not align sequences. Ragged input is refused, not guessed at.

  • Unrooted trees. No rooting, no dating, no ancestral reconstruction.

Licence

GPL-2.0-only. The "only" is load-bearing: piqtree declares GPL-2.0-only, which is incompatible with GPL-3.0, so the distributed combination cannot be GPL-3. cogent3 is BSD and imposes nothing.

Unofficial. Not affiliated with, endorsed by, or sponsored by the IQ-TREE authors or the cogent3 project. IQ-TREE 2 is academic software and expects to be cited — if results from this server appear in published work, cite IQ-TREE 2 as directed at iqtree.org, not this wrapper. See NOTICE.

Available Tools

5 tools
capabilitiesEngine capabilities and limitsA
Read-onlyIdempotent

What this server can do, and the bounds it enforces.

Args: include_models: Include the full substitution-model list (long).

ParametersJSON Schema
NameRequiredDescriptionDefault
include_modelsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
engineYes
limitsYes
criteriaYes
engine_versionYes
threads_pinnedYes
support_thresholdsYes
substitution_modelsNo
n_substitution_modelsYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint=true and idempotentHint=true. Description adds 'bounds it enforces' hinting at limits but no detail. Adequate given annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely concise, purpose stated upfront in first sentence, no filler. Efficient for an introspection tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists but not shown; description covers basic purpose. Could elaborate on 'bounds' but sufficient for a simple capability listing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema coverage, description adds value by explaining include_models parameter ('Include the full substitution-model list (long)') beyond the schema's title and default.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it returns server capabilities and bounds, which is specific and distinguishes from sibling tools like infer_tree or select_substitution_model that perform different actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or alternatives, but the introspective nature is implied. Could benefit from noting it's for discovery before using other tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

compare_treesCompare two tree topologiesA
Read-onlyIdempotent

Robinson-Foulds distance between two trees, and which clades differ.

Compares SPLITS, not strings: the same topology has many valid Newick representations, so string equality answers a different question.

Args: newick_a: First tree in Newick format. newick_b: Second tree in Newick format.

ParametersJSON Schema
NameRequiredDescriptionDefault
newick_aYes
newick_bYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
warningsYes
only_in_aYes
only_in_bYes
shared_taxaYes
n_shared_cladesYes
robinson_fouldsYes
identical_topologyYes
normalised_robinson_fouldsYes

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and idempotentHint true, so the description adds only the nuance that it compares splits. No contradictions, but minimal extra behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise lines plus Args, no redundancy. Every sentence adds value; front-loaded with purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool is simple with two params and has an output schema. Description covers concept, input format, and key distinction (split vs string). Complete for the complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage, but the description's Args section adds meaning: 'First tree in Newick format' and 'Second tree in Newick format'. This compensates well, though not exhaustive.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it computes Robinson-Foulds distance and identifies differing clades, distinguishing it from string comparison. Specific verb+resource with unique focus.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly compares splits not strings, hinting that string equality is a different task. Sibling tools like infer_tree are distinct, so no confusion. Slightly lacking explicit when-not or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

infer_treeInfer a phylogenetic tree with bootstrap supportA
Read-onlyIdempotent

Build a maximum-likelihood tree and measure how well the data support it.

Always bootstraps. There is deliberately no option to skip it: an unsupported topology is the failure mode this server exists to prevent.

Args: fasta: Aligned nucleotide sequences in FASTA. All sequences must be the same length — this server does not align. model: Substitution model, e.g. "JC", "HKY", "GTR+G". Run select_model first if you do not have a reason to prefer one. replicates: Bootstrap replicates (20-1000). Cost is roughly linear in this, so 100 is a reasonable default and 1000 is for a final answer. seed: Fixes both the resampling and the engine's search. sequence_type: "dna" (default) or "protein". DECLARED, never sniffed: an alignment of only A/C/G/T is a valid protein alignment too, so guessing would silently fit a nucleotide model to protein data. A protein alignment also needs a protein model — "LG+G" or "WAG", not the nucleotide default — so run select_substitution_model with the same sequence_type first.

ParametersJSON Schema
NameRequiredDescriptionDefault
seedNo
fastaYes
modelNoGTR+G
replicatesNo
sequence_typeNodna

Output Schema

ParametersJSON Schema
NameRequiredDescription
modelYes
engineYes
newickYes
supportYes
warningsYes
alignmentYes
log_likelihoodYes
reproducibilityYes
branch_length_unitsYes
newick_with_supportYes

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds substantial behavioral detail beyond the annotations (readOnlyHint=true, idempotentHint=true): it always bootstraps with no option to skip, cost scales linearly with replicates, seed fixes both resampling and engine search, and sequence_type is 'DECLARED, never sniffed' to avoid silent model mismatches. These are not captured by the annotations and provide valuable transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, then uses a clear Args list for parameter details. Every sentence earns its place—even the 'DECLARED, never sniffed' note is relevant. It is appropriately sized for a tool with 5 parameters and nuanced bioinformatics caveats, with no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity and that an output schema exists (so return values need no explanation), the description covers all critical context: prerequisites (aligned sequences), model selection guidance, bootstrap behavior, cost implications, and cross-tool dependencies (select_substitution_model). It is fully sufficient for an agent to understand when and how to invoke the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description compensates fully by explaining every parameter: fasta must be aligned and same-length, model examples and recommendation, replicates range and cost, seed's dual role, and sequence_type with a warning about protein alignments needing protein models. This is essential meaning that the schema alone lacks.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Build a maximum-likelihood tree and measure how well the data support it,' which is a specific verb+resource statement that clearly differs from sibling tools like select_substitution_model (model selection) and compare_trees (tree comparison). The title reinforces the purpose, and the description explicitly notes the tool always bootstraps, making it the right choice for supported phylogenetic inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit when-to-use guidance: 'Run `select_model` first if you do not have a reason to prefer one' and 'run select_substitution_model with the same sequence_type first' for protein data. It also states a key prerequisite: 'this server does not align,' implying the tool should not be used with unaligned sequences. These are clear usage directives and alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

select_substitution_modelRank substitution models, with the margin over the runners-upA
Read-onlyIdempotent

Compare substitution models and report how much the winner won by.

A single model name reads as a finding. The ranking, the delta to the next model, and whether AIC/AICc/BIC agree are what make it one.

Args: fasta: Aligned nucleotide sequences in FASTA. criterion: "AIC", "AICc" or "BIC". BIC penalises parameters more heavily. seed: Fixes the engine's search. top_n: How many ranked models to return. sequence_type: "dna" (default) or "protein". Ranks within that molecule type's model set — nucleotide and protein models are not comparable.

ParametersJSON Schema
NameRequiredDescriptionDefault
seedNo
fastaYes
top_nNo
criterionNoAIC
sequence_typeNodna

Output Schema

ParametersJSON Schema
NameRequiredDescription
seedYes
rankingYes
warningsYes
alignmentYes
criterionYes
best_modelYes
criteria_agreeYes
best_by_criterionYes
n_models_comparedYes
indistinguishable_from_bestYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Given that annotations already declare readOnlyHint and idempotentHint, the description adds useful behavioral context: it explains that the output includes the ranking, delta to the next model, and whether AIC/AICc/BIC agree, and that the seed fixes the engine's search. This goes beyond the annotations but is not exhaustive (e.g., no mention of error handling or performance), making a 4 appropriate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with a clear opening statement followed by a concise, well-organized Args list. Every sentence adds value: the first sentence states the purpose, the second explains what makes the output meaningful, and the Args section describes parameters without verbosity. It is front-loaded and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has an output schema, so the description does not need to detail return values, yet it still provides key context about the output (ranking, delta, AIC/BIC agreement). With 5 parameters and one required, the description covers all necessary aspects including sequence_type comparability and the role of the seed. It is complete for an AI agent to select and invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has zero description coverage (0%), so the description must fully compensate. It does this effectively by listing every parameter and adding meaning: it explains what fasta is, defines the criterion values with a note about BIC, states that seed fixes the search, clarifies top_n as the number of ranked models, and elaborates on sequence_type with the comparability caveat. This fully covers the schema's gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb phrase, 'Compare substitution models and report how much the winner won by,' which clearly states the tool's function and output. It distinguishes itself from sibling tools like infer_tree and compare_trees by focusing on substitution model ranking rather than tree inference or comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use the tool (when comparing substitution models) and includes a usage-relevant caveat: nucleotide and protein models are not comparable, so sequence_type must be chosen appropriately. However, it does not explicitly mention alternative tools or define when NOT to use this tool, so it scores a 4 rather than a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

simulate_alignmentSimulate an alignment from a known treeA
Read-onlyIdempotent

Generate sequences along a tree you specify, so the true answer is known.

This is the positive control for everything else here: infer a tree from the output and compare it back with compare_trees. If inference cannot recover a topology you generated from, the problem is the data or the settings, not the biology.

Args: newick: The true tree, with branch lengths. model: Substitution model to simulate under. length: Number of sites. seed: Fixes the simulation.

ParametersJSON Schema
NameRequiredDescriptionDefault
seedNo
modelNoJC
lengthNo
newickYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
seedYes
fastaYes
modelYes
warningsYes
alignmentYes
true_newickYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare idempotentHint=true and readOnlyHint=true, and the description adds context about being a simulation with known truth, without contradicting annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Concise at about 6 sentences, front-loaded with purpose, but the Args listing as a paragraph could be more structured; still clear and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema, the description fully covers usage, parameters, and purpose. It does not mention the exact output format but that is handled by the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema coverage, the description explains each parameter (newick, model, length, seed) with meaningful context beyond name/type, such as 'with branch lengths' for newick and 'fixes the simulation' for seed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'generate sequences along a tree you specify' with a specific verb and resource, and distinguishes from siblings like infer_tree and compare_trees by framing it as a positive control.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly positions this tool as a positive control, suggests a workflow with infer_tree and compare_trees, and explains how to interpret results if inference fails.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.3.0
    • Changedinfer_tree4 fields changed
      • addedInput schema / properties / sequence_type
        Added value: +{
        +  "default": "dna",
        +  "title": "Sequence Type",
        +  "type": "string"
        +}
      • addedOutput schema / properties / branch_length_units
        Added value: +{
        +  "title": "Branch Length Units",
        +  "type": "string"
        +}
      • addedOutput schema / properties / engine
        Added value: +{
        +  "additionalProperties": true,
        +  "title": "Engine",
        +  "type": "object"
        +}
      • changedOutput schema / required
        Previous value: -[
        -  "newick",
        -  "newick_with_support",
        -  "model",
        -  "log_likelihood",
        -  "alignment",
        -  "support",
        -  "reproducibility",
        -  "warnings"
        -]New value: +[
        +  "newick",
        +  "newick_with_support",
        +  "model",
        +  "log_likelihood",
        +  "alignment",
        +  "support",
        +  "reproducibility",
        +  "engine",
        +  "branch_length_units",
        +  "warnings"
        +]
    • Changedselect_substitution_model1 field changed
      • addedInput schema / properties / sequence_type
        Added value: +{
        +  "default": "dna",
        +  "title": "Sequence Type",
        +  "type": "string"
        +}
  2. 5 tool updatesv0.1.0
    • First observedcapabilities
    • First observedcompare_trees
    • First observedinfer_tree
    • First observedselect_substitution_model
    • First observedsimulate_alignment

TDQS

A4.4/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct phylogenetic task: model selection, tree inference, tree comparison, sequence simulation, and server introspection. There is no functional overlap between any pair of tools, so an agent can unambiguously choose the right one.

Naming Consistency4/5

Most tool names follow a clear verb_noun pattern (infer_tree, select_substitution_model, compare_trees, simulate_alignment). The exception is 'capabilities', which is a single noun, but it is a common and recognizable convention for a metadata endpoint, so the deviation is minor.

Tool Count5/5

With 5 tools, the server is tightly scoped for phylogenetic inference. Each tool is essential and complements the others, providing a complete but not bloated workflow. This is well within the ideal 3-15 range.

Completeness5/5

The tool set covers the full inference pipeline: select a substitution model, infer a tree with bootstrap support, simulate alignments for testing, and compare trees. The capabilities tool also exposes the server's bounds. The only absent step, alignment, is explicitly declared out of scope, so there are no critical gaps.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    A comprehensive Model Context Protocol (MCP) server for accessing the STRING protein interaction database. This server provides powerful tools for protein network analysis, functional enrichment, and comparative genomics through the STRING API.
    6
    4
    -
  • A
    license
    A
    quality
    D
    maintenance
    Enables the generation, mutation, and evolution of DNA and protein sequences using various evolutionary models and phylogenetic algorithms. It supports realistic next-generation sequencing read simulation and population-level evolutionary tracking for bioinformatics research and testing.
    6
    BSD 2-Clause "Simplified"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/musharna/phylokit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server